You can make Midi files with 4tH

11 views
Skip to first unread message

The Beez

unread,
Dec 28, 2025, 3:27:07 PM (2 days ago) Dec 28
to 4tH-compiler
Hi 4tH-ers!

Now - don't get overexcited. If you expect to make polyphone tracks with this thing - not quite. But you can enter notes and duration - and even select your instrument.

So the sample files give you an impression of what it can do. For the ZX Spectrum fans - it you still got ZX BASIC programs lying around with lots of BEEPs, you can easily convert those to Midi:

ZX Spectum:
BEEP 0.75, 7
BEEP 0.25, 8
BEEP 0.5, 7
BEEP 0.5, 5
BEEP 0.5, 3
BEEP 0.5, 2
BEEP 1, 0

4tH:
 75 7 m.beep
 25 8 m.beep
 50 7 m.beep
 50 5 m.beep
 50 3 m.beep
 50 2 m.beep
100 0 m.beep

Yeah, no floating point but 1/100s. That's it. You can also select an octave or the attack by changing the mOctave and mAttack values.

A full list of instruments is also available (see source code) and you select them with the m.use command. Just open a file using MIDopen and beep away!

Have phun! Code in SVN.

Hans Bezemer

The Beez

unread,
Dec 28, 2025, 3:47:47 PM (2 days ago) Dec 28
to 4tH-compiler
Darn! Forgot the Midi files!

Hans
bornwood.mid
frere.mid

The Beez

unread,
Dec 29, 2025, 12:52:27 PM (12 hours ago) Dec 29
to 4tH-compiler
Well, I've made numerous small improvements, added a few more examples - and I've written the manual for this one. I guess we're done! Although there's plenty of room for expansion: http://somascape.org/midi/tech/mfile.html

Hans Bezemer
worlduni.mid
ode2joy.mid
jinglebl.mid
Reply all
Reply to author
Forward
0 new messages