play_note return

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

Does play_note return immediately after being called, or after the note it is playing ends? What does it return?
If I want to have a second Play_note start after the first play_note begins, but before the first played note ends (so they overlap mid way) how is that achieved?

Post

If you set a variable to play_note, the variable stores the event ID generated. For example..

$e := play_note(60,60,0,-1)

This would play MIDI note 60, at velocity 60, with no sample offset (0), and release the note when the triggering key is released (-1). If you set -1 to 0, the note will sustain indefinitely. If you set it to >0, the note will sustain for a set length of time before releasing.

$e then is set to the unique ID of the generated note.

You can run as many play_notes as you like regardless of how many active voices there are. (Well, there's probably a limit somewhere, but that's beside the point.) You can even play the same MIDI note multiple times and the voices will just stack.

Besides the release behavior set by play_note itself, you can manipulate the events however you would like. For example, by using fade_out and note_off, combined with custom logic for the 'on release' callback.
Shreddage 3 Stratus: Next generation Kontakt Player guitar, now available!

Impact Soundworks - Cinematic sounds, world instruments, electric guitars, synths, percussion, plugins + more!

Post

zircon wrote:If you set -1 to 0, the note will sustain indefinitely.
Only in case the sample is looped. The more correct statement is "if length parameter is set to 0, it will play the sample back in its entirety" :)

Post

zircon,

thank you!

So, let's say the first play_note is for 8 beats. How would I start a second play_note let's say, two beats after the first play note?

Post

Use wait() command.

Post

ED,

Thank you. But does the first play_note return after 8 beats, or immediately? How do I wait two beats after the first play_note begins (not ends)

Post

gwhiz wrote:But does the first play_note return after 8 beats, or immediately? How do I wait two beats after the first play_note begins (not ends)
You get it wrong, there is no return. The note starts to play after callback is finished or during wait time invoked by wait command. Use play_note command, do whatever else calculations you need to do, execute wait command, and note starts at wait command.

Post

ZQ,

We are trying to play two notes, one immediately that lasts for 8 beats, another after two beats of rest. So, in the on note, we call play_note to play the first note, then wait ($DURATION_BEAT * 2) the play_note for note two?
So play_note #1 continues to play for 8 beats, and the #2 start after the two beat wait?

Post

Correct.

Post Reply

Return to “Samplers, Sampling & Sample Libraries”