Hello Guys,
I'm a beginner musician and do a little of programming in my free time.
I would love to play around with at67's gtmidi format. Sadly I don't have any knowledge about memory addresses and stuff.
Could anyone tell me what to do to convert simple midis into gtmidi and play them back on my Gigatron. I just want a simple gtbasic programm. It would be great if someone could write that.
Thanks in advance
DarNiem
P.S.:I have 32k of RAM and ROMv5
Playing gtmidi Files
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: Playing gtmidi Files
It's pretty simple to convert .midi files to .gtmidi and even easier to play them back in gtBASIC.
1) Make sure you have gtMIDI and miditones built and available at a command line/terminal.
2) Type gitmidi at the command line and it will tell you exactly what to do.
3) For the Gigatron the maximum channels converted is 4, no percussion available yet, but velocity is available.
4) For playback under ROMv5a, using the vertical blank handler is recommended and it's as easy as the following:
There's lots of audio/music examples in the gbas/audio folder.
1) Make sure you have gtMIDI and miditones built and available at a command line/terminal.
2) Type gitmidi at the command line and it will tell you exactly what to do.
3) For the Gigatron the maximum channels converted is 4, no percussion available yet, but velocity is available.
4) For playback under ROMv5a, using the vertical blank handler is recommended and it's as easy as the following:
Code: Select all
_runtimePath_ "../runtime"
_runtimeStart_ &h7FFF
_codeRomType_ ROMv5a
' this MIDI was created with the -v option, so contains velocity information
load midi, ../../res/audio/midi/agony.gtmid, 0
' set up the VBlank and audio system to playback MIDI's with velocity
init MIDIV
play MIDIV, 0
Re: Playing gtmidi Files
Thanks a lot!
I will try that out.
Edit:Maybe I am a little dumb. The program you sent compiles without any errors, loads flawlessly but doesn't do anything. My sound is working (I can hear the gigatron start sound) but nothing happens with the compiled program. Do I have to implement a loop or something?
Thank you in advance
DarNiem
I will try that out.
Edit:Maybe I am a little dumb. The program you sent compiles without any errors, loads flawlessly but doesn't do anything. My sound is working (I can hear the gigatron start sound) but nothing happens with the compiled program. Do I have to implement a loop or something?
Thank you in advance
DarNiem
Re: Playing gtmidi Files
Because the sound is playing in the background, yeah you need to do something else, i.e. loop and draw some graphics, get some input, or just a busy loop, etc.
Re: Playing gtmidi Files
I'm sorry to bother you again, but I still don't get it.
I get the part about the music playing in the background, so I wrote a program which just loops a print command that says gtmidi. It does print gtmidi endlessly, but still no music. Here's my code:
Could you please tell me what I'm doing wrong?
Thank you in advance
DarNiem
I get the part about the music playing in the background, so I wrote a program which just loops a print command that says gtmidi. It does print gtmidi endlessly, but still no music. Here's my code:
Code: Select all
_runtimePath_ "../runtime"
_runtimeStart_ &h7FFF
_codeRomType_ ROMv5a
load midi, ../../res/audio/midi/agony.gtmid, 0
init MIDIV
play MIDIV, 0
repeat
print "gtmidi"
forever
Thank you in advance
DarNiem
Last edited by DarNiem on 11 Mar 2023, 06:22, edited 1 time in total.
Re: Playing gtmidi Files
Sorry typo, there's different ways of referencing MIDI files, one is through MIDI ID's, (the one we are using in this example), so the play command should look like this:
P.S. I'll add better error output for this in the next release.
Code: Select all
play MIDIDV, 0
Re: Playing gtmidi Files
Thank you!
It works great now!
It works great now!