AY MUSIC: New Tracker Format

Probably the most technical forum around. It does not have to be coding related, or assembly code only. Just talk about how you can use the AY chip to do cool sounding things :)
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

AY MUSIC: New Tracker Format

Post by Twilighte »

Nothing has been finalised yet, but their is a need for a decent tracker on the Oric. The following is a music format scheme.
Unlike previous editors, all song data is held in a single data list, where patterns, samples and effects are gradually built up (into an arsenal to be used at the musicians disposal)...

The following list is a summary of all the allocated commands that may be issued when the music is run. Except for GO!!, all other commands will not delay the music.
Further details of each command may be found below this summary.

*Value (*1,*2,*A) refer to further details that may be found towards the bottom of this page.

Code: Select all

Cm-Sz               Data 1    Data 2    Data 3    Data 4    Data 5
00-01 End of Music  Volume
01-01 Play Pattern  Pat ID    Len lo    Len hi    Pattern Data
02-01 Trigger In    Loc Lo    Loc hi    Value
03-01 Spare
04-108 Note
70-01 Spare
71-15 Volume
80-01 Note Period   Period
81-01 Trigger Out   Loc lo    Loc hi    Value
82-64 Play Effect   Length    Effect Data
C2-01 Spare
C3-01 Spare
C4-01 Spare
C5-01 Note Tempo    Tempo
C6-01 Efx Tempo     Tempo
C7-01 Play Sample   SMP ID    Len lo    Len hi    Sample Data
C8-01 Set Noise     NoisePW
C9-01 Set Filter    Filter
CA-01 AY Channel A
CB-01 AY Channel B
CC-01 AY Channel C
CD-01 Virtual D
CE-01 Virtual E
CF-01 SID Virtual F
D0-01 AY Change All
D1-01 Mask Register Register  Value     Mask
D2-01 Start SID     Register  Style     Sync
D3-01 Stop SID
D4-01 Set Note OFS  Offset
D5-01 Set Pitch OFS Offset
D6-01 Slide Up      Step      Period
D7-01 Slide Down    Step      Period
D8-01 Slide to Note
D9-01 Stop Slide
DA-01 Loop Position Pos lo    Pos hi
DB-01 Arpeggio      Steps
DC-01 Vibrato       Steps
DD-01 Tremelo       Steps
DE-01 Set Rules     Rule      Parameter
DF-01 Fine Tune     Base lo   Base hi
E0-01 Spare
E1-01 VSlide Up     Period    End Volume
E2-01 Vslide Down   Period    End Volume
E3-01 Exec Patch    Patch lo  Patch hi
E4-01 Set Register  Register  Value
E5-01 Set Reg Pair  Register  Value lo  Value hi
E6-01 Rest(Pattern)
E7-01 Interlace     Channel   Speed
E8-08 Track Start   Len Name  Track Name
F0-01 Hear Volume
F1-14 Spare
FF-01 Go!!
In the header of above, Cm is the Command.
The Command may be a Tempo change, Set Register, Define Pattern or use Note etc.
As with use Note and Effect, the command holds a range(or Size(Sz)) which directly relate to the number of available notes or effects.


And now the Commands in more detail

Code: Select all

00-01 End of Music  Volume
This marks the end of the music or current Track.
The data sets the final volume as the music ends.
The volume may be from 0 to 15.
This Command is only valid outside the Pattern and Effect data (it will be be ignored within)

Code: Select all

01-01 Play Pattern  Pat ID    Len lo    Len hi    Pattern Data
Defines a pattern and marks the current channel to play it at the next Go!! Command.
If the Pattern specified does not already exist, the data that follows will hold the Pattern/s and all parameters will be used.
If the Pattern specified does exist then only the Pat ID will be used.

Pat ID - Values 0 to 127 are valid (128 Patterns)
Len lo & Len Hi refer to the length of the pattern data only.
This Command is only valid outside the Pattern and Effect data (it will be be ignored within)

Note:-
Different Trackers have different ways of dealing with Patterns. Patterns in the 'New Tracker' share the same list (Like Maxymiser on Atari ST) across all channels, however the Editor will similulate multiple lists (like SSD on Atari ST).

Code: Select all

02-01 Trigger In    Loc Lo    Loc hi    Value
The Music may be triggered to start or unpause after the location (Loc lo and Loc hi) contains
a value(Value)
Whilst the Music is awaiting this trigger, it will be in the idle state, and will consume
very little CPU time.
Trigger In may be used inside or outside a Pattern but not inside an Effect (it will be be ignored within)

Code: Select all

04-108 Note
The Note is conventionally used inside a Pattern but may be used outside or inside an Effect.
If a note is used within the effect, it will overwrite the existing note and all subsequent
changes will be based on the new one.
If used in a Pattern the Note will be paired up with the Note Period, Effect Number and Note
Volume to form the next sound on the current channel.

Code: Select all

71-15 Volume
The volume Command may be used inside a Pattern To define the Note Volume.
If the volume is used within an Effect, then it will be relative to the Pattern volume.
If Volume is used outside both pattern and Effect areas it will define a master volume
for the current channel and will take immediate effect.
All volumes then used within patterns and effects will be based on this value.

