Hello, how do you determine the number of the group in the Transpose

redo2023
redo2023 Member Posts: 3 Member
edited July 2023 in Scripting Workshop

{***********************************************

Midi Transpose

Author: Native Instruments

Written by: Nicki Marinic

Modified: July 30, 2009

*************************************************}


on init


set_script_title("Transpose")

set_ui_height(2)

message("")


declare polyphonic $transposition {transposition interval in Semitones}

declare polyphonic $transposed_note {note number of transposed note}


declare ui_knob $Semi (-11, 11, 1)

set_knob_defval($Semi,0)

declare ui_knob $Octave (-10, 10, 1)

set_knob_defval($Octave,0)


move_control ($Semi, 3,2)

move_control ($Octave, 4,2)


$Semi := 0

$Octave := 0


make_persistent ($Semi)

make_persistent ($Octave)


end on


on note


ignore_event ($EVENT_ID)


$transposition := ($Octave * 12) + $Semi {delivers the actual transposition value}

$transposed_note := $EVENT_NOTE + $transposition {note number of transposed note}


if ($transposed_note < 0)

$transposed_note := 0

end if


if ($transposed_note > 127)

$transposed_note := 127

end if


play_note ($transposed_note, $EVENT_VELOCITY, 0, -1)


end on

Comments

Back To Top