0
0

Hey guys. I have done no sound/fmod programming before and I suspect my understanding of key concepts may not be great.

Basiclly what I want to do is apply effects to a midi file and then later on put this sound in a 3d environment. Its for a game. What I am having trouble understanding is how FMOD and MIDI work together.

Its my understanding that FMOD does not stream a midi signal however it will accept midi commands. Is this correct. I have found a few different midi library’s that read midi files but sending their data to FMOD for processing still remains a mystery to me. Can some one explain what i need to send FMOD so i can work with a MIDI file.

Thanks in advance.
-Stewart

  • You must to post comments
0
0

FMOD provides a software engine for rendering and playing MIDI files. You can load a MIDI file into FMOD the same you would load any WAV or MP3, simply do System::createSound, then play it. On Windows and Mac the DLS file (the MIDI instrument data bank) is loaded automatically.

FMOD does not accept arbitrary MIDI instrument streams (i.e. from devices) and does not provide any facility for reacting to specific MIDI messages.

I hope this clears things up for you, let me know if you have any further questions.

  • You must to post comments
0
0

[quote="mathew":1fvd9nsx]FMOD provides a software engine for rendering and playing MIDI files. You can load a MIDI file into FMOD the same you would load any WAV or MP3, simply do System::createSound, then play it. On Windows and Mac the DLS file (the MIDI instrument data bank) is loaded automatically.

FMOD does not accept arbitrary MIDI instrument streams (i.e. from devices) and does not provide any facility for reacting to specific MIDI messages.

I hope this clears things up for you, let me know if you have any further questions.[/quote:1fvd9nsx]

Hi Mathew,

Thanks for your reply. That does clear things up. I did a lot of reading up on exactly how MIDI works and found a library that is capable of sending Midi messages. What I would love is to be able to generate sounds based on the notes of these midi messages. I heard fmod has an oscillator that I can pass frequencies to to generate sound. After relentless googling and much searching the FMOD API I have been unable to find any specific example of what I am attempting to do.

So, my question. How do I generate sounds based on Midi events. Bear in mind that I am capturing the MIDI events fine the part of a program that does that is working. It’s doing something with these MIDI events in fmod that’s confusing me right now. Again thanks for your reply and I look forward to hearing your response.

  • You must to post comments
0
0

If it’s just help with the oscillator you need I will explain below, if there is anything else confusing you, let me know.

This should be enough to get you going with the oscillator, basically create a DSP object, set the tone generation type (i.e. sine, square, etc) set the oscillation rate, then play the DSP.

float type = 0; // 0 = sine, 1 = square, 2 = sawup, 3 = sawdown, 4 = triangle, 5 = noise
float rate = 440; // ‘A’ note

System::createDSPByType(FMOD_DSP_TYPE_OSCILLATOR, &dsp);
DSP::setParameter(FMOD_DSP_OSCILLATOR_TYPE, type);
DSP::setParameter(FMOD_DSP_OSCILLATOR_RATE, rate);
System::playDSP(FMOD_CHANNEL_FREE, dsp, false, &channel);

See the generate tone example for more information.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.