Author Topic: MIDI playing silent  (Read 254 times)

Hanuman

  • Posts: 114
MIDI playing silent
« on: 26 May '24 - 21:24 »
With my 432Hz Player, if I add the MIDI BASS plugin, it loads, MIDI file is recognized, it "plays" in the player with the right audio length, but the output is completely silent.

Any particular restrictions with MIDI plugin specifically? What's needed to make it work?

Someone was asking whether the player could support MIDI.

Falcosoft

  • Posts: 185
Re: MIDI playing silent
« Reply #1 on: 27 May '24 - 12:36 »
First of all you will also need a soundfont (in SF2 or SFZ format) that you have to assign to your Midi stream. It's because BassMidi is a soundfont software synthesizer so it cannot use standard Midi Out ports (although it can use standard Midi In ports to receive Midi messages from Midi keyboards etc.).
So you will have to:
1. Use BASS_MIDI_FontInit() then
2. BASS_MIDI_StreamCreate() or BASS_MIDI_StreamCreateFile() to create the Midi stream.
3. Use BASS_MIDI_StreamSetFonts() with the Midi stream handle returned by BASS_MIDI_StreamCreate()/BASS_MIDI_StreamCreateFile() and the font handle in a BASS_MIDI_FONT struct that is returned by BASS_MIDI_FontInit().
4.a If you used BASS_MIDI_StreamCreateFile() then you can finally start playing by calling BASS_ChannelPlay() with the Midi stream handle as parameter.
4.b If you used BASS_MIDI_StreamCreate() to create a real-time Midi stream then you will have to send Midi messages to the stream by BASS_MIDI_StreamEvent();

https://www.un4seen.com/doc/#bassmidi/bassmidi.html

Ian @ un4seen

  • Administrator
  • Posts: 25884
Re: MIDI playing silent
« Reply #2 on: 27 May '24 - 15:12 »
Besides BASS_MIDI_FontInit and BASS_MIDI_StreamSetFonts, if you just want to use a single soundfont for everything then another (and simpler) way to do that is via the BASS_CONFIG_MIDI_DEFFONT option.