If a volume change is required accross all channels, then command D0 should be issued
beforehand so that all volumes are written to.
If a volume change is required within a pattern but whilst a note is being played, then
either the effect should contain the volume change or command F0 should be used.

Code: Select all

80-01 Note Period   Period
Note Period defines the length (in Ticks) of the next Note in a pattern
Note Period may also be used in an effect to add a delay (in ticks) to the effect.
If Note Period is used outside both pattern and Effect areas it will delay the music.
The Period may be from 0 to 255.

Code: Select all

81-01 Trigger Out   Loc lo    Loc hi    Value
May be used to Trigger an external event by writing a value (Value) to a location
(Loc Lo, Loc Hi).
The music will continue as normal.
Care must be taken not to write values within the music player code or data, since no
protection is given,

Code: Select all

82-64 Play Effect   Length    Effect Data
This will assign an effect to a note if used inside a Pattern (the data bytes are not applicable) and is the final element of playing a note on the current channel.
This same code is used at the start of the music to define the Effect.
Subsequent Play Effects used outside the Pattern will play the effect based on the last note used.
If Play Effect is used inside another Effect, the command will be ignored.

Code: Select all

C5-01 Note Tempo    Tempo
Will change the Tempo of the music immediately after the command has been issued.
Tempos are measured in Ticks. Valid Tempos are from 1 to 255

Code: Select all

C6-01 Efx Tempo     Tempo
Will change the Tempo of all effects immediately after the command has been issued.
Tempos are measured in Ticks. Valid Tempos are from 1 to 255

Code: Select all

C7-01 Play Sample   SMP ID    Len lo    Len hi    Sample Data
Samples are 4 Bit Format3\ZERO (Refer to AY Crudentials: 4 Bit Samples).
The speed may be varied between 200hz and 5000hz in steps of 300Hz.
Volume and pitch of Samples is not changeable so Samples are intended as percussion (Digidrums) or special effects.
Up to 16 Samples may be defined but the total size of samples is limited to the available
memory.

Code: Select all

C8-01 Set Noise     NoisePW
At any point during the music, the Noise may be set. This will be over-ridden by any other noise used on any channel since Noise is a single sound source.

Code: Select all

C9-01 Set Filter    Filter
Future use

Code: Select all

CA-01 AY Channel A
This sets the Channel to AY channel A. All subsequent data will be assigned to this channel
unless a different channel command is issued.

Code: Select all

CB-01 AY Channel B
This sets the Channel to AY channel B. All subsequent data will be assigned to this channel
unless a different channel command is issued.

Code: Select all

CC-01 AY Channel C
This sets the Channel to AY channel C. All subsequent data will be assigned to this channel
unless a different channel command is issued.

Code: Select all

CD-01 Virtual D
This sets the Channel to Virtual channel D. All subsequent data will be assigned to this channel
unless a different channel command is issued.
Virtual Channel D may be used in conjuction with the interlace command to provide a further
Chip channel.
Virtual Channel D may also be used to control Envelope waveforms, control SID, play Noise Effects
or dynamically change the Tempo of the music.
Infact any command may be used in Virtual Channels, but if they address Pitch, Note or Volume
they will have no affect.

Code: Select all

CE-01 Virtual E
This sets the Channel to Virtual channel D. All subsequent data will be assigned to this channel
unless a different channel command is issued.
This channels behaves in just the same manner as Virtual Channel D.

Code: Select all

CF-01 SID Virtual F
This sets the Channel to Virtual channel F. All subsequent data will be assigned to this channel
unless a different channel command is issued.
Virtual Channel F may behave exactly like any other virtual channel except that if pitch is used
it will affect the SID pitch.

Code: Select all

D0-01 AY Change All
This command sets the current channel to all physical channels.
This command is usually issued whenever a global change to volume or pitch is required.

Code: Select all

D1-01 Mask Register Register  Value     Mask 
This is one of three commands (Set Register and Set Reg Pair) that directly access the AY Registers.
Mask Register allows a register to be written to but to exclude making changes to certain bits.
For example to disable Channel A Chip Oscillator from output (perhaps in order to play a sample), the Mask Register would be used to Set Bit 0 of the Status Register using Register $07, Value $01, Mask $FE.

Code: Select all

D2-01 Start SID     Register  Style     Sync 

Code: Select all

D3-01 Stop SID 

Code: Select all

D4-01 Set Note OFS  Offset 
This is intended for use before a pattern is played in order to increase or decrease (in semitones) the patterns base note.
It is also valid (Although ill advised) to use inside patterns and Effects.

Code: Select all

D5-01 Set Pitch OFS Offset 
Similar to Note Offset, but will change the subsequent pitch of the channel by the specified offset.

Code: Select all

D6-01 Slide Up      Step      Period 
This will perform a pitch slide from the current note/pitch with increasing frequency at a specified Step rate and at a Specified Speed(Period).

Code: Select all

