tags:

views:

305

answers:

5
+2  Q: 

Create midi file

I am trying to create midi file. I have Array of values note pitch, velocity, note length.

I need simple function somthing like this

    // Saves one track midi file
public void SaveAsMidi(string fileName, int[] notes, int[] length, int velocity)
{

}

Or maybe there is xml to midi or other api that I can use to save my data as midi as for c# miditoolkit it is good only for creating midi connection between devices. To save it you have to create some kind of midi sequencer and fill it with data and then you can save. I think it is a overkill but if there is no other solution then i have to use it.

+2  A: 

You need to output your data in the .mid file format. If you have any specific questions about using this file format, please ask.

Jon B
The link is really helpful anyway, just for those who try to play MIDI and getting to learn the basics.However, I don't see any examples on that page, and I would like to see how you wrap up your sequences or messages into one MIDI file of channels etc.Another question is how do I turn the file into binary, do I have to?Thank you Jon.
Shimmy
+3  A: 

Have a look at the C# MIDI Toolkit.

Skilldrick
I have use it already dint't like it
Son of anarchy
@Son: you should have documented that in your question. As long as you reject good answers, you'll have to specify your *exact* requirements for a library that you do like.
Hans Passant
+1  A: 

How to Create MIDI File - How To Articles

http://www.liutilities.com/how-to/create-midi-file/

How to Create a Midi File: 5 steps - wikiHow

http://www.wikihow.com/Create-a-Midi-File

read this

ratty
A: 

you are a facing a not trivial task ... here is some C++ code i wrote for S1100sampler (it was 10 years ago sampler software) , you can download here it if it helps ...

http://nokiaplay.nstreet.it/MidiFile.zip

luca
A: 

I don't how much it aims your particular question but surely is helpful, checkout VST.NET project.

Shimmy