'Title = QBMUSIC 'Author = TheOuterLinux 'Purpose = To make it easier to create PC Speaker music from with ' QB45, QBX, or QB64. 'License = GPL v3 (https://www.gnu.org/licenses/gpl-3.0.html) TEMPO = 70 'Beats per minute 'Specifying a time signature such as 4/4 is not necessary unless you 'absolutely need to emphasize a note every so many beats. In those cases, 'when a score says to use "A4," at the beginning of a measure, for example, 'use either "A5" or "A3" instead. 'Getting the timing of the music notes right... TICKSPERSECOND = 18.2 'Adjust carefully; average is 18.2 ticks per second TICKCORRECTION = (TICKSPERSECOND * 60) / TEMPO 'Dont edit ThirtyTwo = TICKCORRECTION / 8 '32nd note dThirtyTwo = ThirtyTwo * 1.5 'Dotted 32nd note Sixteenth = ThirtyTwo * 2 '16th note dSixteenth = Sixteenth * 1.5 'Dotted 16th note Eighth = Sixteenth * 2 '8th note dEighth = Eighth * 1.5 'Dotted 8th note Quarter = Eight * 2 'Quater note dQuarter = Quarter * 1.5 'Dotted quarter note Half = Quarter * 2 'Half note dHalf = Half * 1.5 'Dotted half note Whole = Half * 2 'Whole note '108 Notes on a 108-key piano 'Based off of https://en.wikipedia.org/wiki/Piano_key_frequencies Silent = 0 TRANSPOSE = 1 'Use only numbers greater than 0 and less than 2.5. ' Numbers less than 1 decrease the pitch. ' Number greater than one increase the pitch. ' Example: A value of 1.083 should increase each note by ' a half-step because 1 + (1/12) = 1.08333. B8 = 7902 * TRANSPOSE 'B8 key As8 = 7459 * TRANSPOSE 'A8 sharp key Bb8 = As8 'B8 flat key A8 = 7040 * TRANSPOSE 'A8 key Gs8 = 6645 * TRANSPOSE 'G8 sharp key Ab8 = Gs8 'A8 flat key G8 = 6271 * TRANSPOSE 'G8 key Fs8 = 5920 * TRANSPOSE 'F8 flat key Gb8 = Fs8 'G8 flat key F8 = 5588 * TRANSPOSE 'F8 key E8 = 5274 * TRANSPOSE 'E8 key Ds8 = 4978 * TRANSPOSE 'D8 sharp key Eb8 = Ds8 'E8 flat key D8 = 4699 * TRANSPOSE 'D8 key Cs8 = 4435 * TRANSPOSE 'C8 sharp key Db8 = Cs8 'D8 flat key C8 = 4186 * TRANSPOSE 'C8 key B7 = 3951 * TRANSPOSE 'B7 key As7 = 3729 * TRANSPOSE 'A7 sharp key Bb7 = As7 'B7 flat key A7 = 3520 * TRANSPOSE 'A7 key Gs7 = 3322 * TRANSPOSE 'G7 sharp key Ab7 = Gs7 'A7 flat key G7 = 3136 * TRANSPOSE 'G7 key Fs7 = 2960 * TRANSPOSE 'F7 sharp key Gb7 = Fs7 'G7 flat key F7 = 2794 * TRANSPOSE 'F7 key E7 = 2637 * TRANSPOSE 'E7 key Ds7 = 2489 * TRANSPOSE 'D7 sharp key Eb7 = Ds7 'E7 flat key D7 = 2349 * TRANSPOSE 'D7 key Cs7 = 2217 * TRANSPOSE 'C7 sharp key Db7 = Ds7 'D7 flat key C7 = 2093 * TRANSPOSE 'C7 key B6 = 1976 * TRANSPOSE 'B6 key As6 = 1865 * TRANSPOSE 'A6 sharp key Bb6 = As6 'B6 flat key A6 = 1760 * TRANSPOSE 'A6 key Gs6 = 1661 * TRANSPOSE 'G6 sharp key Ab6 = Gs6 'A6 flat key G6 = 1568 * TRANSPOSE 'G6 key Fs6 = 1480 * TRANSPOSE 'F6 sharp key Gb6 = Fs6 'G6 flat key F6 = 1397 * TRANSPOSE 'F6 key E6 = 1318 * TRANSPOSE 'E6 key Ds6 = 1245 * TRANSPOSE 'D6 sharp key Eb6 = Ds6 'E6 flat key D6 = 1175 * TRANSPOSE 'D6 key Cs6 = 1109 * TRANSPOSE 'C6 sharp key Db6 = Cs6 'D6 flat key C6 = 1047 * TRANSPOSE 'C6 key B5 = 988 * TRANSPOSE 'B5 key As5 = 932 * TRANSPOSE 'A5 sharp key Bb5 = As5 'B5 flat key A5 = 880 * TRANSPOSE 'A5 key Gs5 = 830 * TRANSPOSE 'G5 sharp key Ab5 = Gs5 'A5 flat key G5 = 784 * TRANSPOSE 'G5 key Fs5 = 740 * TRANSPOSE 'F5 sharp key Gb5 = Fs5 'G5 flat key F5 = 698 * TRANSPOSE 'F5 key E5 = 659 * TRANSPOSE 'E5 key Ds5 = 622 * TRANSPOSE 'D5 sharp key Eb5 = Ds5 'E5 flat key D5 = 587 * TRANSPOSE 'D5 key Cs5 = 554 * TRANSPOSE 'C5 sharp key Db5 = Cs5 'D5 flat key C5 = 523 * TRANSPOSE 'C5 key B4 = 494 * TRANSPOSE 'B4 key As4 = 466 * TRANSPOSE 'A4 sharp key Bb4 = As4 'B4 flat key A4 = 440 * TRANSPOSE 'A4 key Gs4 = 415 * TRANSPOSE 'G4 sharp key Ab4 = Gs4 'A4 flat key G4 = 392 * TRANSPOSE 'G4 key Fs4 = 369 * TRANSPOSE 'F4 sharp key Gb4 = Fs4 'G4 flat key F4 = 349 * TRANSPOSE 'F4 key E4 = 330 * TRANSPOSE 'E4 key Ds4 = 311 * TRANSPOSE 'D4 sharp key Eb4 = Ds4 'E4 flat key D4 = 294 * TRANSPOSE 'D4 key Cs4 = 277 * TRANSPOSE 'C4 sharp key Db4 = Cs4 'D4 flat key C4 = 262 * TRANSPOSE 'C4 key B3 = 247 * TRANSPOSE 'B3 key As3 = 233 * TRANSPOSE 'A3 sharp key Bb3 = As3 'B3 flat key A3 = 220 * TRANSPOSE 'A3 key Gs3 = 208 * TRANSPOSE 'G3 sharp key Ab3 = Gs3 'A3 flat key G3 = 196 * TRANSPOSE 'G3 key Fs3 = 185 * TRANSPOSE 'F3 sharp key Gb3 = Fs3 'G3 flat key F3 = 175 * TRANSPOSE 'F3 key E3 = 165 * TRANSPOSE 'E3 key Ds3 = 156 * TRANSPOSE 'D3 sharp key Eb3 = Ds3 'E3 flat key D3 = 147 * TRANSPOSE 'D3 key Cs3 = 139 * TRANSPOSE 'C3 sharp key Db3 = Cs3 'D3 flat key C3 = 131 * TRANSPOSE 'C3 key B2 = 123 * TRANSPOSE 'B2 key As2 = 117 * TRANSPOSE 'A2 sharp key Bb2 = As2 'B2 flat key A2 = 110 * TRANSPOSE 'A2 key Gs2 = 104 * TRANSPOSE 'G2 sharp key Ab2 = As2 'A2 flat key G2 = 98 * TRANSPOSE 'G2 key Fs2 = 92 * TRANSPOSE 'F2 sharp key Gb2 = Fs2 'G2 flat key F2 = 87 * TRANSPOSE 'F2 key E2 = 82 * TRANSPOSE 'E2 key Ds2 = 78 * TRANSPOSE 'D2 sharp key Eb2 = Ds2 'E2 flat key D2 = 73 * TRANSPOSE 'D2 key Cs2 = 69 * TRANSPOSE 'C2 sharp key Db2 = Cs2 'D2 flat key C2 = 65 * TRANSPOSE 'C2 key B1 = 62 * TRANSPOSE 'B1 key As1 = 58 * TRANSPOSE 'A1 sharp key Bb1 = As1 'B1 flat key A1 = 55 * TRANSPOSE 'A1 key Gs1 = 52 * TRANSPOSE 'G1 sharp key Ab1 = Gs1 'A1 flat key G1 = 49 * TRANSPOSE 'G1 key Fs1 = 46 * TRANSPOSE 'F1 sharp key Gb1 = Fs1 'G1 flat key F1 = 44 * TRANSPOSE 'F1 key E1 = 41 * TRANSPOSE 'E1 key Ds1 = 39 * TRANSPOSE 'D1 sharp key Eb1 = Ds1 'E1 flat key D1 = 37 * TRANSPOSE 'D1 key Cs1 = 35 * TRANSPOSE 'C1 sharp key Db1 = Cs1 'D1 flat key C1 = 33 * TRANSPOSE 'C1 key B0 = 31 * TRANSPOSE 'B0 key As0 = 29 * TRANSPOSE 'A0 sharp key Bb0 = As0 'B0 flat key A0 = 28 * TRANSPOSE 'A0 key Gs0 = 26 * TRANSPOSE 'G0 sharp key Ab0 = Gs0 'A0 flat key G0 = 25 * TRANSPOSE 'G0 key Fs0 = 23 * TRANSPOSE 'F0 sharp key Gb0 = Fs0 'G0 flat key F0 = 22 * TRANSPOSE 'F0 key E0 = 21 * TRANSPOSE 'E0 key Ds0 = 19 * TRANSPOSE 'D0 sharp key Eb0 = Ds0 'E0 flat key D0 = 18 * TRANSPOSE 'D0 key Cs0 = 17 * TRANSPOSE 'C0 sharp key Db0 = Cs0 'D0 flat key C0 = 16 * TRANSPOSE 'C0 key '#####[ Example usage of variables above: ]##### 'A MIDI file was opened by MuseScore to view the score of Handel's "Menuet I." 'Then, the first note was selected with the mouse and pitch & duration are 'printed at the bottom. This information was then simply added one note at 'at time to this script, switching between notes in MuseScore using the left 'and right arrow keys.The window of QB64 on GNU/Linux was right-clicked and '"Always On Top" was selected to make things easier. If a rest note was on 'the treble clef but a note was being played on the bass clef, then the bass 'note was added in the rest note's place. 'TEMPO is 70 BPM; See first line of code to change. ' Measure # ---Time Signature; most common is 4/4, but this song uses 3/8. '1 ---3/8 SOUND C5, Eighth SOUND A4, dSixteenth SOUND Bb4, ThirtyTwo SOUND C5, Eighth '2 ---3/8 SOUND C5, Eighth SOUND A4, dSixtheenth SOUND Bb4, ThirtyTwo SOUND C5, Eighth '3 ---3/8 SOUND C5, Eighth SOUND D5, Eighth SOUND F5, Eighth '4 ---3/8 SOUND E5, Eighth SOUND F5, Eighth SOUND E5, Sixteenth SOUND D5, Sixteenth '5 ---3/8 SOUND C5, Eighth SOUND D5, Eighth SOUND C5, Sixteenth SOUND B4, Sixteenth '6 ---3/8 SOUND A4, Sixteenth SOUND G4, Sixteenth SOUND G5, Eighth SOUND F5, Sixteenth SOUND E5, Sixteenth '7 ---3/8 SOUND D5, Sixteenth SOUND C5, Sixteenth SOUND C5, Eighth SOUND E5, Sixteenth SOUND D5, Sixteenth '8 ---3/8 SOUND C5, Sixteenth SOUND D5, Sixteenth SOUND C5, Quarter SOUND C4, Eighth 'From bass clef section because of an 8th rest note in treble clef '9 ---3/8 SOUND C5, Eighth SOUND F5, Eighth SOUND F5, Sixteenth SOUND E5, Sixteenth '10 ---3/8 SOUND F5, Sixteenth SOUND D5, Sixteenth SOUND G5, Eighth SOUND C5, Eighth '11 ---3/8 SOUND Bb4, Eighth SOUND A4, Eighth SOUND Bb4, Sixteenth SOUND A4, Sixteenth '12 --3/8 SOUND G4, Sixteenth SOUND F4, Sixteenth SOUND C5, Eighth SOUND F5, Sixteenth SOUND E5, Sixteenth '13 --3/8 SOUND F5, Eighth SOUND D5, Eighth SOUND C5, Eighth SOUND Bb4, Sixteenth '14 --3/8 SOUND A4, Eighth SOUND F4, Eighth SOUND D4, Sixteenth SOUND E4, Sixteenth SOUND F4, Eighth '15 --3/8 SOUND Bb4, Eighth SOUND A4, Sixteenth SOUND G4, Sixteenth SOUND G4, Sixteenth '16 --3/8 SOUND G4, Sixteenth SOUND F4, Sixteenth SOUND F4, Quarter SOUND Silent, Eighth '17 --3/8 SOUND C5, Eighth SOUND F5, Eighth SOUND F5, Sixteenth SOUND E5, Sixteenth '18 ---3/8 SOUND F5, Sixteenth SOUND D5, Sixteenth SOUND G5, Eighth SOUND C5, Eighth '19 ---3/8 SOUND Bb4, Eighth SOUND A4, Eighth SOUND Bb4, Sixteenth SOUND A4, Sixteenth '20 ---3/8 SOUND G4, Sixteenth SOUND F4, Sixteenth SOUND C5, Eighth SOUND F5, Sixteenth SOUND E5, Sixteenth '21 ---3/8 SOUND F5, Eighth SOUND D5, Eighth SOUND C5, Eighth SOUND Bb4, Sixteenth '22 ---3/8 SOUND A4, Eighth SOUND G4, Sixteenth SOUND F4, Eighth SOUND D4, Sixteenth SOUND E4, Sixteenth SOUND F4, Eighth '23 ---3/8 SOUND Bb4, Eighth SOUND A4, Sixteenth SOUND G4, Sixteenth SOUND G4, Eighth SOUND F4, Eighth '24 ---3/8 SOUND G4, Sixteenth SOUND F4, Sixteenth SOUND F4, Quarter '25 ---3/8 SOUND F4, Eighth SOUND Silent, Eighth SOUND Silent, Eighth