MSX & midi files...

By PingPong

Prophet (3548)

PingPong's picture

16-06-2006, 19:57

Anyone know if exists a sw that can convert a\.midi file in a .ay or some other psg suitable file?

Login or register to post comments

By MTC

Rookie (26)

MTC's picture

16-06-2006, 21:11

Maybe this will help: http://www.freelists.org/archives/zxspectrum/12-2005/msg00145.html
(yes, I know it is for the ZX Spectrum and no, it does not generate YM/AY files directly)

By PingPong

Prophet (3548)

PingPong's picture

17-06-2006, 10:51

Umh, probably i think i must write a similar sw. The only problem is to convert time measurement unit in midi files in seconds or milliseconds. (I'm not a musician)

By MTC

Rookie (26)

MTC's picture

17-06-2006, 22:23

Timing shouldn't be a real problem. Search for BPM events in the file which look like this: 'FF 51 03 tt tt tt' (tt tt tt = tempo in µseconds per quarter note). The rest should be simple math.
Actually I think you will have more problems with the file structure of a standard MIDI file (chunks, meta events, delta times, etc...).
This link may be very useful: http://help-site.com/local/MIDI.TXT (and saves me a lot of typing ;) )

By shaiwa

Champion (384)

shaiwa's picture

17-06-2006, 23:06

PingPong, do have some thoughts about how to 'convert' the voices from midi to PSG ?
There are some midi2txt converters with source files, maybe it's easy to port it to PSG data instead of txt.

By DamageX

Master (217)

DamageX's picture

18-06-2006, 05:35

I tried to do something with midi files a while ago (wrote a QBASIC program to parse them). The biggest problem I had was that in a midi file a single voice/channel can have more than one note playing at once, like on a piano if you were to hit a key and then hit another one while the string of the first note is still vibrating and can still be heard. Of course you assign channels dynamically, but with PSG you run out of channels pretty quickly.

By PingPong

Prophet (3548)

PingPong's picture

18-06-2006, 11:53

PingPong, do have some thoughts about how to 'convert' the voices from midi to PSG ?
There are some midi2txt converters with source files, maybe it's easy to port it to PSG data instead of txt.

Thanks, just to save time can you tell me any useful link of this converters?

By PingPong

Prophet (3548)

PingPong's picture

18-06-2006, 11:58

I tried to do something with midi files a while ago (wrote a QBASIC program to parse them). The biggest problem I had was that in a midi file a single voice/channel can have more than one note playing at once, like on a piano if you were to hit a key and then hit another one while the string of the first note is still vibrating and can still be heard. Of course you assign channels dynamically, but with PSG you run out of channels pretty quickly.

This is of course a big problem, yes but only if you want a real player. Now i will explain the 'underground' reasons of my needings: i'm wrting a game, & searching for a good songs to use. So, my perfect tool is a somewhat a sw that can extract from a midi, the tones+durations of 1 or 2 tracks of a song (the main tracks)...

thx.

By legacy

Hero (570)

legacy's picture

18-06-2006, 13:48

Thanks, just to save time can you tell me any useful link of this converters?

Maybe www.gnmidi.com

By shaiwa

Champion (384)

shaiwa's picture

19-06-2006, 11:46

At the gnmidi.com site you can find midi2txt and txt2midi under the freeware section, source uses midiio libs. (thnx legacy)
At the midiox,com site you can find mf2t an t2mf.

By shaiwa

Champion (384)

shaiwa's picture

19-06-2006, 16:18

or maybe this toppic can be helpfull :
www.msx.org/forumtopic5245.html