Creating MIDI Files Using The Classic Basic PLAY Command and MML
Creating MIDI Files Using The Classic Basic PLAY Command and MML
net
Forums
Search…
Board index User Contributed Sources Sources, Examples, Tips and Tricks
Creating MIDI files using the classic basic PLAY command and MML
Post Reply Search this topic… 13 posts • Page 1 of 1
This program is a variant of the PLAY routine that, instead of playing the
angros47
notes, creates a MIDI file with the sequence. It works like the normal QBASIC
PLAY command, but it supports more than one track (using the same syntax
Posts: 2329 of GWBasic and MSX Basic, PLAY string1, string2, String3....). Notes can be
Joined: Jun 21, 2005
19:04
put between {} to play chords. The routine creates single or multitrack midi
files.
CODE: SELECT ALL
Track=_fbplay_internal (15,playstr15)
if len(Track)>0 then
Midi=Midi +"MTrk"+WriteFourBytes(len(Track)+4)+T
Tracks+=1
end if
https://www.freebasic.net/forum/viewtopic.php?t=26753 1/5
5/21/24, 10:33 PM Creating MIDI files using the classic basic PLAY command and MML - freebasic.net
Great.
Roland Chastain
Posts: 1008
Joined: Nov 24, 2011
19:49
Location: France
Contact:
in
nl
Posts: 274
Joined: Oct 11, 2005
10:46
Play("T48" & A & B & A & B & C & D & E & C & D & E & "P2 ")
https://www.freebasic.net/forum/viewtopic.php?t=26753 2/5
5/21/24, 10:33 PM Creating MIDI files using the classic basic PLAY command and MML - freebasic.net
angros47 wrote:
Roland Chastain
In case you are interested in a newer version, I included the code of this
Posts: 1008 program in SFX library:
Joined: Nov 24, 2011 https://sourceforge.net/projects/freebasic-sfx-library/
19:49
Location: France I already have the SFX library in my FB directory, but hadn't noticed until now
Contact: that it includes a new version of playtomidi. (When I downloaded it, I had
something else in mind.)
I will take a look to the new version.
By the way, what do you think about the abc format?
https://www.freebasic.net/forum/viewtopic.php?t=26753 3/5
5/21/24, 10:33 PM Creating MIDI files using the classic basic PLAY command and MML - freebasic.net
The SFX library (likely the one you have already downloaded) allows you to
angros47
use the PLAY command both to play midi notes directly (like in QBasic and
QB64), or to create a midi file.
Posts: 2329
Joined: Jun 21, 2005
19:04
To create a midi file, you should do something like:
CODE: SELECT ALL
https://www.freebasic.net/forum/viewtopic.php?t=26753 4/5
5/21/24, 10:33 PM Creating MIDI files using the classic basic PLAY command and MML - freebasic.net
Hello!
Roland Chastain
I created a git repository for my Pascal version, with a lot of music examples
Posts: 1008 that I found here and there.
Joined: Nov 24, 2011
19:49
Location: France
Regards.
Contact:
Roland
https://www.freebasic.net/forum/viewtopic.php?t=26753 5/5