digitalmars.D - Midi in D
- Adma (3/3) Jan 24 2006 Just wondering if D has Midi capabilities, Currently I work with C++ and...
- clayasaurus (13/17) Jan 24 2006 It looks like those are C functions, all of which can be accessed by D.
- James Dunne (6/31) Jan 24 2006 Don't forget about ALSA's sequencer API, or possibly OSS's sequencer
Just wondering if D has Midi capabilities, Currently I work with C++ and use MidiOutShortMsg... etc, functions like that, does D have any midi functions or another sound library that can output variable frequencies or notes?
Jan 24 2006
It looks like those are C functions, all of which can be accessed by D. My suggestion is to load winmm.dll functions at runtime and then use them in D like you would in C++. This takes a little bit of work as you have to declare the functions and then load them through winmm.dll in your code. The Derelict project is a good example of how to do this ( http://svn.dsource.org/projects/derelict/trunk/DerelictSDLMixer/ erelict/sdl/mixer.d for how you can declare C functions that you can load and use) and ( http://svn.dsource.org/projects/derelict/trunk/DerelictUtil/derelict/util/ for how you can load these functions). Or you could find a Midi library in C or C++ and create D headers and wrappers for them. Adma wrote:Just wondering if D has Midi capabilities, Currently I work with C++ and use MidiOutShortMsg... etc, functions like that, does D have any midi functions or another sound library that can output variable frequencies or notes?
Jan 24 2006
clayasaurus wrote:It looks like those are C functions, all of which can be accessed by D. My suggestion is to load winmm.dll functions at runtime and then use them in D like you would in C++. This takes a little bit of work as you have to declare the functions and then load them through winmm.dll in your code. The Derelict project is a good example of how to do this ( http://svn.dsource.org/projects/derelict/trunk/DerelictSDLMixer/ erelict/sdl/mixer.d for how you can declare C functions that you can load and use) and ( http://svn.dsource.org/projects/derelict/trunk/DerelictUtil/derelict/util/ for how you can load these functions). Or you could find a Midi library in C or C++ and create D headers and wrappers for them. Adma wrote:Don't forget about ALSA's sequencer API, or possibly OSS's sequencer support. Now, if you're wondering about loading Standard MIDI File formats, I think I can help you there. Or, gut some code out from the free timidity++ project (straight C code - easy to extract), which is what I did.Just wondering if D has Midi capabilities, Currently I work with C++ and use MidiOutShortMsg... etc, functions like that, does D have any midi functions or another sound library that can output variable frequencies or notes?
Jan 24 2006