Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exploring QB64-PE default soundfont patches
#51
(11-05-2024, 02:43 PM)Dav Wrote: I was planning to make a new instrument program, using midi notes instead of separate .ogg files for all the individual notes to play, but it looks like multiple MIDI files can't be playing at the same time cleanly like .ogg files can.  I'm getting distortion pretty bad when multiple MIDI files are being sounded.  Is there a way to prevent this?
Here's a small example just playing 8 separate notes (8 different MIDI files).  You need latest QB64PE.
- Dav
Code: (Select All)

'make all notes
Dim notes&(8)
notes&(1) = _SndOpen(MidiNotes$(100, 10, "c4rn", 1), "memory")
notes&(2) = _SndOpen(MidiNotes$(100, 10, "d4rn", 1), "memory")
notes&(3) = _SndOpen(MidiNotes$(100, 10, "e4rn", 1), "memory")
notes&(4) = _SndOpen(MidiNotes$(100, 10, "f4rn", 1), "memory")
notes&(5) = _SndOpen(MidiNotes$(100, 10, "g4rn", 1), "memory")
notes&(6) = _SndOpen(MidiNotes$(100, 10, "a4rn", 1), "memory")
notes&(7) = _SndOpen(MidiNotes$(100, 10, "b4rn", 1), "memory")
notes&(8) = _SndOpen(MidiNotes$(100, 10, "c5rn", 1), "memory")
'play notes
For t = 1 To 8
    _SndPlayCopy notes&(t)
    _Delay .2
Next
Things are going quite normally for me. With a note length and DELAY of .2, a reverb eleven corner occurs.
You can increase the delay but it doesn't sound as good.
Or
Code: (Select All)
notes&(1) = _SndOpen(MidiNotes$(100, 20, "tsc4rn", 1), "memory,NOASYNC") 

Shorten the note length.
Reply


Messages In This Thread
RE: Exploring QB64-PE default soundfont patches - by Steffan-68 - 11-05-2024, 04:21 PM



Users browsing this thread: 4 Guest(s)