Sheet Music Player in C++, using graphics.h BGI library

Allows you to read a score from a txt file with the format of the QBASIC play function, and then allows you to play the melody on the computer speaker using the beep function, or also allows you to export the melody to WAV using the play2wav library by Alexey Frunze.
The recognized sheet music format corresponds to the old format of the QBASIC PLAY function. Since it is an easy format for the user to learn.
SHEET MUSIC FORMAT
https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm
SoundPlayDataString: A string expression that contains one or more of the following PLAY commands :
Octave and tone commands :
Octave Sets the current octave(0 – 6).
< or > Moves up or down one octave.
A – G Plays the specified note in the current octave.
Nnote Plays a specified note(0 – 84) in the seven – octave range (0 is a rest).
Duration and tempo commands :
Llength Sets the length of each note(1 – 64).L1 is whole note, L2 is a half note, etc.
ML Sets music legato.
MN Sets music normal.
MS Sets music staccato.
Ppause Specifies a pause(1 – 64).P1 is a whole – note pause, P2 is a half – note pause, etc.
Ttempo Sets the tempo in quarter notes per minute(32 – 255).
Mode commands :
MF Plays music in foreground.
MB Plays music in background.
Suffix commands :
#or + Turns preceding note into a sharp.
– Turns preceding note into a flat.
. Plays the preceding note 3 / 2 as long as specified.
EXAMPLE (Creep Radiohead – sheet music encoded by Yacsha)
“O4 AGF+G. F+F+ L5AGG L4 F+. AAGF+GEDC P10”
“AAGF+G.. DCAGF+F+.. P10 L5GAGL4A+.F.. GAGGA+.G.. P10”
“GBB.. GBB.F+.ED+.. P10 B>C<BAB.. GAGA+.G.. P10”
“EG… AGF+.ED+.F+B.AGF+.. P15”
“L2G. L4 AGF+..E.D+… L2F L2G L2A L1A L4 G.. F+.. G L1F+ P5”
“L2A L3G.. L4F+.. G L2G
Developed by:
YACSHA – Software & Desing, since 1999, Lima – Perú
The World of Chaos – EL MUNDO DEL CAOS – Unlimited Programming
You can DOWNLOAD the SOURCE CODE and executable software for FREE from here:
Join The World of Chaos Developer Community😃
Contribute to the project on Github!HISTORY
- Version 2 – 06-IV-2024
- Allows you to read a score from a txt file with the format of the QBASIC play function, and then allows you to play the melody on the computer speaker using the beep function, or also allows you to export the melody to WAV using the play2wav library by Alexey Frunze
- Version 1 – 17-VII-2000
- Based in graphics\tecladmu (Musical KEYBOARD). This remained an unfinished project.






