SongInterface

Song interface

The infertace willingly reproduce the structure hierarchy of the song. For instance, we usually edit the rows of one phrase at a time, so client code don't have to restate the phrase each time, freeing registers for parameters.
The other benefit is that manipulations (insert/delete/update rows) are more generic.

That being said, we distinguish rows in phrase/table/instrument, ranged from 0 to 255, and 'ticks' in song map, ranging from 0 to 2^23-1 (8388607).
There is one 'tick' by player call, so at 300hz replay, 65536 correspond to 218.4533 seconds.

Select_Song_Map

There may have several ones: subtunes sharing instruments/tables.
By default first one (#0) is already selected.

In: A= song number.

Select_Phrase

In: A= phrase number.

Select_Instrument

In: A= instrument number, from 01 to FF.

Select_Table

Select a table in from each type possible.
NB: same index can/should be reused for different types. E.g. Volume 00 <> Period 00.

In: A= table number.
E= table type.

Actuel type numeration to be defined.

  • Volume
  • Period
  • Hard enveloppe
  • SID effect
  • Arpeggio
  • Noise

Set_Name

Give name to map/phrase/instrument/table.

In: HL= nt string.

Get_Name

Query name of map/phrase/instrument/table.

Out: HL= nt string.

Get_Description

Query description of selected map/phrase/instrument/table.
It allows to get constraints of parameters to be passed.

In/Out: to be defined.

Delete_Ticks

Delete entries in song_map.

In: ABC= index from 0 to 7FFFFF.
DE: length to be deleted.

Delete_Rows

Delete entries in phrase/instrument/table.

In: A: row number
E: nb of rows to delete.

Insert_Ticks

Insert rows at 'pos'. All rows from 'pos' are shifted down. New rows are blank.
Only valid in songmap.

In: ABC: index from 0 to 7FFFFF.
DE: length to be inserted.

Insert_Rows

Insert rows at 'pos'. All rows from 'pos' are shifted down. New rows are blank.
Only valid in phrase/instrument/table.

In: A= row number
Out: the inserted row is automatically selected.

Select_Tick

Select tick in a particular channel in the songmap. Automatically expand map length if needed.

In: ABC: index from 0 to 7FFFFF.
E: channel (0, 1, 2 for A, B, C).

Select_Row

Select Row 'pos'. Automatically expand phrase/instrument/table length if needed.
NB : for instrument, row 'n' actually points to 'nth' effect defining the instrument.

Set_Phrase

Set a phrase to be triggered on songmap. Only valid when tick selected.

In: A= phrase number. 00 means no phrase, FF means clear (or should be in effect column ?).

Get_Phrase

Get phrase to be triggered on songmap. Only valid when tick selected.

In: N/A
Out: A= phrase number. 00 means no phrase, FF means clear (or should be in effect column ?).

Set_Note

Set note at selected row/tick. Only valid in map/phrase.

In: A= note number. 00 means no note, FF means clear (or should be in effect column ?).
Out: Carry if ok.

Get_Note

Set note at selected row/tick. Only valid in map/phrase.

In: N/A
Out: A= note number. 00 means no note, FF means clear (or should be in effect column ?).

Set_Instrument

Set instrument at selected row/tick. Only valid when map/phrase selected.

In: A= instrument number. 00 means no instrument.

Get_Instrument

Get instrument at selected row/tick. Only valid when map/phrase selected.

In: N/A
Out: A= instrument number. 00 means no instrument.

Set_Volume

Set volume at selected row/tick. Only valid when map/phrase selected.
NB: setting of volume table is done via Set_Table_Value.

In: A= volume. FF means no volume.

Get_Volume

Get volume at selected row/tick. Only valid when map/phrase selected.

In: N/A
Out: A= volume. FF means no volume.

Set_FX

Set one of the four effects attached to a row/tick. Only valid when map/phrase selected.

In: E= effect slot (0 to 3)
A= effect number (see list below)
BC= effect parameters.

Get_FX

Get one of the four effects attached to a row/tick. Only valid when map/phrase selected.

In: E= effect slot (0 to 3)
Out A= effect number (see list below)
BC= effect parameters.

Set_Instrument_FX

Set effect attached to an instrument at selected row. Only valid when instrument selected.

In: A= effect number (see list below)
BC= effect parameters.

Get_Instrument_FX

Get effect attached to an instrument at selected row. Only valid when instrument selected.

In: N/A
Out: A= effect number (see list below)
BC= effect parameters.

Set_Table_Value

In: BC=value. Range defined by Get_Description.
Out: Carry if ok.

Get_Table_Value

In: N/A
Out: BC=value.

Effect list

Actual numeration to be defined. TODO: follow table types numeration, and use numbers from 128 for non-table effects.

Volume table

Hard Enveloppe table

Period table

Arpeggio

Vibrato

XXX: Gros bisous.

Sauf mention contraire, le contenu de cette page est protégé par la licence Creative Commons Attribution-ShareAlike 3.0 License