I tried all: Movie, Sound and Music
I thought ModPlug can play MIDI.
Any hint how to play a midi file with native PB commands?
My MIDI file plays in windows without problems:
1. TotalCommander F3
2. VLC (you need a SF2 bank file)
3. OpenMPT
Just looked inside libmodplug.lib and there I can find the word MIDI several times.
https://github.com/Konstanty/libmodplug
- plays all types of MIDI files (*.mid)
Code: Select all
InitSound()
Filename$ = OpenFileRequester("Choose a MIDI file", "", "MIDI|*.mid", 0)
If Filename$
If LoadMusic(0, Filename$)
PlayMusic(0)
Delay(5000)
StopMusic(0)
FreeMusic(0)
Else
Debug "Failed to load MIDI"
EndIf
EndIf
If I use #PB_Any, the program does not terminate correct in the IDE with PB 6.21 b10 x86 on win10 x64 with asm backend.
Code: Select all
InitSound()
Filename$ = OpenFileRequester("Choose a MIDI file", "", "MIDI|*.mid", 0)
If Filename$
Music = LoadMusic(#PB_Any, Filename$)
If Music
PlayMusic(Music)
Delay(5000)
StopMusic(Music)
FreeMusic(Music)
Else
Debug "Failed to load MIDI"
EndIf
EndIf