3

I have a bunch of MIDI files to render with the same Kontakt patch. I would like to automatic render a these MIDI files with command line, without needing to load any program manually or assign manually the kontakt patch to the midi track. I want to write my own program "MyProgram" and use it as follows : For example

MyProgram.exe -MIDI myMidiFile.mid -kontakt myPatch.nki -out myWav.wav,

which will render the MIDI file as Wav file with the specific Kontakt Patch I assigned. I don't have any plaform constraint, however, Windows would be the best I guess because of the VST context. I have no idea how to achieve that, if someone has an idea? Cheers

DarkVapor
  • 61
  • 6

2 Answers2

1

Not possible as specified unless NI has released something that I'm unaware of.

What is instead possible is generic VSTi plugin state persistence. (See http://vstdev.richackard.com/doc/vstsdk/faq.html). What you need is a command line VST host that will export/import the state as a file, so you can load it back again. This is useful because Kontakt is a VST plugin, so you'll be able to automate anything you want by controlling Kontakt over VST. Once set up, it would be conceptually possible to load and apply this state via a fully automated command line tool. This could definitely be implemented using the SDK, http://www.steinberg.net/en/company/developers.html More help on VST host development: http://teragonaudio.com/article/How-to-make-your-own-VST-host.html

I can only find one similar tool that already exists; I don't know for sure if it will work for you, but the forum posts I'm reading suggest it supports VST save states. http://teragonaudio.com/MrsWatson.html

Mrs Watson is open source, so you can extend it to better suit your needs if necessary.

VoidStar
  • 5,241
  • 1
  • 31
  • 45
  • Those first links you provided seem to be for designing a VSTi to be used in conventional digital audio workstations (e.g. cubase). For our purposes of purely automated audio generation, would it be simpler to use something like SuperCollider or even just a random python audio library (since the main task is just to convert midi to some audio samples according to a set of rules)? – pete Aug 24 '15 at 03:21
  • No, OP wants to render using Kontakt specifically, SuperCollider can't do that. He needs to interface with Kontakt, and Kontakt implements VSTi, which is why it's probably necessary to work via VST. The SDK I linked is used for both plugin authoring and host authoring, and he needs a command-line VST host w/ persistence. Then the tool could just load Kontakt as a VST plugin and render the midi over it. – VoidStar Aug 24 '15 at 05:41
0

I don't think you will be able to do it directly from the .nki file because this is Kontakt's own format and there isn't a function in the VST spec that will let you load it in that form.

What you may be able to do though is load Kontakt into a sequencer/DAW, load the nki file and then save the plugin state to an fxp file and then load that in your application. Note that Kontakt isn't currently VST3 so you'll need to use the VST2.x SDK.

the_mandrill
  • 29,792
  • 6
  • 64
  • 93