# MIDI look ahead



## d.healey (Jun 3, 2013)

Is there any way in Kontakt (running inside a sequencer) to see how long a note is before the note has ended? A kind of MIDI look ahead. I imagine I could do this by first playing the sequence and have my script 'capture' it so the next time the sequence is played it knows, but I wondered if there is anything built in.

Thanks


----------



## mk282 (Jun 4, 2013)

Not possible.


----------



## d.healey (Jun 4, 2013)

:( shame. Thanks for the quick response


----------



## Hannes_F (Jun 4, 2013)

Synful Orchestra has this as a feature:

http://synful.com/

The idea is to have a general (but optional) delay in the seconds range which allows a script to look ahead (... ahead of the delayed audio output to be precise, not really ahead of the DAW project time).

However in case you want to put money into synful - I haven't seen any news from them since a few years.


----------



## d.healey (Jun 4, 2013)

Thanks Hannes, I'll have a look at that link


----------



## Reegs (Jun 4, 2013)

There's been a similar push for this feature with audio plugins, too. At the moment, the look ahead on your typical compressor also uses a delay buffer. The problem is that the Vst standard is designed as a linear, one-directional process (host gives input in real time, plug in processes and returns output as fast as possible). Presonus and Celemony have introduced the ARA addendum (Audio Random Access) so that Melodyne can request any part of an audio stream and the host sends it. I haven't seen the spec, but it might be possible to extend the standard to include Midi random access too. Other host companies (Steinberg, Cake, MOTU Avid) have not made any announcement about supporting it yet, unfortunately.


----------



## d.healey (Jun 4, 2013)

My ideas are ahead of the technology  I'll wait


----------



## synthetic (Jun 4, 2013)

Interesting idea though. Instead of sending a note on, then later sending a note off, you send a "note on; length 1/4 note." Not much use to anyone but the small number of people doing sample mockups, but maybe someone will tackle it.


----------



## SergeD (Jun 4, 2013)

I don't use Kontakt but I would try something like this:

In the sequencer, copy/paste each note as a RPN (or NRPN) event, some ticks before the note. Put each note duration value into the RPN value. Catch these RPN values into Kontakt.

With Sonar and a CAL script, this could be done easily, if I recall.

Hope this helps.


----------



## mbietenholz (Jul 3, 2013)

If you're willing to live with the delay, you could write a Kontakt script to delay all incoming MIDI events by say 2 seconds, and if the original note off comes before that time, the K script would have be able to know to the note length. After two seconds, it would then output a modified (if required) copy of the original event. However, for playinjg live this is of course useless, and if you're running from a sequencer anyway, I think it would be a lot easier to implement some keyswitches or midi-CC to do what you want and then just sequence them.


----------



## tmm (Jul 3, 2013)

I know nothing about Kontakt / MIDI scripting, but it sounds like a good solution would be for the sampler to read in the entire MIDI sequence before starting playback, so that it already has the information about all notes. I would think this sort of thing would only be feasible in playback, not in real-time performance, but would provide very useful information for virtual instrument creators to use. For example, you wouldn't need to specifically keyswitch / patch switch from longs to staccato - this information could be determined by the length of the note as mapped, and you would have a parameter in either Kontakt or the specific instrument setting the threshold of what could be considered short / medium / long for length, etc.


----------

