Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { Compiled on Mon Jan 4 21:52:36 2021 }
- on init
- make_perfview
- set_script_title("SL Arcs Mods")
- set_ui_height_px(256)
- message("")
- declare $i := 0
- declare $note_id := 0
- declare $prev_pos := 0
- declare $keys_down := 0
- declare $offset_calc := 0
- make_persistent($offset_calc)
- declare ui_knob $kAttack(0, 1000000, 1)
- make_persistent($kAttack)
- set_text($kAttack,"Attack")
- set_knob_unit($kAttack,$KNOB_UNIT_MS)
- $kAttack := get_engine_par($ENGINE_PAR_ATTACK,0,0,-1)
- set_knob_label($kAttack,get_engine_par_disp($ENGINE_PAR_ATTACK,0,0,-1))
- declare ui_knob $kRelease(0, 1000000, 1)
- make_persistent($kRelease)
- set_text($kRelease,"Release")
- set_knob_unit($kRelease,$KNOB_UNIT_MS)
- $kRelease := get_engine_par($ENGINE_PAR_RELEASE,0,0,-1)
- set_knob_label($kRelease,get_engine_par_disp($ENGINE_PAR_RELEASE,0,0,-1))
- declare ui_knob $kOffset(0, 1000000, 10000)
- make_persistent($kOffset)
- set_text($kOffset,"Offset")
- set_knob_unit($kOffset,$KNOB_UNIT_PERCENT)
- declare ui_button $bLegato
- make_persistent($bLegato)
- set_text($bLegato,"Poly Legato")
- end on
- on ui_control($kAttack)
- $i := 0
- while ($i<$NUM_GROUPS)
- set_engine_par($ENGINE_PAR_ATTACK,$kAttack,$i,0,-1)
- inc($i)
- end while
- set_knob_label($kAttack,get_engine_par_disp($ENGINE_PAR_ATTACK,0,0,-1))
- end on
- on ui_control($kRelease)
- $i := 0
- while ($i<$NUM_GROUPS)
- set_engine_par($ENGINE_PAR_RELEASE,$kRelease,$i,0,-1)
- inc($i)
- end while
- set_knob_label($kRelease,get_engine_par_disp($ENGINE_PAR_RELEASE,0,0,-1))
- end on
- on ui_control($kOffset)
- $offset_calc := $kOffset
- end on
- on note
- ignore_event($EVENT_ID)
- if ($bLegato=1)
- if ($keys_down>0)
- $prev_pos := get_event_par($note_id,$EVENT_PAR_PLAY_POS)
- else
- $prev_pos := $offset_calc
- end if
- else
- $prev_pos := $offset_calc
- end if
- $note_id := play_note($EVENT_NOTE,$EVENT_VELOCITY,$prev_pos,-1)
- inc($keys_down)
- inc($keys_down)
- end on
- on release
- dec($keys_down)
- if ($keys_down<0)
- $keys_down := 0
- end if
- end on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement