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 /** Object containing constants that a Mahoney & Kaktus Noisetracker 1.1 module requires, in 9 * addition to those defined in FormatUltimateSoundTracker121, FormatDOCSoundTracker9, FormatDOCSoundTracker22 & Spreadpoint Soundtracker 2.3. 10 * 11 * @constructor 12 * @const 13 */ 14 weasel.FormatNoiseTracker11 = 15 { 16 /** The supported effects in a Mahoney & Kaktus Noisetracker 1.1 module in addition to those in Spreadpoint Soundtracker 2.3, DOC Soundtracker 2.2 & DOC Soundtracker 9. 17 * 18 * @const 19 * @enum {int} 20 */ 21 Effects: { 22 TonePortamento: 3 23 , Vibrato : 4 24 } 25 26 /** The offset in bytes, from the beginning of the module, to where the Song Speed 27 * (also refered to as the BPM, Beats Per Minute) is stored. The Song Speed 28 * has a range of 0-220, this limit was set down in Ultimate Soundtracker 1.8. 29 * However the ability to change this value was removed in The New Masters Soundtracker 1.0 30 * and has been missing ever since. Modules saved from DOC Soundtracker 2.0 & 2.2 Spreadpoint 2.3,2.4 & 2.5 31 * all save the default value of 120. Noisetracker decided to reuse this byte as the 32 * song sequence restart position. And the Protracker series (1.0c, 2.1a) 33 * marks its Soundtracker files with 127. 34 * 35 * @const 36 * @enum {int} 37 */ 38 , SongRestartPosition: 951 39 40 /** The sine table used by the Vibrato Command. 41 * 42 * @const 43 * @type {array} 44 */ 45 , VibratoTable : [ 0x0 , 0x18, 0x31, 0x4a, 0x61, 0x78, 0x8d, 0xa1 46 , 0xb4, 0xc5, 0xd4, 0xe0, 0xeb, 0xf4, 0xfa, 0xfd 47 , 0xff, 0xfd, 0xfa, 0xf4, 0xeb, 0xe0, 0xd4, 0xc5 48 , 0xb4, 0xa1, 0x8d, 0x78, 0x61, 0x4a, 0x31, 0x18 ] 49 50 /** 51 * Time in milliseconds that Noisetracker 1.1 waits between telling the DMA to stop playing and start a new Sample. 52 * The pause loop is similar to Ultimate Soundtracker but is 300 of the "dbf" 68000 instruction, which takes 10 clock cycles to execute. 53 * (300 * 10) = 3000 / 448 ( approx number of clock cycles CPU has per scanline) = 6.696 scanlines. 54 * Plus some other bits. 55 * 56 * TODO This value needs investigating more, as there is something fishy going on, even taking into account DMA access it does not quite match the pause generated on an Amiga. 57 * TODO Measuring this DMA Wait via the Scanline register $dff006 on the Amiga shows its a pause of 8 scanlines. I tried a more accurate method of reading the CIA A Timer B value 58 * and that was giving a typical pause of 361 or (361/.709379)/1000 = 0.508895809ms. This value is the same for Chip or Fast RAM and is approximately what you would expect (taking into account DMA access). 59 * However this is not the value when sampling the audio output. which I can't account for and is typically 120 samples at 96Khz (~0.625ms) but the value does vary, maybe there is a delay circuit within the Paula Audio chip? 60 * 61 * @const 62 * @type {float} 63 */ 64 , WaitForDMAToStop: 0.625//0.508895809 // Used a value of ((300 * 10 Clock Cycles)/7093790 (PAL Clock Constant)) * 1000ms. But does not take into account DMA access. 65 };