Affecting note_off events with change_vol?

Discussion in 'KONTAKT: Sampling, Programming & Scripting' started by KrisY, Feb 11, 2019.

  1. KrisY

    KrisY Member

    71
    5
    Mar 28, 2018
    Denmark
    Affecting note_off events with change_vol? Is it even possible? I know this is probably not possible, been trying everything I can think of, but with no luck. Seems most scripts use play_note to be able to affect the volume of the played note during or on note on.

    Is there a way to use note_off like this:

    Code:
    on note
        play_note...
        set_event_marks($EVENT_ID, $MARK_1)
    end on
    
    on release
        note_off((by_marks), $MARK_1)
        change_vol($MARK_1, -6000, 0)
    end on
    
    
    Been trying all sorts of options but I cannot get it to work.
     
    Last edited: Feb 11, 2019
  2. EvilDragon

    EvilDragon KSP Wizard

    5,680
    3,535
    May 25, 2010
    Croatia
    It should work, but you have a typo in note_off() command there. :)

    You probably don't want to use by_marks() here since that would influence ALL the events with that mark.

    Also, it actually might not work if internal release trigger script is being used, but I did not verify this.
     
  3. OP
    OP
    KrisY

    KrisY Member

    71
    5
    Mar 28, 2018
    Denmark
    Yes, thanks. To all who reads the code: My code above was a guide or a "notation" style code. It´s not correct, just noting my idea. Will refrain from doing that in the future, could potentially ruin someone´s hour :).

    You´re probably right about that, but the note_off is the key, if it at all handles change_vol. I have actually never seen it in any script. Only with play_note. If note_off and change_vol can in fact be used together, it´s a strange thing that it´s never in use, it would be a very very useful combo.

    With the internal release triggering functionality intact, using MARKS to enter on note events into groups (if cc64 was on, the pedal activates another group with longer recordings, requiring later/postponed note_off events for these). Then releasing them is possible by MARKS (using internal release script too) and activating release groups separately with key-switches, before using note_off(by_marks($MARK_X)). Like so:

    Code:
    on release
    
      { key-switches for release groups (using internal Kontakt rel triggering) }
      { KS1: MARK_X - "NOTES_ON_POFF", original notes played, before the "ignore_event" on note. }
      { KS2: MARK_Y - "NOTES_ON_PON", notes played while cc64/pedal is on, shorter samples }
    
      play_note(24,100,0,10)    { PLAY KEY-SWITCH, turning on first group, for pedal off release }
      note_off(by_marks($MARK_X))
    
      ///// here we want to change_vol for events in MARK_X ... but it doesn´t work.
    
      wait(800)
    
      play_note(26,100,0,20)    { PLAY KEY-SWITCH, turning on second group, for pedal on release }
      note_off(by_marks($MARK_Y))
    
      ///// here we want to change_vol for events in MARK_Y ...
    
    end on
    For this script, I am using separated release groups for time-bases with (t/ms setting in group editor), instead of a custom formula for time and velocity changes.

    If indeed you cannot use change_vol to change a note_off event, without disabling kontakt´s own release trigger script, the whole concept falls short. Because note_off can´t be used to trigger a release sample anymore, right? If kontakt´s internal release is off, groups do not trigger "on release" by default.

    I guess you could use it, if only to trigger a new play_note + change_vol. But that annuls the issue and requires a more complex custom release script.
     
  4. EvilDragon

    EvilDragon KSP Wizard

    5,680
    3,535
    May 25, 2010
    Croatia
    Well that's not a problem at all, you'd just script your own play_note() and allow the release groups...
     
    KrisY likes this.
  5. OP
    OP
    KrisY

    KrisY Member

    71
    5
    Mar 28, 2018
    Denmark
    I have done all tests necessary now. Note off cannot be changed by change_vol, in any of my combos. Since note_off only responds to a previous play_note event, and can only be used to trigger a group with the in
    Yes, of course. But I want to use note_off to be able to utilize the rls. trig. counter function. play_note does not make that possible on release. I have given up on this now though. I have done all tests necessary now. note_off cannot be changed by change_vol, in any of my combos. Since note_off only responds to a previous play_note event, and can only be used to trigger a group with the internal kontakt release function turned on, if we are to utilize any modulator based on a group being set to "Release Trigger". So it´s a catch 22.

    Now, turning off and on release groups on release is possible and usable even with the internal release function turned on. But the change_vol is not applicable, unless, as you stated, "script your own play_note()", exiting the whole idea about using the internal release function, note_off.
     
  6. OP
    OP
    KrisY

    KrisY Member

    71
    5
    Mar 28, 2018
    Denmark
    Of course, I can still use note_off(by_marks,($MARK_X)) to trigger a new release event, at a specific sequence, like my script above tries to state. Excluding the need for key-switches, and following the note_off with your idea, a new play_note. Thanks for the help.
     

Share This Page