Class weasel.UltimateSoundTracker121
Defined in: UltimateSoundTracker121.js.
Constructor Attributes | Constructor Name and Description |
---|---|
weasel.UltimateSoundTracker121(aModuleData, iPlaybackFrequency, iSampleScannerMode)
Create a Ultimate Soundtracker 1.21 module out of the provided data (which has already passed the module sniffer test).
|
Field Attributes | Field Name and Description |
---|---|
NTSC vertical refresh rate in Hertz.
|
|
PAL vertical refresh rate in Hertz.
|
|
Override the default song speed and use the VBL timer instead.
|
Method Attributes | Method Name and Description |
---|---|
changePlaybackFrequency(iPlaybackFrequency)
Set new output play back frequency, which requires the resizing of various buffers etc.
|
|
Extract all patterns within module data into Pattern objects.
|
|
fetchRow()
Fetch the next pattern row into the channels for processing.
|
|
Get the maximum pattern number in Ultimate Soundtracker 1.21 module (this includes patterns not played).
|
|
Get the number of instruments supported by the module format.
|
|
Get the Module Header Size used by the module format, it is also the starting offset for the pattern data.
|
|
getChannel(iChannelNumber)
Get the requested audio channel object.
|
|
Get the CIA Timer Clock Constant, which will be either PAL or NTSC CPU frequency divided by 10.
|
|
getCurrentPatternCell(iChannelNumber)
Get the current pattern cell object from the selected channel.
|
|
Get the Current Pattern Row Position in the song.
|
|
Get the current sequence position in the song.
|
|
Get the current row tick.
|
|
Get the Fasttracker/Taketracker 7 Bit Panning Mode.
|
|
getInstrument(iInstrumentNumber)
Get the instrument object.
|
|
Get length of song in milliseconds.
|
|
Get the current master volume of the module.
|
|
Get the Module Data.
|
|
Get the type of Soundtracker Module.
|
|
Noisetracker/Protracker loop quirks mode active (Taketracker/Fasttracker does not implement them).
|
|
getNoteFromPeriod(iAmigaPeriod)
Get the note and octave from the period value (which is stored in the pattern).
|
|
Get the number of channels in this module.
|
|
getPattern(iPatternNumber)
Get Pattern object from the pattern number.
|
|
getPatternNumber(iSequenceNumber)
Get the pattern number from the sequence table at the given offset.
|
|
Get the pattern size in bytes of this module.
|
|
Get the current moduel playback frequency.
|
|
Get the mode of the Protracker 3 mode, Set Sample Offset behaves differently from Protracker 1 & 2.
|
|
Get the mode of the Protracker Tremolo Sawtooth bug.
|
|
Get the pattern sequence table in Ultimate Soundtracker 1.21 module.
|
|
Get the length of the Ultimate Soundtracker 1.21 module in patterns.
|
|
Get song position in milliseconds.
|
|
Get the song speed of the Ultimate Soundtracker 1.21 module.
|
|
Get the current tick speed.
|
|
Get the timing override.
|
|
getTitle()
Get the name of the Ultimate Soundtracker 1.21 module as a String.
|
|
Get the mode of the Vibrato (Noisetracker 1.1 & 2.0 have a different divider,
unfortunately its impossible to 100% id a Noisetracker 2.0 module so need to
give the user the ability to switch between Vibrato Modes).
|
|
Use to see if playing module has finished (modules naturally loop back to beginning).
|
|
Get the number of unique patterns in the Ultimate Soundtracker 1.21 module.
|
|
play(oAudioBuffer, bIgnoreFilter, iSamples)
Play this module into the given AudioBuffer object.
|
|
Process the effects column for all channels.
|
|
Process this modules pattern data, fetch the next pattern row into the channels for processing etc.
|
|
Process the effects column for all channels when current tick is zero (a new row has been fetched)
Ultimate Soundtracker does not process effects on this tick, however other Soundtrackers might.
|
|
Restart song from beginning of module.
|
|
setClockConstant(bClockConstant)
Set Clock Constant to either PAL or NTSC.
|
|
setCurrentSequencePosition(iSequencePosition)
Set the current sequence position in the song.
|
|
setFST7BitPanningMode(bEnabled)
Some Fasttracker/Taketracker use a 7 Bit panning position value in the 0x8xx
command.
|
|
setMasterVolume(fVolume)
Set the overriding master volume for this module.
|
|
setProtracker3SampleOffsetMode(bEnabled)
Protracker 3 has different Set Sample Offset command (9xx) behaviour, in that
it behaves as expected and only applies the Sample Offset before the sample
starts and not after, neither does it keep adding the Offset to the sample start
each call.
|
|
setProtrackerTremoloSawtoothBugMode(bBugEnabled)
The Protracker series has a bug when using the Ramp Down Sawtooth waveform
during the Tremolo command (the other waveform types are fine).
|
|
Set the number of samples needed between each song "tick" is processed (when new note data & sound fx are process etc),
the current samples remaining does not change, until the tick occurs.
|
|
setSongSpeed(iModuleBPMSpeed)
Set the song speed.
|
|
setVibratoMode(bNoisetracker20Mode)
Set the mode of the Vibrato (Noisetracker 1.1 & 2.0 have a different divider,
unfortunately its impossible to 100% id a Noisetracker 2.0 module so need to
give the user the ability to switch between Vibrato Modes).
|
|
startPendingSample(oChannel, iNotePeriod, fWaitForDMAToStop)
Start pending sample on a channel at a given note period.
|
|
Get tick playback rate in hz, this is speed at which the module processes each tick
(there are 6 ticks per row), used to set the (CIA) interrupt rate
, Ultimate Soundtracker allows you to adjust the song speed to values other than
the normal 50hz PAL vertical refresh synchronization.
|
|
timingOverride(iBPMPALNTSC)
Set Clock Constant to either PAL or NTSC.
|
|
Get the constant used for waiting for the DMA to stop in milliseconds.
|
Class Detail
weasel.UltimateSoundTracker121(aModuleData, iPlaybackFrequency, iSampleScannerMode)
Create a Ultimate Soundtracker 1.21 module out of the provided data (which has already passed the module sniffer test).
Author: Warren Willmey 2011.
Author: Warren Willmey 2011.
- Parameters:
- {Array|Uint8Array} aModuleData
- = The ultimate Soundtracker 1.21 module as a byte array that MUST have passed the module sniffer test.
- {int} iPlaybackFrequency
- = The playback frequency in hertz to use (e.g. 44100 ).
- {weasel.Sample.prototype.SampleScannerMode} iSampleScannerMode
- = Scan for IFF Header corruption residue?.
Field Detail
NTSC
NTSC vertical refresh rate in Hertz.
PAL
PAL vertical refresh rate in Hertz.
TimingOverrides
Override the default song speed and use the VBL timer instead.
Method Detail
changePlaybackFrequency(iPlaybackFrequency)
Set new output play back frequency, which requires the resizing of various buffers etc.
- Parameters:
- {int} iPlaybackFrequency
- = new replay play back frequency.
extractPatterns()
Extract all patterns within module data into Pattern objects.
fetchRow()
Fetch the next pattern row into the channels for processing.
{int}
findMaximumPatternNumber()
Get the maximum pattern number in Ultimate Soundtracker 1.21 module (this includes patterns not played).
- Returns:
- {int} = Maximum Pattern number.
{int}
FormatInstrumentTotal()
Get the number of instruments supported by the module format.
- Returns:
- {int} The total number of instruments this format supports (15 for Ultimate Soundtracker etc).
{int}
FormatModuleHeaderSize()
Get the Module Header Size used by the module format, it is also the starting offset for the pattern data.
- Returns:
- {int} the Module Header Size used by the module format, it is also the starting offset for the pattern data.
{weasel.Channel}
getChannel(iChannelNumber)
Get the requested audio channel object.
- Parameters:
- {int} iChannelNumber
- = The number of the channel to fetch.
- Returns:
- {weasel.Channel} = The requested audio channel object.
{float}
getCIATimerConstant()
Get the CIA Timer Clock Constant, which will be either PAL or NTSC CPU frequency divided by 10.
- Returns:
- {float} = The CIA Timer Clock Constant.
{weasel.PatternCell}
getCurrentPatternCell(iChannelNumber)
Get the current pattern cell object from the selected channel.
- Parameters:
- {int} iChannelNumber
- = The Channel containing the pattern cell to fetch.
- Returns:
- {weasel.PatternCell} = The current PatternCell object for the provided channel number.
{int}
getCurrentPatternRowPosition()
Get the Current Pattern Row Position in the song.
- Returns:
- {int} = The Current Pattern Row Position.
{int}
getCurrentSequencePosition()
Get the current sequence position in the song.
- Returns:
- {int} = The current sequence position.
{int}
getCurrentTick()
Get the current row tick.
- Returns:
- {int} = The current row tick (0-5 range, when a 0 occurs a new pattern row has been fetched).
{bool}
getFSTPanningMode()
Get the Fasttracker/Taketracker 7 Bit Panning Mode.
- Returns:
- {bool} = True : 7 Bit Panning in use, FALSE : 8 Bit Panning in use.
{weasel.Instrument}
getInstrument(iInstrumentNumber)
Get the instrument object.
- Parameters:
- {int} iInstrumentNumber
- = The instrument number (Range 1-15).
- Returns:
- {weasel.Instrument} = The instrument object, or null if not found (instrument number out of range).
{float}
getLengthOfSongInMilliSeconds()
Get length of song in milliseconds.
- Returns:
- {float} = The length of the song in ms.
{float}
getMasterVolume()
Get the current master volume of the module.
- Returns:
- {float} The current master volume.
{Array|Uint8Array}
getModuleData()
Get the Module Data.
- Returns:
- {Array|Uint8Array} = Array containing the original module data.
{String}
getModuleType()
Get the type of Soundtracker Module.
- Returns:
- {String} = The type of module.
{bool}
getNoiseTrackerLoopQuirkEnabled()
Noisetracker/Protracker loop quirks mode active (Taketracker/Fasttracker does not implement them).
- Returns:
- {bool} = True : yes, FALSE : no.
{String}
getNoteFromPeriod(iAmigaPeriod)
Get the note and octave from the period value (which is stored in the pattern).
- Parameters:
- {int} iAmigaPeriod
- = The Period value of the note.
- Returns:
- {String} = The note and octave (in the format note octave e.g. 'C-2' or 'G#1'), or '???' if not found.
{int}
getNumberOfChannels()
Get the number of channels in this module.
- Returns:
- {int} The number of channels in this module.
getPattern(iPatternNumber)
Get Pattern object from the pattern number.
- Parameters:
- {int} iPatternNumber
- = The number of the pattern to fetch (NOT THE SEQUENCE NUMBER!).
- Returns:
- Pattern = The request Pattern object or null if non-existent.
{int}
getPatternNumber(iSequenceNumber)
Get the pattern number from the sequence table at the given offset.
- Parameters:
- {int} iSequenceNumber
- = The offset into the sequence table of the wanted pattern number.
- Returns:
- {int} = Pattern number.
{int}
getPatternSizeInBytes()
Get the pattern size in bytes of this module.
- Returns:
- {int} The size of each pattern in bytes for this module type.
{int}
getPlaybackFrequency()
Get the current moduel playback frequency.
- Returns:
- {int} The current module playback frequency.
{bool}
getProtracker3SampleOffsetMode()
Get the mode of the Protracker 3 mode, Set Sample Offset behaves differently from Protracker 1 & 2.
- Returns:
- {bool} = True : Bug enabled (normal behaviour), False : bug disable.
{bool}
getProtrackerTremoloSawtoothBugMode()
Get the mode of the Protracker Tremolo Sawtooth bug.
- Returns:
- {bool} = True : Bug enabled (normal behaviour), False : bug disable.
{Array}
getSequenceTable()
Get the pattern sequence table in Ultimate Soundtracker 1.21 module.
- Returns:
- {Array} = The Pattern Sequence Table.
{int}
getSongLengthInPatterns()
Get the length of the Ultimate Soundtracker 1.21 module in patterns.
- Returns:
- {int} = Length of song in patterns.
{float}
getSongPositionInMilliSeconds()
Get song position in milliseconds.
- Returns:
- {float} = The song position from its beginning in ms.
{int}
getSongSpeed()
Get the song speed of the Ultimate Soundtracker 1.21 module.
- Returns:
- {int} = Song speed from module, which is in BPM (although its really an approximation, to get an accurate BPM use: (((tickPlaybackRateInHz() * 60Seconds) / 6TicksPerRow) / 4RowsPerQuarterNote) ).
{int}
getTickSpeed()
Get the current tick speed.
- Returns:
- {int} = The tick speed.
{weasel.UltimateSoundTracker121.TimingOverrides}
getTimingOverride()
Get the timing override.
- Returns:
- {weasel.UltimateSoundTracker121.TimingOverrides} = The timing override.
{String}
getTitle()
Get the name of the Ultimate Soundtracker 1.21 module as a String.
- Returns:
- {String} = Name of Sound Tracker Module, always character escape this string before display.
{bool}
getVibratoMode()
Get the mode of the Vibrato (Noisetracker 1.1 & 2.0 have a different divider,
unfortunately its impossible to 100% id a Noisetracker 2.0 module so need to
give the user the ability to switch between Vibrato Modes).
- Returns:
- {bool} = True : Noisetracker 2.0 Vibrato mode, False : Noisetracker 1.1 Vibrato Mode.
{bool}
hasSongEnded()
Use to see if playing module has finished (modules naturally loop back to beginning).
- Returns:
- {bool} = TRUE means Song has ended , FALSE mean Song not finished.
{int}
numberOfUniquePatternsInSong()
Get the number of unique patterns in the Ultimate Soundtracker 1.21 module.
- Returns:
- {int} = Number of unique number.
play(oAudioBuffer, bIgnoreFilter, iSamples)
Play this module into the given AudioBuffer object.
- Parameters:
- {weasel.AudioBuffer} oAudioBuffer
- = The AudioBuffer object to render to.
- {bool} bIgnoreFilter
- = Ignore using the Amiga Filter (only a very few modules actually use it).
- {int} iSamples
- = [optional] The number of samples to make this frame, usually the remaining samples to fill in the oAudioBuffer object.
processEffects()
Process the effects column for all channels.
processPattern()
Process this modules pattern data, fetch the next pattern row into the channels for processing etc.
processTick0Effects()
Process the effects column for all channels when current tick is zero (a new row has been fetched)
Ultimate Soundtracker does not process effects on this tick, however other Soundtrackers might.
restartSong()
Restart song from beginning of module.
setClockConstant(bClockConstant)
Set Clock Constant to either PAL or NTSC.
- Parameters:
- {bool} bClockConstant
- = true : PAL, false : NTSC.
setCurrentSequencePosition(iSequencePosition)
Set the current sequence position in the song.
- Parameters:
- {int} iSequencePosition
- = The position in the sequence table you want.
setFST7BitPanningMode(bEnabled)
Some Fasttracker/Taketracker use a 7 Bit panning position value in the 0x8xx
command. The Module Sniffer is able to detect this and sets the module accordingly,
but will sometimes get it wrong as composers enter the wrong values (or reperpose
in the case of a few of Necros & Basehead FST modules for 3D stereo using additional channels on the GUS).
- Parameters:
- {bool} bEnabled
- = True : Enable 7 Bit Panning mode, False : Enable 8 Bit Panning mode.
setMasterVolume(fVolume)
Set the overriding master volume for this module.
- Parameters:
- {float} fVolume
- = The volume range ( 0.0 - 1.0 ) although a range of 0.0 to 2.0 is accepted, the volume levels may not be clamped by the mixer causing clicks/pops etc.
setProtracker3SampleOffsetMode(bEnabled)
Protracker 3 has different Set Sample Offset command (9xx) behaviour, in that
it behaves as expected and only applies the Sample Offset before the sample
starts and not after, neither does it keep adding the Offset to the sample start
each call.
- Parameters:
- {bool} bEnabled
- = True : Enable Protracker 3 mode, False : Enable Protracker 1 & 2 mode.
setProtrackerTremoloSawtoothBugMode(bBugEnabled)
The Protracker series has a bug when using the Ramp Down Sawtooth waveform
during the Tremolo command (the other waveform types are fine). The bug
is caused by using the Vibrato Table Position instead of the Tremolo Table
Position during construction of the sawtooth resulting in either a lop sided
sawooth (non centered) if the Vibrato command is not used or a triangle-ish waveform
that almost randomly changes direction if the Vibrato command has been used on
the same channel.
- Parameters:
- {bool} bBugEnabled
- = True : Bug enabled (normal behaviour), False : bug disable.
setSamplesPerTick()
Set the number of samples needed between each song "tick" is processed (when new note data & sound fx are process etc),
the current samples remaining does not change, until the tick occurs.
setSongSpeed(iModuleBPMSpeed)
Set the song speed.
- Parameters:
- {int} iModuleBPMSpeed
- = The song speed as set in the module file (BPM) [0-220] which is the limits set down in Ultimate Soundtracker 1.8.
setVibratoMode(bNoisetracker20Mode)
Set the mode of the Vibrato (Noisetracker 1.1 & 2.0 have a different divider,
unfortunately its impossible to 100% id a Noisetracker 2.0 module so need to
give the user the ability to switch between Vibrato Modes).
- Parameters:
- {bool} bNoisetracker20Mode
- = True : Noisetracker 2.0 Vibrato mode, False : Noisetracker 1.1 Vibrato Mode.
startPendingSample(oChannel, iNotePeriod, fWaitForDMAToStop)
Start pending sample on a channel at a given note period.
- Parameters:
- {weasel.Channel} oChannel
- = The channel object to start its pending sample.
- {int} iNotePeriod
- = The note period yet to be set for this oChannel object.
- {float} fWaitForDMAToStop
- = The value to use (in milliseconds) for the pause between samples, typically weasel.FormatUltimateSoundTracker121.WaitForDMAToStop but Noisetracker/Protracker use different values.
{float}
tickPlaybackRateInHz()
Get tick playback rate in hz, this is speed at which the module processes each tick
(there are 6 ticks per row), used to set the (CIA) interrupt rate
, Ultimate Soundtracker allows you to adjust the song speed to values other than
the normal 50hz PAL vertical refresh synchronization. Notice that this value is
calculated from the CIA Timer Clock Constant value and that the default song speed of 120 (bpm)
does not result in a 50hz timer, instead its ~48.45hz (PAL). 120bpm is a established music speed,
125bpm is a traditional Amiga song speed as it allows the song to be synced with a 50hz PAL TV.
- Returns:
- {float} = The playback rate in hz.
timingOverride(iBPMPALNTSC)
Set Clock Constant to either PAL or NTSC.
- Parameters:
- {weasel.UltimateSoundTracker121.TimingOverrides} iBPMPALNTSC
- = Use the BPM set in mod | PAL 50hz | NTSC ~59.94hz (actually 60/1.001).
{float}
WaitForDMAToStop()
Get the constant used for waiting for the DMA to stop in milliseconds.
- Returns:
- {float} = The millisecond pause used by this module type.