# Kontakt Global Reset via MIDI



## sachsm (Aug 3, 2007)

Hello all,

I have a need to be able to reset all instruments within a Multi with a MIDI command.
By reset I mean that the instrument stops any notes and resets the script so that there is no chance that it will generate further notes on its own. I am currently issuing a MIDI All Notes Off ($7B) command on all MIDI channels and additionally issuing a shotgun of NOTE OFF messages to each note on each channel. This does not always work since the script may still be generating more notes. Any suggestions would be greatly appreciated.

Mike Sachs


----------



## Nickie Fønshauge (Aug 3, 2007)

An ALL Notes OFF is the same as a CC#123 message. Make your script look for this message and upon receipt take appropriate acction (stop generating notes). If the script generates a CC#123=0 message itself, all playing notes should be silenced, provided Instrument Options | Controller | Accept All Notes OFF is checked.


----------



## sachsm (Aug 4, 2007)

Lets take an example instrument that uses the *Input Quantize* and *Retrigger *scripts.
I added the following code to each script as you suggested. But I find that it does not turn off all the notes immediately.

on controller
note_off ($ALL_EVENTS)
set_controller(123, 0)
end on

Could you tell me what else I need to do in the script to silence all notes?


----------



## kotori (Aug 4, 2007)

Hi Mike
Please make sure that your instrument supports All Notes Off / All Sounds Off by checking that checkbox in the instrument options.

Nils


----------



## sachsm (Aug 4, 2007)

Hi Nils,

Thanks for your idea, I did check that option and but it still does not respond correctly.
The notes eventually do die out, but they seem to be doing that on there own since there are no more keys pressed. I verified that the on controller code is being executed when I send a All Notes Off CC message. But this is not stopping the other 'polyphonic' note events from returning back into the retrigger script.


----------



## sachsm (Aug 4, 2007)

It seems like it would be very useful to have a generic reset script mechanism so that each script does not have to be modified in idiosyncratic ways just to perform what IMHO could be a built-in system level function. After all the purge instrument can do this so why not be able to automate it.


----------



## sachsm (Aug 4, 2007)

*FOUND THE SOLUTION!!!*

Here is the script code that can effectively turn off the generated notes in the
Retrigger script that is running in the ALLDRUMSANDBASS instrument.

on controller
change_vol ($ALL_EVENTS,-10000,1)
note_off ($ALL_EVENTS)
note_off ($MARK_1)
$retrig_time :=0
set_controller(123, 0)
end on

It appears that the change_vol mutes the notes that note_off cannot reach.
Perhaps note_off cannot stop certain types of samples from running their full length.


----------

