1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Natural fade out script

Discussion in 'AKOUSTIK PIANO' started by OlivierFRAPPIER, 21/10/05.

Thread Status:
Not open for further replies.
  1. OlivierFRAPPIER

    OlivierFRAPPIER Forum Member

    Messages:
    155
    {***********************************************************

    Self-mask idea for any Piano : natural fade out
    Self Mask : O.FRAPPIER

    ***********************************************************}
    on init

    message ("")

    declare %note_id[128]
    declare %note_old_id[128]
    declare %vel[128]
    declare %vel_old[128]
    declare %n[128]
    declare %m[128]
    declare $f


    declare ui_knob $Selfmask (0, 1000, 1000)
    $Selfmask :=100
    make_persistent ($Selfmask)

    end on

    on note

    {Self-mask}

    %vel_old[$EVENT_NOTE] := 0
    %note_old_id[$EVENT_NOTE] := 0
    %note_old_id[$EVENT_NOTE] := %note_id[$EVENT_NOTE]
    %vel_old[$EVENT_NOTE] := %vel[$EVENT_NOTE]
    %note_id[$EVENT_NOTE] := $EVENT_ID
    %vel[$EVENT_NOTE] := $EVENT_VELOCITY
    %n[%vel_old[$EVENT_NOTE]] := %note_old_id[$EVENT_NOTE]
    %m[%vel_old[$EVENT_NOTE]] := %vel_old[$EVENT_NOTE]
    $f := 0
    while($f < 128)
    if (%m[$f] < %vel[$EVENT_NOTE])
    fade_out(%n[$f],$Selfmask*100,1)
    end if
    inc($f)
    end while

    end on
     
  2. Jrw

    Jrw NI Product Owner

    Messages:
    30
    Once again how do we use these???
     
Thread Status:
Not open for further replies.