|
From: Christian S. <sch...@li...> - 2017-06-03 11:33:35
|
On Saturday, June 03, 2017 08:58:57 Andrew C wrote:
> Hey list,
>
> Guess someone might find these scripts useful.
Just some tips on these ones ...
> if (%CC[64] = 127)
> note_off($active_note)
> $active_note := play_note($EVENT_NOTE, $EVENT_VELOCITY)
> else
>
> $active_note := play_note($EVENT_NOTE, $EVENT_VELOCITY)
>
> end if
I would recommend you to always use a comparison like this
if (%CC[64] > 63)
...
end if
for any CC switches instead, especially since half damper (continuous) pedals
become more and more popular. Otherwise your script will not work for those
people.
> Alternation script:
> ---
>
> on init
> declare $alt := 0
> end on
>
> on note
>
> select $alt
>
> case 0
> change_note($EVENT_ID, $EVENT_NOTE) {up bow}
> $alt := 1
> case 1
> change_note($EVENT_ID, $EVENT_NOTE+36) {down bow}
>
> $alt := 0
> end select
>
> end on
Since you mentioned before that you have some legato/glissando gig files, you
might also have a look at gig_set_dim_zone():
http://doc.linuxsampler.org/Instrument_Scripts/NKSP_Language/Reference/gig_set_dim_zone_function/
That function is extremely useful for writing scripts for gig format sounds.
For example your legato/glissando sounds most probably have their alternative
samples mapped to zones of the "Smart MIDI" dimension. By calling the upper
function i.e. like this:
gig_set_dim_zone($myNoteID, $GIG_DIM_SMARTMIDI, 2)
you would force the sampler to pick the third zone (zero indexed) of the smart
midi dimension for the requested note, and hence you can force the sampler to
play a different sample to be played on the same key (/ same region).
Obviously you can also use this function with all other dimensions. If the
region has more than one dimension, you can also call this function more than
once on the same note, to specifically force one specific dimension zone for
each dimensions.
CU
Christian
|