Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exploring QB64-PE default soundfont patches
#49
(09-15-2024, 07:20 PM)Steffan-68 Wrote: I really think it's great what they've created.
I just have one more question.
Where the hell do they get the notes from?   Big Grin
Without notes, I don't even know how to put together a sensible melody.

Sorry for this late reply, @Steffan-68 - I didn't notice it.  I will write a tutorial of using this function one day.  Here's a little info for now.  You will have to know music probably to make any good song with this function.  it's not easy really to make music  this way for anyone honestly.  I would like to make a graphical way.

Every note is a two bytes long, the first byte is the name of the note to play, and the 2nd byte is the octave of the note.  Like to do a simple 8 notes C scale, you can go from bottom C to the top C like this (starting on middle C so it's the 4th octave).

"c4 d4 e4 f4 g4 a4 b4 c5"  

That first 7 notes are in the 4th octave so a 4 is after each note.  The C5 would start the next octave up, so that;s why a 5 is there.

Now for the length for the notes, you have to declare that in front of the notes, so if you want that scale to be played in eight notes, do a EN in front of the scale.  "en c4 d4 e4 f4 g4 a4 b4 c5"

You can put a melody together like this using notes and durations in the string.  Here's the beginning of "Somewhere over the Rainbow" melody:

"hn c4 c5"  'some-where (those notes both use half notes)
"qn b4   en g4 a4" 'ov-er the (one quater note, two eight notes)
"qn b4 c5" 'rain-bow.  (quarter notes)

Hope that may help a little bit.

- Dav

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
RE: Exploring QB64-PE default soundfont patches - by Dav - 10-01-2024, 05:07 PM



Users browsing this thread: 5 Guest(s)