1 /** 2 * This file is part of the Web Enabled Audio and Sound Enhancement Library (aka the Weasel audio library) Copyright 2011 - 2013 Warren Willmey. It is covered by the GNU General Public License version 3 as published by the Free Software Foundation, you should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. 3 */ 4 5 if( undefined == window.weasel ) window.weasel = {}; 6 7 // --------------------------------------------------------------------------- 8 /** Create a Ultimate Soundtracker 1.8 module out of the provided data (which has already passed the module sniffer test). 9 * The only difference between 1.21 and 1.8 is that 1.8 uses the Song Speed 10 * to set the CIA timer and so does not run at the vertical refresh 11 * rate of a PAL monitor/tv. This ensured that the song played at approximately 12 * the correct speed on a NTSC based machine. However it introduces a 13 * problem in that songs that are written with 1.8 that are expected to play 14 * at 120BPM get identified as Ultimate Soundtracker 1.21 modules and played 15 * at PAL 50hz speed (which is 125BPM) and any Ultimate Soundtracker 1.21 songs 16 * played in the Ultimate Soundtracker 1.8 program get played back at 120BPM 17 * instead of the PAL 50hz speed. 18 * 19 * @constructor 20 * @extends weasel.UltimateSoundTracker121 21 * 22 * @param {Array|Uint8Array} aModuleData = The ultimate Soundtracker 1.8 module as a byte array that MUST have passed the module sniffer test. 23 * @param {int} iPlaybackFrequency = The playback frequency in hertz to use (e.g. 44100 ). 24 * @param {weasel.Sample.prototype.SampleScannerMode} iSampleScannerMode = Scan for IFF Header corruption residue?. 25 * 26 * @author Warren Willmey 2012 27 */ 28 weasel.UltimateSoundTracker18 = function( aModuleData, iPlaybackFrequency, iSampleScannerMode ) 29 { 30 this.parent = weasel.UltimateSoundTracker121; 31 32 // Needed for prototype Inheritance. 33 // 34 if( aModuleData === undefined || !(( aModuleData instanceof Array ) || ( window.Uint8Array && aModuleData instanceof Uint8Array )) ) 35 return; 36 37 this.parent( aModuleData, iPlaybackFrequency, iSampleScannerMode ); 38 this.sModuleType = weasel.ModuleSniffer.prototype.SupportedModules.UltimateSoundTracker18; 39 40 // Ultimate Soundtracker 1.8 introduced BPM song speed. Ultimate Soundtracker 1.21 always played at PAL speed (50hz, 125BPM). 41 // 42 this.timingOverride( this.TimingOverrides.UseBPM ); 43 }; 44 45 weasel.UltimateSoundTracker18.prototype = new weasel.UltimateSoundTracker121; 46