Author Topic: Music files in axe -Best way to implement it?  (Read 2524 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Music files in axe -Best way to implement it?
« 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.


« Last Edit: June 24, 2013, 03:58:05 am by Keoni29 »
If you like my work: why not give me an internet?








Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Music files in axe -Best way to implement it?
« Reply #1 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)
« Last Edit: January 25, 2013, 02:38:50 am by Keoni29 »
If you like my work: why not give me an internet?