Musical Context

Musical context related functions. More...

function getBarDuration ()
 return the duration of a bar in ms. More...
 
function getBeatDuration ()
 return the duration of a beat in ms. More...
 
function getSamplingRate ()
 return the current audio sampling rate. More...
 
function getTempo ()
 return the current tempo. More...
 
function getTimeSignature ()
 the current time signature in the form num,den. More...
 
function getCC (cc)
 Retrieve the last control change value received for the given cc number. More...
 
function getTime ()
 get the number of milliseconds elapsed since the script engine start. More...
 
function getBeatTime ()
 get song position in beats. More...
 
function getRunningBeatTime ()
 get song position in beats. More...
 
function getNoteDuration (note)
 return the number of ms since the last note-on for the given note. More...
 
function isKeyDown (note)
 test wether a note's key is down. More...
 
function isOctaveKeyDown (note)
 test if a note is down ignoring octave. More...
 
function isNoteHeld ()
 return true is the note that created this callback is still held. More...
 

Detailed Description

Musical context related functions.

Function Documentation

function getBarDuration ( )

return the duration of a bar in ms.

See Also
getBeatDuration,getSamplingRate,getTempo
function getBeatDuration ( )

return the duration of a beat in ms.

See Also
getBarDuration,getSamplingRate,getTempo
function getSamplingRate ( )

return the current audio sampling rate.

See Also
getBarDuration,getBeatDuration,getTempo
function getTempo ( )

return the current tempo.

See Also
getBarDuration,getBeatDuration,getSamplingRate
function getTimeSignature ( )

the current time signature in the form num,den.

local num,den = getTimeSignature()
Returns
time signature numerator
time signature denominator
function getCC ( cc  )

Retrieve the last control change value received for the given cc number.

Parameters
ccthe contron change number in the range 0-127
Returns
the last control change value received
function getTime ( )

get the number of milliseconds elapsed since the script engine start.

Returns
current script engine time in milliseconds
function getBeatTime ( )

get song position in beats.

Returns
current song beat position in samples
function getRunningBeatTime ( )

get song position in beats.

From the host if playing and using an internal monotonic clock if not

Returns
current song beat position in samples
function getNoteDuration ( note  )

return the number of ms since the last note-on for the given note.

Parameters
notenote number in the range 0-127
Returns
note duration in milliseconds
function isKeyDown ( note  )

test wether a note's key is down.

Parameters
notenote number in the range 0-127
Returns
true if the note is down false otherwise
See Also
isOctaveKeyDown, isNoteHeld
function isOctaveKeyDown ( note  )

test if a note is down ignoring octave.

Parameters
notenote number in the range 0-127
Returns
true if the note is down, false otherwise
See Also
isKeyDown, isNoteHeld
function isNoteHeld ( )

return true is the note that created this callback is still held.

See Also
isKeyDown, isOctaveKeyDown
Examples:
tremolo.lua, and vibrato.lua.