In BespokeSynth, how could I play a sequence of notes (notesequencer
) when pressing a note, and stopping it when pressing it again?
1 Answer
There are multiple ways to do that. As far as I know, they are all based on the notecounter
node that asks to the nodesequencer
to play the notes when it's enabled (when it's disabled and re-enabled again, it will restart the sequence from 0).
Note that for this to work, YOU NEED TO HAVE notecounter
WITH SYNC DISABLED, otherwise it will follow the tempo. Note that in Bespoke 1.1.0, I experienced some issues with disabling sync (nothing happens when I click the button), but this can be solved by connecting a valuesetter
to the sync button and clicking on set
:
Therefore, the question is now "How can we enable/disable a node (here notecounter
) when a key is pressed?" and we can do it using various methods:
Version 1: Simpler: notetopulse and radiosequencer
The simpler solution (thanks Noxy!) is to use the radiosequencer
(which is basically made exactly for enabling one module at a time):
Basically, the notetopulse
sends a "pulse" (a single signal) everytime a note is pressed. This pulse will then go to the next column in the radiosequencer
(a white cell means "enable", a black means "disabled"): because it contains only two column, it will basically loop between enable/disable, and therefore enable/disable the notecounter that will order notesequencer
to play.
Version 2: notetoggle
(if you prefer to play only when the key is down)
If you prefer to play the sequence only when the key is kept pressed, you can use notetoggle
, that will simply enable a control when a note is played (thanks Noxy), and disable the control when no note is played:
If you want instead to play until another note is played (and don't want to use the first solution), then you may like the notelatch
mode that will keep playing a note until you press the note a second time. To make sure you don't always need to press the same note, you can use pitchsetter
(or notecreator
and notetopulse
if you like complicated setups) that plays a note on a pulse like that:
Version 3: Note-stepper/value-setter
This solution is also an equivalent of the first solution (thanks Argon_V/Juraj/WinglessFly/George and jwdungbat), except that the stepper is on the notes instead of on the pulse, and we use then a value setter to configure the value enable/disable
:
The notestepper
will basically forward the note to a different output everytime a new note is pressed. Then, we use valuesetter
to enable/disable the notecounter
, which are fired when a pulse reaches them (hence the notetopulse
).