Arpeggio sustain notes Pbind

Hey, how can i play an arppegio via a Pbind and sustain all the notes until the last one has finished its duration?

On my phone here, but the simplest way is to play all the notes as a chord by providing an array to one of the pitch parameters (e.g. \degree, Pseq([[1,2,3]], inf)). Then use the \strum key to offset start times, and use \strumEndsTogether, true to end them at the same time. If the pattern is non-deterministic or has an unknown number of notes, you will likely have to do something more complicated

1 Like

hey, thank you very much :slight_smile: . is it necessary to bind \strum to \dur, so that all the notes have been played with their corresponding offset value via \strum before the next \dur happens?

No, as with single-note patterns, you can make chords sustain longer than \dur times by increasing \sustain. You can make \sustain dependent on \dur by using \legato. (\sustain = \dur * \legato * \stretch). Therefore, \legato > 1 causes overlapping chords, \legato < 1 causes gaps between chords. You have to be careful using short \sustain times though, because if your accumulated \strum times are longer than your \sustain time, later strummed notes will not receive the release msg, and they will hang around forever, as demonstrated below…

    \degree, Pseq([[0,2,4], [2,4,6]], inf),
    \dur, 1,
    \legato, 1,
    \strum, 1/3,
    \strumEndsTogether, true

// run the following lines one at a time to hear the effect:
Pbindef(\testStrum, \legato, 2); // overlapping chords
Pbindef(\testStrum, \dur, 2); // more time between chords, but overlapping still occurs due to legato=2
Pbindef(\testStrum, \legato, 1/2); // make space between chords
Pbindef(\testStrum, \dur, 1); // back to normal dur. OOPS, what happened???
// notice the "Node not found" messages -- notes are being released before they are being played due to accumulated \strum times being longer than \sustain times. Later strummed notes are still played, but they hang around forever, unless we fix it...
Pbindef(\testStrum, \legato, 1); // back to normal \legato. Previous notes still hang around until...
Server.default.defaultGroup.set(\gate, 0); // release the hung notes

thanks you very much :slight_smile:

just a quick note - it can be useful to look at the source for Event - you will find there all the default duration and frequency keys - a very handy reference!

1 Like

any ideas how i can set \strum when i have a changing amount of notes in \midinotes and a changing value for \dur so i dont get overlapping notes? thanks :slight_smile: