Author Topic: Simple MIDI problem  (Read 1581 times)

zydu

  • Posts: 14
Simple MIDI problem
« on: 11 Apr '08 - 17:57 »
Hi

Should this code be enough to hear a MIDI file ?

int _urzadzenieMIDI = BassMidi.BASS_MIDI_StreamCreateFile("alwayson.mid", 0, 0, BASSStream.BASS_DEFAULT, 44100);
Bass.BASS_ChannelPlay(_urzadzenieMIDI, false);

Error code is 0 so everything seems to be fine but I can't hear anything. Same thing when I am trying to use BassMidi.BASS_MIDI_StreamCreate and sent a Stream Event.

Do I have to initialize MIDI device or set soundfonts properly before (and if yes then how set it to default)? What am I doing wrong?

Regards

Mike

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: Simple MIDI problem
« Reply #1 on: 14 Apr '08 - 15:14 »
Do I have to initialize MIDI device or set soundfonts properly before (and if yes then how set it to default)?

Yes, unless you have a Creative soundfont installed (which BASSMIDI will look for), you will have to explicitly tell BASSMIDI what soundfont(s) to use. That is done via BASS_MIDI_FontInit and BASS_MIDI_StreamSetFonts. To set the defaults, use handle=0 in the BASS_MIDI_StreamSetFonts call. Please see the docs for further details, and the MIDITEST example for a demonstration.