on init
set_script_title("Copy CC# to all Ch.")
declare $ch
declare $i
declare ui_value_edit $CC_num1(-1, 127, 1)
declare ui_value_edit $CC_num2(-1, 127, 1)
declare ui_value_edit $CC_num3(-1, 127, 1)
declare ui_value_edit $CC_num4(-1, 127, 1)
declare ui_value_edit $CC_num5(-1, 127, 1)
declare ui_value_edit $CC_num6(-1, 127, 1)
declare ui_value_edit $CC_num7(-1, 127, 1)
declare ui_value_edit $CC_num8(-1, 127, 1)
declare ui_value_edit $CC_num9(-1, 127, 1)
declare ui_value_edit $CC_num10(-1, 127, 1)
declare ui_value_edit $CC_num11(-1, 127, 1)
declare ui_value_edit $CC_num12(-1, 127, 1)
declare ui_value_edit $CC_num13(-1, 127, 1)
declare ui_value_edit $CC_num14(-1, 127, 1)
declare ui_value_edit $CC_num15(-1, 127, 1)
declare ui_value_edit $CC_num16(-1, 127, 1)
declare ui_value_edit $CC_num17(-1, 127, 1)
declare ui_value_edit $CC_num18(-1, 127, 1)
set_text($CC_num1,"CC#")
set_text($CC_num2,"CC#")
set_text($CC_num3,"CC#")
set_text($CC_num4,"CC#")
set_text($CC_num5,"CC#")
set_text($CC_num6,"CC#")
set_text($CC_num7,"CC#")
set_text($CC_num8,"CC#")
set_text($CC_num9,"CC#")
set_text($CC_num10,"CC#")
set_text($CC_num11,"CC#")
set_text($CC_num12,"CC#")
set_text($CC_num13,"CC#")
set_text($CC_num14,"CC#")
set_text($CC_num15,"CC#")
set_text($CC_num16,"CC#")
set_text($CC_num17,"CC#")
set_text($CC_num18,"CC#")
make_persistent($CC_num1)
make_persistent($CC_num2)
make_persistent($CC_num3)
make_persistent($CC_num4)
make_persistent($CC_num5)
make_persistent($CC_num6)
make_persistent($CC_num7)
make_persistent($CC_num8)
make_persistent($CC_num9)
make_persistent($CC_num10)
make_persistent($CC_num11)
make_persistent($CC_num12)
make_persistent($CC_num13)
make_persistent($CC_num14)
make_persistent($CC_num15)
make_persistent($CC_num16)
make_persistent($CC_num17)
make_persistent($CC_num18)
move_control($CC_num1,1,1)
move_control($CC_num2,2,1)
move_control($CC_num3,3,1)
move_control($CC_num4,4,1)
move_control($CC_num5,5,1)
move_control($CC_num6,6,1)
move_control($CC_num7,1,2)
move_control($CC_num8,2,2)
move_control($CC_num9,3,2)
move_control($CC_num10,4,2)
move_control($CC_num11,5,2)
move_control($CC_num12,6,2)
move_control($CC_num13,1,3)
move_control($CC_num14,2,3)
move_control($CC_num15,3,3)
move_control($CC_num16,4,3)
move_control($CC_num17,5,3)
move_control($CC_num18,6,3)
end on
on midi_in
$ch := $MIDI_BYTE_1 mod 16
if ($MIDI_COMMAND=$MIDI_COMMAND_CC and ($MIDI_BYTE_1=$CC_num1 or $MIDI_BYTE_1=$CC_num2 or $MIDI_BYTE_1=$CC_num3 or $MIDI_BYTE_1=$CC_num4 or $MIDI_BYTE_1=$CC_num5 or $MIDI_BYTE_1=$CC_num6 or $MIDI_BYTE_1=$CC_num7 or $MIDI_BYTE_1=$CC_num8 or $MIDI_BYTE_1=$CC_num9 or $MIDI_BYTE_1=$CC_num10 or $MIDI_BYTE_1=$CC_num11 or $MIDI_BYTE_1=$CC_num12 or $MIDI_BYTE_1=$CC_num13 or $MIDI_BYTE_1=$CC_num14 or $MIDI_BYTE_1=$CC_num15 or $MIDI_BYTE_1=$CC_num16 or $MIDI_BYTE_1=$CC_num17 or $MIDI_BYTE_1=$CC_num18))
set_midi($ch,$MIDI_COMMAND,$MIDI_BYTE_1,$MIDI_BYTE_2)
$i := 0
while ($i <= 63)
set_midi($i, $MIDI_COMMAND, $MIDI_BYTE_1, $MIDI_BYTE_2)
$i := $i + 1
end while
end if
end on
on controller
if ($CC_NUM = 64)
ignore_controller
end if
end on
on init
declare ui_value_edit $Chan (1, 16, 1)
declare ui_button $FilterPedal
make_persistent($Chan)
make_persistent($FilterPedal)
end on
on midi_in
if ($MIDI_CHANNEL = $Chan - 1)
if ($MIDI_COMMAND = $MIDI_COMMAND_CC and $MIDI_BYTE_1 = 64)
ignore_midi
end if
end if
end on
on controller
if ($CC_NUM = 64)
ignore_controller()
end if
end on
{ Compiled on Tue Jan 23 22:24:59 2024 }
on init
declare %events[127]
declare $split := 48
declare $event
end on
on controller
if ($CC_NUM=64 and (%CC[64]<60))
$event := 0
while ($event<=126)
if (%KEY_DOWN[$event] # 1 and (%events[$event] # 0))
note_off(%events[$event])
%events[$event] := 0
end if
inc($event)
end while
end if
end on
on note
if (%events[$EVENT_NOTE] # 0)
fade_out(%events[$EVENT_NOTE],300,1)
end if
%events[$EVENT_NOTE] := $EVENT_ID
end on
on release
if (%CC[64]>=60)
if ($EVENT_NOTE<=$split)
ignore_event($EVENT_ID)
else
%events[$EVENT_NOTE] := 0
end if
else
%events[$EVENT_NOTE] := 0
end if
end on
без первоисточника ничо непонятно{ unsustained incoming note played using all groups except the first group (group 0) }
on init
declare polyphonic $id
declare const $SUSTAINED := $MARK_26
SET_CONDITION(NO_SYS_SCRIPT_PEDAL)
end on
on note
{ sustained generated note played using first group (group 0) }
disallow_group($ALL_GROUPS)
$id := play_note($EVENT_NOTE, $EVENT_VELOCITY, 0, 0)
{ unsustained incoming note played using all groups except the first group (group 0) }
allow_group($ALL_GROUPS)
end on
on release
{ if sustain pedal pressed }
if (%CC[64] >= 64)
set_event_mark($id, $SUSTAINED)
else
note_off($id)
end if
end on
on controller
{ if sustain pedal released }
if (%CC_TOUCHED[64] # 0 and %CC[64] < 64)
note_off(by_marks($SUSTAINED))
end if
end on
как у меня ‒ по номеру ноты. Просто фильтруйте диапазон, на котором скрипт работать не должен.Я просто не понимаю как группы к скрипту привязать
вот, например код, но работает только free режим почему тоДрузья, а как в KSP 7 управлять синхронизацией LFO? Допустим есть cutoff фильтра и LFO1. Допустим есть кнопка синхронизации нажав на которую knob перестаёт работать во free режиме.
Спасибо!
declare ui_slider $LFOsync( 0, 1000000 )
declare ui_label $LFOsynclb( 1, 1 )
declare ui_switch $SYNC
declare const $NUM_FX_SYNC_TIMES := 20
declare const $NUM_MOD_SYNC_TIMES := 34
declare const $SYNC_DIV := 1000000 / ($NUM_FX_SYNC_TIMES - 1)
declare %mod_sync_units[$NUM_MOD_SYNC_TIMES] := ($NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_WHOLE, $NI_SYNC_UNIT_QUARTER, $NI_SYNC_UNIT_WHOLE_TRIPLET, $NI_SYNC_UNIT_HALF, $NI_SYNC_UNIT_8TH, $NI_SYNC_UNIT_HALF_TRIPLET, $NI_SYNC_UNIT_QUARTER, $NI_SYNC_UNIT_16TH, $NI_SYNC_UNIT_QUARTER_TRIPLET, $NI_SYNC_UNIT_8TH, $NI_SYNC_UNIT_32ND, $NI_SYNC_UNIT_8TH_TRIPLET, $NI_SYNC_UNIT_16TH, $NI_SYNC_UNIT_64TH, $NI_SYNC_UNIT_16TH_TRIPLET, $NI_SYNC_UNIT_32ND, $NI_SYNC_UNIT_256TH, $NI_SYNC_UNIT_32ND_TRIPLET, $NI_SYNC_UNIT_64TH, $NI_SYNC_UNIT_256TH, $NI_SYNC_UNIT_64TH, $NI_SYNC_UNIT_256TH, $NI_SYNC_UNIT_256TH)
declare %mod_sync_value[$NUM_MOD_SYNC_TIMES] := (0,90909,181818,272727,363636,454545,545454,636363,727272,818181,909090,999999,818181,999999,999999,818181,999999,999999,818181,999999,999999,818181,999999,999999,818181,999999,999999,545454,999999,999999,818181,999999,909090,999999)
declare !dly_sync_string[20]
!dly_sync_string[19] :="1/1"
!dly_sync_string[18] :="1/2 D"
!dly_sync_string[17] :="1/1 T"
!dly_sync_string[16] :="1/2"
!dly_sync_string[15] :="1/4 D"
!dly_sync_string[14] :="1/2 T"
!dly_sync_string[13] :="1/4"
!dly_sync_string[12] :="1/8 D"
!dly_sync_string[11] :="1/4 T"
!dly_sync_string[10] :="1/8"
!dly_sync_string[ 9] :="1/16 D"
!dly_sync_string[ 8] :="1/8 T"
!dly_sync_string[ 7] :="1/16"
!dly_sync_string[ 6] :="1/32 D"
!dly_sync_string[ 5] :="1/16 T"
!dly_sync_string[ 4] :="1/32"
!dly_sync_string[ 3] :="1/64 D"
!dly_sync_string[ 2] :="1/32 T"
!dly_sync_string[ 1] :="1/64"
!dly_sync_string[ 0] :="1/64 T"
end on
on ui_control ($LFOsync)
if ($SYNC = 1)
set_engine_par($ENGINE_PAR_INTMOD_FREQUENCY_UNIT, %mod_sync_units[$LFOsync/$SYNC_DIV], 0, get_mod_idx(0, "LFO1"), -1)
set_engine_par($ENGINE_PAR_INTMOD_FREQUENCY, %mod_sync_units[$LFOsync/$SYNC_DIV],0, get_mod_idx(0, "LFO1"), -1)
set_control_par_str(get_ui_id($LFOsynclb), $CONTROL_PAR_TEXT, !dly_sync_string[$LFOsync/$SYNC_DIV])
else
set_engine_par($ENGINE_PAR_INTMOD_FREQUENCY_UNIT ,$NI_SYNC_UNIT_ABS, 0, get_mod_idx(0, "LFO1"), -1)
set_engine_par($ENGINE_PAR_INTMOD_FREQUENCY ,$LFOsync, 0, get_mod_idx(0, "LFO1"), -1)
set_control_par_str(get_ui_id($LFOsynclb), $CONTROL_PAR_TEXT, get_engine_par_disp($ENGINE_PAR_INTMOD_FREQUENCY, 0, get_mod_idx(0, "LFO1"), -1))
end if
end on
%mod_sync_values