I've recently got back into coding after a long time off and have found a .dll by Slippy for the Oldskool Music Engine. OSME.
See below for his vc and Freebasic source and examples.
http://www.vectronixhq.de/?page_id=27
http://www.vectronixhq.de/?page_id=29
It replays many oldskool tunes, sndh, fc, ym etc. all of which I have many of and would like to play them.
I've tried it in Freebasic with his libraries but when calling the .dll in PB it plays but instantly crashes. If you debug it you can hear the tune playing though until you quit the debugger.
I've unpacked the original .dll (UPX3 packed) just to make sure the functions were actually correct, and they are.
Download it from above links.
Well I believe I have the syntax correct (new to this) when calling the functions in the .dll but I was hoping someone would tell me what i'm doing wrong.
Here's what i've got so far.
Code: Select all
;save as osmreplayer.pbi
#OSM=0
Declare INIT_OSMEngine()
Declare playOSMEMusicFile(filename.s, length.l, trackId.l)
Declare playOSMEMusicMem(pMusic.l,trackId.l)
Declare stopOSMEMusic()
Declare pauseOSMEMusic()
Declare resumeOSMEMusic()
Declare getOSMEChannelVU(i.l)
Declare setOSMEVolume(vol.l)
Procedure INIT_OSMEngine()
Protected *DLL.l
*DLL = OpenLibrary(#OSM,"osmengine.dll")
If *DLL=0
MessageRequester("Error", "Can't load OsmEngine", 0)
End
Else
ProcedureReturn *DLL
EndIf
EndProcedure
Procedure playOSMEMusicFile(filename.s,length.l,trackId.l)
ProcedureReturn CallFunction(#OSM,"playOSMEMusicFile", filename, length, trackId)
EndProcedure
Procedure playOSMEMusicMem(pMusic.l,trackId.l)
ProcedureReturn CallFunction(#OSM,"playOSMEMusicMem", pMusic, trackId)
EndProcedure
Procedure stopOSMEMusic()
ProcedureReturn CallFunction(#OSM,"stopOSMEMusic")
EndProcedure
Procedure pauseOSMEMusic()
ProcedureReturn CallFunction(#OSM,"pauseOSMEMusic")
EndProcedure
Procedure resumeOSMEMusic()
ProcedureReturn CallFunction(#OSM,"resumeOSMEMusic")
EndProcedure
Procedure getOSMEChannelVU(i.l)
ProcedureReturn CallFunction(#OSM,"getOSMEChannelVU",i)
EndProcedure
Procedure setOSMEVolume(vol.l)
ProcedureReturn CallFunction(#OSM,"setOSMEVolume",vol)
EndProcedure
Code: Select all
IncludeFile "osmereplayer.pbi"
INIT_OSMEngine()
;playOSMEMusicMem(?music,?musend-?music,1)
*Buffer=AllocateMemory(7000)
playOSMEMusicFile("farewell_lil_ssd.sndh", *Buffer,1) ;change tune for your fave .fc, sndh, or .ym tune
MessageRequester("O.S.M.E Rulez", "Press Ok")
stopOSMEMusic()
End
I've tried this with PB 4.10 to 4.31 with the same results so any ideas, suggestions, corrections would be great.
I'm sure someone here could port it to PB.

