Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exploring QB64-PE default soundfont patches
#10
Yeah, the sounds are a good resource that should be tapped.  The resulting midi data is small and can be added to code fairly easy.  I wanted to do this mainly to get some better sound effects that can be used in code.  

Here's a laser or siren sound.  Just an example of how it can be put/used in code..

- Dav

Code: (Select All)
$Unstable:Midi
$MidiSoundFont: Default

'make laser& sound
a$ = "4D546864000000060001000100604D54726B0000001600FF51030F424000C07B00903C7F60803C4000FF2F00"
laser$ = ""
For i = 1 To Len(a$) Step 2
    laser$ = laser$ + Chr$(Val("&H" + Mid$(a$, i, 2)))
Next

laser& = _SndOpen(laser$, "memory")

_SndPlay laser&: _Delay 1: _SndStop laser&


Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
RE: Exploring QB64-PE default soundfont patches - by Dav - 09-11-2024, 02:22 PM



Users browsing this thread: 1 Guest(s)