button for switching arp speed value
-
Hello, can someone please tell me how I can change the speed of my Arp with a button? if the button = 0 it should be at 1/8 and if it is 1 it should be at 1/16
-
You just need an if statement in your button's callback. I'm not 100% sure what the command is to change the arp speed but almost certainly it's going to use
.setAttribute()
- unless you've also added a speed knob to your UI then you could just change that from the button's callback instead.if (value) // set arp speed to 1/8 else // set arp speed to 1/16
-
@d-healey said in button for switching arp speed value:
You just need an if statement in your button's callback. I'm not 100% sure what the command is to change the arp speed but almost certainly it's going to use
.setAttribute()
- unless you've also added a speed knob to your UI then you could just change that from the button's callback instead.if (value) // set arp speed to 1/8 else // set arp speed to 1/16
<your arp >.setAttribute(<yourArp>.SpeedKnob, value);
-
@Lindon I tried this but the value changes only from 1/1 to 1/2D
inline function onSpeedButtonControl(component, value) { if (value) { Arpeggiator1.setAttribute(Arpeggiator1.SpeedKnob, 1/8); } else { Arpeggiator1.setAttribute(Arpeggiator1.SpeedKnob, 1/16); } }; Content.getComponent("SpeedButton").setControlCallback(onSpeedButtonControl);
-
@meto396 said in button for switching arp speed value:
Arpeggiator1.setAttribute(Arpeggiator1.SpeedKnob, 1/8);
1/8 isn't a recognised value. You need to use a tempo index (a number between 0 and 18 if I remember correctly), there are probably constants for this too.
-
@d-healey yup now it works