This is probably pointless exercise, because it is what people use sequencers for, but I made an attempt at writing a script which would record and playback incoming note sequences in Kontakt. I was aiming at something that would allow me to record sequences while playing and then switch through them from keyboard. I took it to a point where I'm able to jam with it, e.g. trigger different drum loops and bass loops while playing another instrument. Feel free to try it out.
DOWNLOAD revision C
These are script preset files, they need to be uncompressed to multiscript preset folder (in my Windows it's "my documents\Native Instruments\Kontakt 4\presets\multiscripts"). This is multiscript, so you load it on top of some instruments. It has been written in Kontakt 4.2.4.
Update: revision C scripts should fix incompatibility with midi controllers, which use zero velocity note on command instead of note off command. Also midi learn function, may be a bit more bulletproof in this version and key cluster tape change automation functionality is fixed for reel 2. Rev C pack contains x2 and x4 versions.
It is an experiment and it is possible, it may have some bugs, so be cautious with it. I don't have the drive for bulletproof testing of this script, so take it as it is, maybe you will find it useful, but have in mind that it may go south at some point.
Note, if you re-save the preset, all recorded sequences will be saved within the preset, so you can easily make sequence sets.
A little guide to the script.
The script will memorize incoming note on and note off messages (no other MIDI data is processed) and then play back the sequence on request.
There are two versions of the script "x1" is a kind of one track recorder and "x2" has two tracks, so you can playback two sequences simultaneously.
to start recording, which actually starts on first incoming note (the gap before pressing record button and receiving first note is ignored). When done press record
again to stop the recording, or press play
to stop recording and start playback right away. If loop
switch is on, recorded sequence will play in a loop, else it will stop after last note. If auto rewind
switch is on, the recorded sequence will start from beginning, when you press play
button, else it will start from where it stopped.
There are 8 "tapes" per reel, so you can record up to 8 sequences which you can switch through while playing. If play button is on, tape will not change immediately, but it will be scheduled. After coming to the end of currently playing sequence, the machine will load selected sequence. This way you can switch loops "in advance". Each tape can store up to 2040 events, so a bit more than 1000 notes. If the limit is reached, the recording should stop automatically.
Play, record and tape change commands can be automated with midi keyboard. Note, that key used for automation will be unavailable for triggering notes. Tape change command has three automation modes, you can use CC message, a series of 8 keys, where pressing a key will load corresponding tape, or use one key to toggle through tapes. In last mode there is option named "select empty", when the switch is off, the machine will only toggle through recorded sequences, skipping empty tapes (as selecting empty tape will stop playback).
is function, which will try to align recorded sequences to current tempo. When it's activated, the machine will wait for sync when starting to play the sequence, on play button or when restarting a loop. There is no synchronization in between, so this machine is not suitable to playback whole songs, better stick to 1-6 measure loops. So, e.g., if you pick snap resolution to whole note in 4/4 meter, have snap switches enabled and press play, the sequence will start at beginning of next measure.
is function which will attempt to recalculate recorded times to fit a recording to different tempo. This is somewhat tricky, as the machine memorize events like this: note on, wait some thousands milliseconds, note off, etc. At the moment of recording, the quarter note length is stored, which is then being compared to current quarter note length and used to recalculate waiting times throughout the recording. Tempo changes while recording are not stored.
setting is simple transpose function, it will add key value to note numbers on playback.
settings can be used to pick a source of data, in case you have multiple controllers. "x2" version of the script has simple data router, so you can switch instruments while playing/recording. Changing channel/port can be automated with a key or CC.
There are somewhat limited "sequencing" options in Kontakt multiscript, so I made this script using "wait" command together with, $KSP_TIMER and $DISTANCE_BAR_START variables (first to detect event times, second to sync with tempo). The second variable is only being updated in Kontakt when transport is running, so synchronization will fail, if the play button is off in host. In standalone mode, it will always work, as Kontakt assumes transport is always on.
Feel free to write me, if you find it usable, yet limited or bugged in some aspect. I may look into it again.