D7-01 Slide Down    Step      Period 
This will perform a pitch slide from the current note/pitch with decreasing frequency at a specified Step rate and at a Specified Speed(Period).

Code: Select all

D8-01 Slide to Note 
This will perform a pitch slide from the current note/pitch to the next detected note in the pattern. Steps and Periods will be automatically calculated.
In addition, the step size will dynamically accomodate the range of pitches used so that the same range at lower frequencies will sound similar at higher frequencies.
If used outside the Pattern, the command will be ignored.
If no Note exists immediately before or after, then the command will be ignored.

Code: Select all

D9-01 Stop Slide 
This will stop Slide Up, Slide Down or Slide to Note. The current pitch will
remain active.

Code: Select all

DA-01 Loop Position Pos lo    Pos hi 
Within a Pattern, this will mark a Pattern Jump where the address must point to the same or another pattern. This is useful for optimising memory where the same pattern data exists towards the end of it.
Inside an Effect, it will mark the loop location for that effect.
In both instances the Loop command will not consume any events.

Code: Select all

DB-01 Arpeggio      Steps 
Arpeggio switches between three notes at the current effect rate, often used to create a crude Chord on a single channel.
The three notes are the current note, plus a second note up to 15 semitones from the first, and a third note again up to 15 semitones from the first.
If either second or third note offsets are zero, then the switching acts between two notes instead of three.

Code: Select all

DC-01 Vibrato       Steps 
Vibrato switches between three volumes at the current Effect rate.
The three volumes are the original volume, and two other relative volume jumps up 15 levels.
If either second or third volume offsets are zero, then the switching acts between two instead of three volumes

Code: Select all

DD-01 Tremelo       Steps 
Arpeggio switches between three pitches at the current effect rate.
The three pitches are the current pitch, plus a second pitch up to 15 pitches from the first, and a third again up to 15 pitches from the first.
If either second or third Pitch offsets are zero, then the switching acts between two instead of three.

Code: Select all

DE-01 Set Rules     Rule      Parameter 
Pending

Code: Select all

DF-01 Fine Tune     Base lo   Base hi 
Pending

Code: Select all

E1-01 VSlide Up     Period    End Volume
This will perform a Volume slide from the current volume with increasing Volume at a specified Step rate and at a Specified Speed(Period).
The slide will stop and remain if 15 is reached

Code: Select all

E2-01 Vslide Down   Period    End Volume
This will perform a Volume slide from the current volume with decreasing Volume at a specified Step rate and at a Specified Speed(Period).
The slide will stop and remain if zero is reached

Code: Select all

E3-01 Exec Patch    Patch lo  Patch hi
Exec Patch will execute an external Routine or Patch. This may be useful for executing events or to run a small app whilst playing processor intensive music.

Code: Select all

E4-01 Set Register  Register  Value
This is one of three commands (Mask Register and Set Reg Pair) that directly access the AY Registers.
Set Register allows a register to be written to directly.

For example to Set the Envelope Cycle to Triangle Waveform, the Set Register command would be used to write the value of 8 into register $D.
Therefore the code would be $E4,$0D,$08

Code: Select all

E5-01 Set Reg Pair  Register  Value lo  Value hi
This is one of three commands (Set Register and Mask Register) that directly access the AY Registers.
Set Reg Pair (Or Set Register Pair) allows a 16 bit register to be written to directly.

For example to Set the Envelope Period to $000A, the Set Register Pair command would be used to write the value of $0A into register $0B and the value of $00 into register $0C.
Therefore the code would be $E5,$0B,$00,$0A

Code: Select all

E6-01 Rest(Pattern)
Performs a pattern rest within the Pattern it is used in.
A Rest is useful at the start of a Pattern if no note should be played.
A rest may also be used in conjunction with a Volume change in order to change the volume during the pattern without modifying the note.

Code: Select all

E7-01 Interlace     Channel   Speed
Pending

Code: Select all

E8-08 Track Start   Len Name  Track Name
Track Start is a flag used to split a piece of music into sections or to have a single file with multiple music tracks.
Their is no Track End Command since a track End occurs at the next Track Start.
Each Track may have an associated name.

Code: Select all

F0-01 Hear Volume
Pending

Code: Select all

F1-01 Set Song info
Pending

Code: Select all

FF-01 Go!!
Go!! Triggers the playing of the previously set up patterns.
Last edited by Twilighte on Sun Feb 12, 2006 2:07 pm, edited 6 times in total.
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Dependencies

Post by Twilighte »

Dependencies
Effect Sequence volume is a fraction of the pattern Note volume.
The pattern note volume may be varied using the vibrato effect (Relative)
The Pattern note volume may also be set in the pattern.
The pattern Note volume is a fraction of the Song list volume which is a general maximum
volume for all channels.

This same volume dependency is used for pitch and note...
The relative change to pitch in an effect is based on the current Pattern note pitch
and any relative note change in the effect.
The pattern note pitch may be varied using Tremelo, Pitchbend or Glissando.
All pitch is based on the fine tuning setting which may exist in the song list.
Post Reply