home *** CD-ROM | disk | FTP | other *** search
- ================================================
- = How to control the Coconizer Player Module =
- ================================================
-
- The chunk number of the player module lies in the user range, and is &C0640.
- All SWIs have prefixes of 'Coco', like Coco_ClaimRMA, etc. A star behind the
- name in the description means it's also available as command. In contrast to
- the usual OS commands they treat numeric parameters as decimal, except when
- an own base (&x or base_x) is given.
- When the Coco module is loaded it uses RISC OS' current volume as default
- setting. NB: Actually the player module "CocoPlayer" is stored as squeezed
- absolute file on disc, buit it unpacks itself as a real module when run.
-
-
- ClaimRMA (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = Amount of RMA Block to claim in Bytes,
- 0 to read current Pool.
- <= R0 = Current Block in Bytes (0 means none has been reserved yet).
- R1 = Address of Start of Block (for internal purposes only).
-
- This SWI is mainly useful when songs or tracks shall be played while working
- in the Desktop. It reserves a block of memory in RMA, so coming tracks can
- be loaded in this area without freeing and claiming new blocks every time.
- It's a good idea to do this once in order to avoid RMA holes, with the small
- risk to have reserved a bit too much memory.
-
-
- ReleaseRMA (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- Frees an earlier reserved block in the RMA. Does also stop any active music
- or sound laying in this area.
-
-
- LoadTrack (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = Pointer to Filename.
- R1 = Address (aligned) where to load Track to,
- 0 to load into existing RMA Block (or claiming a new one first).
- <= R0 = Number of the Voices of that Track.
- R1 preserved.
-
- Loads a trackfile, consisting of the song and the samples. Please ensure
- that the given address in R1 is word-aligned. If R1=0 then the trackfile is
- loaded into the previously claimed RMA block if it fits. In case no block
- does exist yet, a new one with the size of the given file is claimed first.
-
-
- SystemOn (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = Address (aligned) of Track to prepare,
- 0 if the Song resists in the RMA.
- <= R0 = Address of Interrupt Routine, which then can be called 50 times per
- second.
-
- Previously active music/sound is disabled, Coco's soundsystem is linked to
- the (new) track's samplepool (if it isn't yet), ie sound is enabled. The
- samplepool of the specified track will also be initialised if necessary. But
- the new song won't be played via interrupt. This SWI has been invented so
- that the user can either make effects without the need to play the song, or
- play the song by his/her own (with 50 Hz, Usr_mode and R13 must point to a
- valid stack).
- Making sound effects without the song being played restricts the available
- commands to 07,0C-0F, as the other effects 00-06 are performed in the
- interrupt routine of the player which isn't enabled at this point.
-
-
- SystemOff (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯
- Stops an active song, disables Coco's soundsystem, and releases an existing
- RMA block. On exit of this SWI, the OS is entirely clean from any sound
- stuff.
- You must always disable the soundsystem with this command before moving or
- changing the memory where a linked track is stored, because the enabled
- soundsystem does rely on informations stored in the track's samplepool.
-
-
- PlayStart (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = Address (aligned) of Track in Memory to play from,
- 0 if the Song resists in the RMA.
- <= R0 corrupted.
-
- Starts to play the specified song via interrupt. Does call SystemOn before,
- in order to enable the soundsystem correctly, so please read this info for
- further details.
-
-
- PlayStop (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯
- Just stops the current music, ie releases its interrupt. Does not disable
- the soundsystem, so further sound fx are perfectly possible. If you want to
- release Coco's entire soundsystem you should call SystemOff (when RMKilling
- the player module, this is done automatically).
-
-
- GetInfos
- ¯¯¯¯¯¯¯¯
- <= R0 = Address of the Start of the Header's Workspace.
- R1 = Current Position in Sequence (ie from 0-254).
- R2 = Current Address in the Patternrow (first Channel).
- R3 = Current Address in the Sequence.
- R4 = Address of Track.
- R5 = Current Speed of Playing (in 50Hz Counts)
- R6 = Number of Voices are in the lower Byte (ie R6 AND &FF).
-
- This call allows the programmer to get maximum control over a linked track.
- With the address of the track provided in R4 the user can read further
- informations directly. The internal volume is located at address (Head-4),
- so is accessed via !(R0-4) and does use the logarithm lower signed bit
- format (LSB) of the VIDC. This means you should only set even numbers
- (0-254, bit zero clear) in this location.
- Bits 8 to 31 of R6 are reserved, don't expect that they're zero in future
- releases. Voices=0 means no soundtrack is linked to the player.
-
-
- MakeEffect (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = Tone Information Word, ie &ppiieebb (Tone, Inst, Effect, Byte).
- R1 = Channel Number (1-8).
- <= R0,R1 preserved.
-
- This makes the effect in R0 on channel R1. It's exactly the tone information
- word that is used when editing or playing patterns. Will only work of course
- when the soundsystem is enabled (either via PlayStart or via SystemOn).
-
-
- AlterVoice (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = 0 to enable this Voice,
- 1 to disable it for the Duration of the current Tone (FX),
- 2 to disable it constantly.
- R1 = Channel Number (1-8).
- <= R0,R1 preserved.
-
- This SWI alters the status of a channel. Disabling means that the music on
- this channel is not played 1) as long as the current tone (or fx) is still
- active (repeated samples are always active!), or 2) until the channel is
- enabled again.
-
-
- PositionJump (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = Position in the Sequence where to jump to (0 to MaxSequenceNumber).
- R1 = Row in the Pattern where to start from (0 to 63).
- <= R0,R1 corrupted.
-
- Goes to a certain position in the song. In order to restart the song, enter
- this SWI with both parameters set to zero (or do *PlayStart [Adr]). Please
- note that this SWI doesn't alter the status bytes of the channels.
-
-
- SetVolume (*)
- ¯¯¯¯¯¯¯¯¯¯¯¯¯
- => R0 = New Volume (0-255, and 255=silent)
- <= R0 preserved.
-
- Sets the volume of the entire soundsystem. It accesses the internal volume
- loaction (Head-4) via a linear to logarithm table lockup. So, in contrast to
- the internal logarithm volume of Coco, this let you adjust a linear volume.
-
- Text edited by Epics.