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
#52
Thanks for the reply, Stefan-68.   I’m still getting crackling, like bad speakers.  I think it may be my laptop speakers that’s the problem.   They are really started to sound bad when playing YouTube vids.  Maybe they’re going out or something….

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#53
@Dav, I tried it, and it worked just fine for me.
Reply
#54
(11-06-2024, 12:31 AM)a740g Wrote: @Dav, I tried it, and it worked just fine for me.

Thanks for testing.  I just tested it on my Windows laptop and it sounds fine, but not on my Linux laptops.  They all crackle.  I'm leaning towards audio driver Linux uses for thinkpads - it's known to have issues.  I'll see what I can do here, looks like it's not a QB64pe problem.

- Dav

Find my programs here in Dav's QB64 Corner
Reply




Users browsing this thread: 2 Guest(s)