Render MIDI file to wav with Kontakt 5 nki file

I would like to automatic render a MIDI file with command line, without needing to load Ardour or assign manually the kontakt patch to the midi track.

For example ardour.exe -MIDI myMidiFile.mid -kontakt myPatch.nki -out myWav.wav

Does Ardour allow this ? :slight_smile:

Well Ardour for Windows isn’t released yet to start with, though it is possible to run it, noone exists to support it at this time to my knowledge.

I don’t believe it is possible to create a session from scratch, add a plugin to a track, and render it in one step from the command line at this time. There was some work on doing things like this, but I don’t think it is quite that flexible yet is my understanding, but I haven’t looked into it myself much. It is more for rendering already existing session as an example is my understanding, again could very easily be mistaken just because I haven’t spent a lot of time with it.


Hello Seablade :slight_smile:
Thanks for your anwer. The best I found for now is that : (didn’t try it though) but its working with sfz files and not with Kontakt.
When I said command line, I was also thinking about some code in general, on any platform.
This function is integrated in all the commercial classical DAWs but native instruments support tole me that nothing like this exists … (its not possible that it doesn’t exist of course because its implemented) But there is no Kontakt SDK or API around from what I looked…
Does anyone have info on this?
Maybe there are big fees or even royalties for daws who would like to support this function?

Timidity does a good job fo rendering Midi files to audio

Given the instruments accessible via Timidity versus those accessible via Kontakt, it isn’t much of a comparison, unfortunately.

Hello guys,
I appreciate your help. The question is : is that possible de create such a tool without any SDK for Kontakt? Just by using the fact that Kontakt can run as a VST, can I code something by myself ? There are tools to transform a nki file to a sfz for example, how do they do that? How do they even have the binary structure of a nki file?

The issue is that most NKI files are encrypted, it isn’t just a matter of converting but also decrypting, is my understanding.

Sadly I don’t know of an easy way to do this at this time, sorry. If you want to code something yourself, you would need to code a VST host that can run Kontakt (So your best bet is on Windows, or an AU host on OS X) and save and load presets. The official VST SDK requires an agreement but is free to download. The AU SDK is built into OS X and I do not believe has such requirements, so for free/open source software I would probably look there. Not sure if Vestige will run VSTs on Windows and OS X natively, I suspect it will but haven’t looked into it, but that might be an alternative to the official VST SDK.

Ardour probably isn’t far off from this, and there are tools to create ardour sessions from scratch, so it may be that you might prefer to add this functionality to Ardour’s command line, but that is your call, and I have no idea how difficult that would be to accomplish right now, my guess is probably not easy.


Thanks Seablade what you said is relevant. Trying to load kontakt is probably the best way to go as you mentionned.
The only issue I have is “how to load for example a specific patch” with command line without SDK? It will was just plugin ON/OFF it would not be complicated I guess.
Loading Kontakt could be achievable but then I will face this issue won’t I?
Are you one of the Ardour developpers?

Edit : *If It was just plugin ON/OFF it would not be complicated I guess.

Ardour already has the capability of plugin state saving, so that is definitely possible within Ardour, or your own program. Wouldn’t be very helpful to many people if they couldn’t reload their session they spent hours working on and have it come right back to where they last saved it:) Does this answer your question or did I misunderstand it?


Yeah it does thanks ! So running Kontakt and loading a nki patch from code is not a problem right?
However, from a developper point of view, Kontakt is a VST instrument, so it extends the VST properties, but as it extends them, it can also have more properties which can’t be accessed from code without SDK. Loading a Kontakt patch can be done from code because its a basic VST property?
My apologies if my questions are stupid but I never had the opportunity to develop a VSt instrument.

BlackMamba: you’re not thinking about this in the right way. You’re a user of a VSTi, not a programmer. What you want to do is something at the user level, not “accessing from code” or “extending” VST properties.

You face several problems. (1) Ardour on Linux doesn’t run windows VST plugins normally (2) it can be built to do so, but that has its own problems (3) running Kontakt in particular may be a problem (though it was one of the first VSTi’s I tried when implementing windows VST support on Linux years ago, and appears to be cleanly implemented which makes this particular plugin less problematic than some) (4) running ardour from the command line to “play” a session into a file isn’t part of its designed-for use cases.

If Kontakt matters to you, I strongly recommend that you think about to do what you want on a Windows machine (or VM).

Hey Paul,
Thanks for your time and explanations. If I want to do it on a Windows machine, would you have some ideas to start with?
Maybe I will have a look at audacity but I don’t think it can run Kontakt normally, will have to check that again !

I don’t believe that ANY of the GUI-based DAWs or soundfile editors can be used to do what you want, in the sense of a command line tool.

Hey Paul,
If I have access to the code, what does it change that there is a GUI? In your opinion, there is no way to achieve what I want? :frowning:

BlackMamba: you're not thinking about this in the right way. You're a user of a VSTi, not a programmer. What you want to do is something at the user level, not "accessing from code" or "extending" VST properties.

My reading of the posts was that BlackMamba is a user that is willing to program, maybe I was wrong. Of course (No offense intended) that doesn’t answer the question of if BlackMamba is capable of programming this functionality into Ardour or his own host.


Seablade you are right. I am willing to program something for me (and share it with other people) such a tool.
By the way , could you please answer my post at Tue, 2014-10-28 08:55 that would help me a lot ? :wink:
Paul seems to think its not possible to do it with Ardour from what I understand of his post.
I found this : which looks very interesting, however, I don’t know how you can set the parameters for the plugins.


I don’t believe you will need anything beyond the VST properties, but I would have to look into it. Not something I know for certain off hand.