Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extended KotD #21: _MIDISOUNDBANK
#4
First of all, a great explanation, I like it.
And their example player (MIDIPlayer64) is simply brilliantly made.
I've been playing around with _MIDISOUNDBANK  and I noticed something that wasn't said here or in the WIKI.

Code: (Select All)

_MIDISOUNDBANK "4mgmgsmt.sf2"



handle = _SNDOPEN("onestop.mid")

_SNDPLAY handle
 


That works quite well.
But if you want to switch from one soundfont to another in your program, for whatever reason, you always have to first 
Load the sound font and then the sound. All previously loaded sounds will not be played with the new sound font. 
That wasn't explicitly stated here.
 
I also noticed that in such a case there is a pause of 1 second between load Soundfont and load Sound and Play
You have to insert it, otherwise it won't work either.
I made a little demo to quickly hear how different sound fonts sound with one sound.
I noticed this.
Take all _DELAY 1 out and it won't work anymore

Unfortunately I can't upload the sound font, despite 7z it's still 249 MB, which won't be accepted here.


Code: (Select All)
Screen _NewImage(600, 400, 32)
'_MIDISoundBank ".\Nice-Strings-PlusOrchestra-v1.6.sf2"
Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
_SndPlay Song&

Print " 1 Normal"
Print " 2 DooM"
Print " 3 Nokia"
Print " 4 Orchester"
Print " 5 Aspirin"
Print " 6 Airfont"
Print " 7 Mega Sound"
Print
Print " ESC EXIT"



Do
    k = _KeyHit

    Select Case k
        Case 27 ' esc
            Exit Do
        Case 50
            _SndStop Song&
            _SndClose Song&
            _MIDISoundBank ".\gzdoom.sf2"
            _Delay 1
            Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
            _SndPlay Song&
        Case 51
            _SndStop Song&
            _SndClose Song&
            _MIDISoundBank ".\Nokia_S30.sf2"
            _Delay 1
            Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
            _SndPlay Song&
        Case 52
            _SndStop Song&
            _SndClose Song&
            _MIDISoundBank ".\Nice-Strings-PlusOrchestra-v1.6.sf2"
            _Delay 1
            Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
            _SndPlay Song&
        Case 53
            _SndStop Song&
            _SndClose Song&
            _MIDISoundBank ".\Aspirin_160_GMGS_2015.sf2"
            _Delay 1
            Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
            _SndPlay Song&
        Case 54
            _SndStop Song&
            _SndClose Song&
            _MIDISoundBank ".\airfont_320_neo.sf2"
            _Delay 1
            Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
            _SndPlay Song&
        Case 55
            _SndStop Song&
            _SndClose Song&
            _MIDISoundBank ".\24.1mg_mega_sound_v2.0_bank.sf2"
            _Delay 1
            Song& = _SndOpen(".\Survivor - Rocky III - Eye of the Tiger.mid")
            _SndPlay Song&
    End Select
    _Limit 10
Loop
System
Reply


Messages In This Thread
Extended KotD #21: _MIDISOUNDBANK - by a740g - 08-25-2024, 04:07 PM
RE: Extended KotD #20: _MIDISOUNDBANK - by Dav - 08-25-2024, 04:22 PM
RE: Extended KotD #21: _MIDISOUNDBANK - by a740g - 08-25-2024, 08:40 PM
RE: Extended KotD #21: _MIDISOUNDBANK - by Steffan-68 - 08-28-2024, 06:34 PM
RE: Extended KotD #21: _MIDISOUNDBANK - by Pete - 08-28-2024, 08:09 PM
RE: Extended KotD #21: _MIDISOUNDBANK - by a740g - 08-29-2024, 03:30 AM
RE: Extended KotD #21: _MIDISOUNDBANK - by a740g - 08-30-2024, 03:31 PM



Users browsing this thread: 2 Guest(s)