Thread overview | |||||
---|---|---|---|---|---|
|
January 24, 2006 Midi in D | ||||
---|---|---|---|---|
| ||||
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? |
January 24, 2006 Re: Midi in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adma | 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/derelict/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? > |
January 24, 2006 Re: Midi in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | 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/derelict/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?
>>
>
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.
|
Copyright © 1999-2021 by the D Language Foundation