Page tree
Skip to end of metadata
Go to start of metadata

playNote(note, velocity, duration, layerOrZone, volume, pan, tune)

Description

Function to generate note events.

  • If duration is -1 the generated note plays as long as the key that called playNote is held.
  • If duration is greater 0 the note plays as long as the key is held, but maximum for the time specified in milliseconds.
  • If duration is 0 playNote generates only the note-on event. The release can be managed manually with onRelease or with releaseVoice and the ID returned by playNote.

Available in: Processor.

Arguments

noteThe note number of the note in the range of 0 to 127.number
velocityThe velocity of the note in the range of 0 to 127.number
durationThe length of the note in milliseconds. The default is -1.number, optional
layerOrZoneThe layer or zone which shall receive the note. Only elements after the script module are addressable. The default is nil (all layers).Layer or Zone, optional
volume

The initial volume in the range of 0 to 1.0. The default is 1.0.

number, optional
panThe initial pan position in the range of -1.0 to 1.0. The default is 0.number, optional
tuneThe initial tuning in the range of -120.0 to 120.0. The default is 0.number, optional

Return Values

Returns the note ID of the generated note.

Example