What's new

Spitfire Strings Question

You could use this KSP multiscript to smooth the transition to niente. It uses CC11 to drop the volume levels smoothly below $CC1_MIN_THRESHOLD, which you can tweak as needed to adjust the transition point.

Code:
{ This is compiled code. Original source at https://gist.github.com/jtackaberry/cc28f6d974e632c6e0e9c6f1635afb7b }
on init
   declare const $CC1_MIN_THRESHOLD := 30
   declare %last_cc_in[128] := (127)
   make_persistent(%last_cc_in)
   read_persistent_var(%last_cc_in)
   declare $last_cc11_out := 127
   make_persistent($last_cc11_out)
   read_persistent_var($last_cc11_out)
   declare $value
end on

on midi_in
   if ($MIDI_COMMAND=$MIDI_COMMAND_CC and ($MIDI_BYTE_1=1 or ($MIDI_BYTE_1=11)))
       %last_cc_in[$MIDI_BYTE_1] := $MIDI_BYTE_2
       $value := %last_cc_in[1]*%last_cc_in[1]*%last_cc_in[11]/($CC1_MIN_THRESHOLD*$CC1_MIN_THRESHOLD)
       if ($value>%last_cc_in[11])
           $value := %last_cc_in[11]
       end if
       if ($MIDI_BYTE_1=11)
           ignore_midi
       end if
       if ($value # $last_cc11_out)
           set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC,11,$value)
           $last_cc11_out := $value
       end if
   end if
end on
 
Last edited:
You could use this KSP multiscript to smooth the transition to niente. It uses CC11 to drop the volume levels smoothly below $CC_MIN_THRESHOLD, which you can tweak as needed to adjust the transition point.

Code:
{ This is compiled code. Original source at https://gist.github.com/jtackaberry/cc28f6d974e632c6e0e9c6f1635afb7b }
on init
   declare const $CC1_MIN_THRESHOLD := 30
   declare %last_cc_in[128] := (127)
   make_persistent(%last_cc_in)
   read_persistent_var(%last_cc_in)
   declare $last_cc11_out := 127
   make_persistent($last_cc11_out)
   read_persistent_var($last_cc11_out)
   declare $value
end on

on midi_in
   if ($MIDI_COMMAND=$MIDI_COMMAND_CC and ($MIDI_BYTE_1=1 or ($MIDI_BYTE_1=11)))
       %last_cc_in[$MIDI_BYTE_1] := $MIDI_BYTE_2
       $value := %last_cc_in[1]*%last_cc_in[1]*%last_cc_in[11]/($CC1_MIN_THRESHOLD*$CC1_MIN_THRESHOLD)
       if ($value>%last_cc_in[11])
           $value := %last_cc_in[11]
       end if
       if ($MIDI_BYTE_1=11)
           ignore_midi
       end if
       if ($value # $last_cc11_out)
           set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC,11,$value)
           $last_cc11_out := $value
       end if
   end if
end on
wow, fancy. Is this commonly needed?
 
You could use this KSP multiscript to smooth the transition to niente. It uses CC11 to drop the volume levels smoothly below $CC_MIN_THRESHOLD, which you can tweak as needed to adjust the transition point.

Code:
{ This is compiled code. Original source at https://gist.github.com/jtackaberry/cc28f6d974e632c6e0e9c6f1635afb7b }
on init
   declare const $CC1_MIN_THRESHOLD := 30
   declare %last_cc_in[128] := (127)
   make_persistent(%last_cc_in)
   read_persistent_var(%last_cc_in)
   declare $last_cc11_out := 127
   make_persistent($last_cc11_out)
   read_persistent_var($last_cc11_out)
   declare $value
end on

on midi_in
   if ($MIDI_COMMAND=$MIDI_COMMAND_CC and ($MIDI_BYTE_1=1 or ($MIDI_BYTE_1=11)))
       %last_cc_in[$MIDI_BYTE_1] := $MIDI_BYTE_2
       $value := %last_cc_in[1]*%last_cc_in[1]*%last_cc_in[11]/($CC1_MIN_THRESHOLD*$CC1_MIN_THRESHOLD)
       if ($value>%last_cc_in[11])
           $value := %last_cc_in[11]
       end if
       if ($MIDI_BYTE_1=11)
           ignore_midi
       end if
       if ($value # $last_cc11_out)
           set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC,11,$value)
           $last_cc11_out := $value
       end if
   end if
end on
I have to admit, I'm impressed.
 
wow, fancy. Is this commonly needed?
Someone had asked the same question for CSS and the logic was fairly trivial so I offered it up then. Personally I don't mind controlling CC11 directly, but I can see why it would fit better for some people's workflows.
 
Top Bottom