20.4. User defined Functions
function
…
end function
Declares a function
call
Calls a previously declared function
Remarks
The function has to be declared before it is called.
Examples
on init
declare $root_note := 60
declare ui_button $button_1
set_text ($button_1,"Play C Major")
declare ui_button $button_2
set_text ($button_2,"Play Gb Major")
declare ui_button $button_3
set_text ($button_3,"Play C7 (b9,#11)")
end on
function func_play_triad
play_note($root_note,100,0,300000)
play_note($root_note + 4,100,0,300000)
play_note($root_note + 7,100,0,300000)
end function
on ui_control ($button_1)
$root_note := 60
call func_play_triad
Do'stlaringiz bilan baham: |