Rests

Is the only way to have a rest is by using wait()?

I am trying to go from a gibber.cc (x.x.)-inspired drum sequence to SCAMP

drum_lengths = seq_to_scamp([1, 0, 1, 0], 2)
# this is a drum sequence with the 8th note as the pulse
# what it returns is [1, 1] instead of 8th, rest, 8th, rest

The above solution is only okay when the sequence starts with a note and also it makes the music read as more legato than potentially desired.

Is there a way to have a drum.play_note(rest,length)?
I tried drum.play_note(pitch, 0, length) and that just mutes it in playback

I know I could make seq_to_scamp return:

drum.play_note(pitch, vel, 0.5)
wait(0.5)
drum.play_note(pitch, vel, 0.5)
wait(0.5)

…but I am looking/hoping for more flexibility.

Cheers

1 Like

Yeah, the way to rest in SCAMP is by waiting. The reason is that in SCAMP you interact with an ensemble not a score, so a rest is just the absence of playing a note. I would just do something like:

if pitch == 0:
    wait(dur)
else:
    drum.play_note(pitch, vol, dur)

That said, I could consider making inst.play_note(None, volume, dur) be an alias to wait(dur). I can’t really see any harm in it, and at times it would be convenient.

2 Likes