Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on January 19, 2013, 04:50:44 am

Title: Music files in axe -Best way to implement it?
Post by: Keoni29 on January 19, 2013, 04:50:44 am
As you might know I am working on a project that might enhance the way music is implemented in calculator games. I'm talking about an external soundchip. I can write registers via the linkport at 420 Bytes per second. Now I want to make a general purpose interrupt driven music player which can be inserted in any AXE source code with ease. I also need to figure out what the best file format looks like. I came up with this concept:
00aaaaaa dd - Write dd to register aa

01tttttt -- - Wait tt before executing the next instruction

10xxxxxx xx - Not implemented yet. (set speed?)

11xxxxxx - End of song marker.


I get transfer rates of 420bytes per second and a register write takes two bytes, so that's 210 register writes per second. This is without additional code for fetching commands. I want to use interrupt speed 4 or 6 (preferably 6 since it's similar to the TI83+ interrupt frequency)

What do you think? Any suggestions?

Edit: Now here is a more complex format for comparisson:
Code: [Select]
[Header] Name, Size, speed, etc.
[Instrument dumps] Timed register writes for each instrument
[Sequence] Order of patterns in the song
[Patterns] Pattern of notes, register writes, delays etc.


Title: Re: Music files in axe -Best way to implement it?
Post by: Keoni29 on January 25, 2013, 02:38:41 am
Really? nobody? This is a solution I came up with: the most obvious tracker format saved as raw data. It's fast but not the most efficient. I might be able to compress the appvars though.

Note:
nn - ii - fx
nn = pitch
ii = instrument
fx = soundeffect
Example:
C-3 05 00
G-3 05 00
--- -- --
A-3 05 00
F-3 05 00

00 is no effect
--- means: no note data. (rest)
Effects can also be applied on rests. (pitch bends and playspeed changes for example)