commit 1b8971ea2f17a891c5777a6ceb66eb4b05574560 Author: gauthiier Date: Sat Dec 1 12:33:53 2018 +0100 haha! commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/CFO Cheat Sheet.pdf b/CFO Cheat Sheet.pdf new file mode 100644 index 0000000..69dfe37 Binary files /dev/null and b/CFO Cheat Sheet.pdf differ diff --git a/CFO Cheat Sheet.rtf b/CFO Cheat Sheet.rtf new file mode 100644 index 0000000..eabe497 --- /dev/null +++ b/CFO Cheat Sheet.rtf @@ -0,0 +1,229 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf200 +{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;} +{\colortbl;\red255\green255\blue255;\red0\green116\blue0;\red170\green13\blue145;\red100\green56\blue32; +\red28\green0\blue207;} +\paperw16840\paperh11900\margl1440\margr1440\vieww16500\viewh14280\viewkind0 +\deftab560 +\pard\tx560\pardeftab560\pardirnatural + +\f0\fs22 \cf0 \CocoaLigature0 M3T3 MUSIC CHEAT SHEET\ +\ +\ + \cf2 // FREQUENCY AND DETUNE FUNCTIONS\cf0 \ + \cf3 void\cf0 setFrequency(\cf3 float\cf0 frequency); \cf2 // 0.0 - whatever, not sure what happens when negative :)\cf0 \ + \cf3 void\cf0 setFrequency1(\cf3 float\cf0 frequency1); \ + \cf3 void\cf0 setFrequency2(\cf3 float\cf0 frequency2);\ + \cf3 void\cf0 setFrequency3(\cf3 float\cf0 frequency3);\ +\ + \cf3 void\cf0 setSemitone1(int8_t semi); \cf2 // -24 to 24\cf0 \ + \cf3 void\cf0 setSemitone2(int8_t semi);\ + \cf3 void\cf0 setSemitone3(int8_t semi);\ +\ + \cf3 void\cf0 setDetune(\cf3 float\cf0 detune); \cf2 // 0.0 to whatever.\cf0 \ + \cf3 void\cf0 setDetune1(\cf3 float\cf0 detune); \cf2 // 1.0 is one octave.\cf0 \ + \cf3 void\cf0 setDetune2(\cf3 float\cf0 detune); \cf2 // best results with detune between 0.00 and 0.02\cf0 \ + \cf3 void\cf0 setDetune3(\cf3 float\cf0 detune);\ +\ + \cf3 void\cf0 setOsc1LFO(\cf3 bool\cf0 lfo); \cf2 // true or false\cf0 \ + \cf3 void\cf0 setOsc2LFO(\cf3 bool\cf0 lfo);\ + \cf3 void\cf0 setOsc3LFO(\cf3 bool\cf0 lfo);\ +\ + \cf3 void\cf0 setFM1(uint8_t fm); \cf2 // 0 - 127\cf0 \ + \cf3 void\cf0 setFM2(uint8_t fm);\ + \cf3 void\cf0 setFM3(uint8_t fm);\ +\ + \cf3 void\cf0 setFMoctaves(uint8_t octs); \cf2 // 1 - 128, it won\'92t go down to zero.\cf0 \ + \cf3 void\cf0 setFM1octaves(uint8_t octs);\ + \cf3 void\cf0 setFM2octaves(uint8_t octs);\ + \cf3 void\cf0 setFM3octaves(uint8_t octs);\ +\ + \cf3 void\cf0 setFM1Source(uint8_t source); \cf2 // 0 - 3 where\cf0 \ + \cf3 void\cf0 setFM2Source(uint8_t source); \cf2 // 0 is linear, 1 is Osc1\cf0 \ + \cf3 void\cf0 setFM3Source(uint8_t source); \cf2 // 2 is Osc2 and 3 is Osc3\cf0 \ +\ + \cf3 void\cf0 setFM1Shape(uint8_t shape); \cf2 // 0 - 5 where\cf0 \ + \cf3 void\cf0 setFM2Shape(uint8_t shape); \cf2 // 0 is linear full signal\cf0 \ + \cf3 void\cf0 setFM3Shape(uint8_t shape); \cf2 // 1 is envelope1, 2 is envelope2, \ + // 3 is oscillator1, 4 is oscillator2 and 5 is oscillator 3\cf0 \ +\ + \cf3 void\cf0 fmToZeroHertz(\cf3 bool\cf0 ); \cf2 // true or false, if set to true the FM sounds more harmonic\cf0 \ +\ + \cf3 void\cf0 setPortamento(int32_t port); \cf2 // 0 - 127\cf0 \ +\ +\cf3 void\cf0 set12bit(\cf3 bool\cf0 ) \cf2 // true or false\cf0 \ +\ +\ + \cf2 // WAVEFORM FUNCTIONS\cf0 \ + \cf3 void\cf0 setWaveform(uint16_t waveForm); \cf2 // JUST FOR 8bit WAVEFORMS\cf0 \ + \cf3 void\cf0 setWaveform1(uint16_t waveForm); \cf2 // 0 - 15\cf0 \ + \cf3 void\cf0 setWaveform2(uint16_t waveForm); \cf2 //\cf0 \ + \cf3 void\cf0 setWaveform3(uint16_t waveForm); \cf2 //\ +\ + // SHORTNAMES FOR WAVEFORMS\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 SINE \cf5 0\cf4 \ + SQUARE \cf5 1\cf4 \ + PULSE \cf5 2\cf4 \ + TRIANGLE \cf5 3\cf4 \ + SAW \cf5 4\cf4 \ + FUZZ \cf5 5\cf4 \ + DIGI1 \cf5 6\cf4 \ + DIGI2 \cf5 7\cf4 \ + DIGI3 \cf5 8\cf4 \ + DIGI4 \cf5 9\cf4 \ + NOISE \cf5 10\cf4 \ + DIGI6 \cf5 11\cf4 \ + TAN1 \cf5 12\cf4 \ + TAN2 \cf5 13\cf4 \ + TAN3 \cf5 14\cf4 \ + TAN4 \cf5 15\cf2 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \page \cf2 // GAIN FUNCTIONS\cf0 \ + \cf3 void\cf0 setGain(\cf3 float\cf0 value); \cf2 // 0.0 - 1.0 \cf0 \ + \cf3 void\cf0 setGain1(\cf3 float\cf0 value); \cf2 // 0.0 - 1.0 \cf0 \ + \cf3 void\cf0 setGain2(\cf3 float\cf0 value); \cf2 // 0.0 - 1.0 \cf0 \ + \cf3 void\cf0 setGain3(\cf3 float\cf0 value); \cf2 // 0.0 - 1.0 \cf0 \ +\ + \cf3 float\cf0 getGain(); \cf2 // 0.0 - 1.0 \cf0 \ + \cf3 float\cf0 getGain1(); \cf2 // 0.0 - 1.0 \cf0 \ + \cf3 float\cf0 getGain2(); \cf2 // 0.0 - 1.0 \cf0 \ + \cf3 float\cf0 getGain3(); \cf2 // 0.0 - 1.0 \cf0 \ +\ +\ +\ +\ + \cf2 // NOTE FUNCTIONS\cf0 \ + \cf3 void\cf0 noteOn(uint8_t note, uint8_t vel); \cf2 // 0 - 127\cf0 \ + \cf3 void\cf0 noteOn(uint8_t note); \cf2 // 0 - 127\cf0 \ +\ + \cf3 void\cf0 noteOff(uint8_t note); \cf2 // 0 - 127\cf0 \ + \cf3 void\cf0 noteOff();\ +\ + \cf3 float\cf0 getNoteFrequency(uint8_t note); \cf2 // 0 - 127\cf0 \ +\ +\ +\ +\ + \cf2 // ENVELOPE FUNCTIONS\cf0 \ + \cf3 void\cf0 enableEnvelope1();\ + \cf3 void\cf0 disableEnvelope1(); \ +\ + \cf3 void\cf0 setEnv1Attack(uint8_t att); \cf2 // 0 - 127 \cf0 \ + \cf3 void\cf0 setEnv1Decay(uint8_t dec); \cf2 // 0 - 127 \cf0 \ + \cf3 void\cf0 setEnv1Sustain(uint8_t sus); \cf2 // 0 - 127 \cf0 \ + \cf3 void\cf0 setEnv1Release(uint8_t rel); \cf2 // 0 - 127 \cf0 \ + \ + \cf3 void\cf0 enableEnvelope2();\ + \cf3 void\cf0 disableEnvelope2();\ +\ + \cf3 void\cf0 setEnv2Attack(uint8_t att); \cf2 // 0 - 127 \cf0 \ + \cf3 void\cf0 setEnv2Decay(uint8_t dec); \cf2 // 0 - 127 \cf0 \ + \cf3 void\cf0 setEnv2Sustain(uint8_t sus); \cf2 // 0 - 127 \cf0 \ + \cf3 void\cf0 setEnv2Release(uint8_t rel); \cf2 // 0 - 127 \cf0 \ +\ +\ + \cf3 void\cf0 getPreset(uint8_t p); \cf2 // 0 - 47, 0 to 15 are user presets on EEPROM\ + // 16 to 47 are \'93factory presets\'94\cf0 \ + \cf3 void\cf0 savePreset(uint8_t p); \cf2 // 0 - 15, saves current instrument to EEPROM \cf0 \ + \cf3 void\cf0 sendInstrument(); \cf2 // send current instrument via MIDI as controller messages\ +\ +\pard\tx560\pardeftab560\pardirnatural +\cf4 BANK_U \cf5 0 \cf2 // User preset bank\cf4 \ + BANK_A \cf5 16 \cf2 // Preset bank A\cf0 \ +\cf4 BANK_B \cf5 32 \cf2 // Preset bank B\cf0 \ +\cf4 BANK_C \cf5 48 \cf2 // Preset bank C\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf2 \page \ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +//synth parameters as MIDI controller numbers\cf0 \ +\cf2 //synth functions and parameters as MIDI controller numbers\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 PRESET_SAVE \cf5 0\cf4 \ + PRESET_RECALL \cf5 1\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 IS_12_BIT \cf5 3\cf4 \ + CUTOFF \cf5 4 \cf4 \ + ZERO_HZ_FM \cf5 5\cf4 \ + FM_OCTAVES \cf5 6\cf4 \ + PORTAMENTO \cf5 8\cf4 \ + FILTER_TYPE \cf5 9\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 LFO1 \cf5 10\cf4 \ + SEMITONE1 \cf5 11\cf4 \ + DETUNE1 \cf5 12\cf4 \ + GAIN1 \cf5 13\cf4 \ + WAVEFORM1 \cf5 14\cf4 \ + FM1 \cf5 15\cf4 \ + FM1_OCTAVES \cf5 16\cf4 \ + FM1_SOURCE \cf5 17\cf4 \ + FM1_SHAPE \cf5 18\cf4 \ + FREQUENCY1 \cf5 19\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 LFO2 \cf5 20\cf4 \ + SEMITONE2 \cf5 21\cf4 \ + DETUNE2 \cf5 22\cf4 \ + GAIN2 \cf5 23\cf4 \ + WAVEFORM2 \cf5 24\cf4 \ + FM2 \cf5 25\cf4 \ + FM2_OCTAVES \cf5 26\cf4 \ + FM2_SOURCE \cf5 27\cf4 \ + FM2_SHAPE \cf5 28\cf4 \ + FREQUENCY2 \cf5 29\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 LFO3 \cf5 30\cf4 \ + SEMITONE3 \cf5 31\cf4 \ + DETUNE3 \cf5 32\cf4 \ + GAIN3 \cf5 33\cf4 \ + WAVEFORM3 \cf5 34\cf4 \ + FM3 \cf5 35\cf4 \ + FM3_OCTAVES \cf5 36\cf4 \ + FM3_SOURCE \cf5 37\cf4 \ + FM3_SHAPE \cf5 38\cf4 \ + FREQUENCY3 \cf5 39\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 CUTOFF_MOD_AMOUNT \cf5 70\cf4 \ + CUTOFF_SOURCE \cf5 72\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 ENV1_VELOCITY \cf5 112\cf4 \ + ENV1_ENABLE \cf5 113\cf4 \ + ENV1_ATTACK \cf5 114\cf4 \ + ENV1_DECAY \cf5 115\cf4 \ + ENV1_SUSTAIN \cf5 116\cf4 \ + ENV1_RELEASE \cf5 117\cf4 \ +\pard\tx560\pardeftab560\pardirnatural +\cf0 \ +\pard\tx560\pardeftab560\pardirnatural +\cf4 ENV2_VELOCITY \cf5 122\cf4 \ + ENV2_ENABLE \cf5 123\cf4 \ + ENV2_ATTACK \cf5 124\cf4 \ + ENV2_DECAY \cf5 125\cf4 \ + ENV2_SUSTAIN \cf5 126\cf4 \ + ENV2_RELEASE \cf5 127\cf4 \ +\ +} \ No newline at end of file diff --git a/FrictionHertzTable.inc b/FrictionHertzTable.inc new file mode 100644 index 0000000..ca1daeb --- /dev/null +++ b/FrictionHertzTable.inc @@ -0,0 +1,129 @@ +// MIDI notes 0 - 127 as floating point frequencies +8.175773, +8.66193, +9.176996, +9.722689, +10.30083, +10.91335, +11.562292, +12.249822, +12.978235, +13.749962, +14.567577, +15.433812, +16.351555, +17.32387, +18.354002, +19.445389, +20.601671, +21.826712, +23.124598, +24.499659, +25.956484, +27.499939, +29.13517, +30.86764, +32.70313, +34.64776, +36.708023, +38.890797, +41.203365, +43.65345, +46.249218, +48.999344, +51.913, +54.99991, +58.270374, +61.735313, +65.40629, +69.295555, +73.416084, +77.78164, +82.40678, +87.306946, +92.49849, +97.99874, +103.82606, +109.99988, +116.54082, +123.4707, +130.81267, +138.59119, +146.83224, +155.56335, +164.81364, +174.61398, +184.99709, +195.9976, +207.65222, +219.99988, +233.08176, +246.94154, +261.62546, +277.18253, +293.66467, +311.1269, +329.62747, +349.22818, +369.9944, +391.9954, +415.30466, +440.0, +466.1638, +493.88336, +523.2512, +554.36536, +587.32965, +622.2541, +659.2553, +698.4567, +739.9892, +783.9912, +830.6098, +880.00055, +932.32806, +987.7672, +1046.5029, +1108.7314, +1174.66, +1244.5089, +1318.5114, +1396.9142, +1479.9791, +1567.9833, +1661.2206, +1760.0018, +1864.6572, +1975.5355, +2093.007, +2217.4639, +2349.3213, +2489.0193, +2637.0242, +2793.83, +2959.9597, +3135.9685, +3322.4429, +3520.0059, +3729.3167, +3951.0735, +4186.0166, +4434.93, +4698.6455, +4978.0415, +5274.052, +5587.663, +5919.923, +6271.9404, +6644.8896, +7040.016, +7458.637, +7902.1514, +8372.038, +8869.865, +9397.296, +9956.089, +10548.109, +11175.333, +11839.853, +12543.888 \ No newline at end of file diff --git a/FrictionSineTable16bitHex.inc b/FrictionSineTable16bitHex.inc new file mode 100644 index 0000000..4586138 --- /dev/null +++ b/FrictionSineTable16bitHex.inc @@ -0,0 +1,256 @@ +0x7FFF, 0x8031, 0x8064, 0x8096, 0x80C8, 0x80FA, 0x812D, 0x815F, 0x8191, 0x81C3, 0x81F6, 0x8228, 0x825A, 0x828C, 0x82BF, 0x82F1, +0x8323, 0x8355, 0x8388, 0x83BA, 0x83EC, 0x841E, 0x8451, 0x8483, 0x84B5, 0x84E7, 0x851A, 0x854C, 0x857E, 0x85B0, 0x85E2, 0x8615, +0x8647, 0x8679, 0x86AB, 0x86DD, 0x8710, 0x8742, 0x8774, 0x87A6, 0x87D8, 0x880A, 0x883D, 0x886F, 0x88A1, 0x88D3, 0x8905, 0x8937, +0x896A, 0x899C, 0x89CE, 0x8A00, 0x8A32, 0x8A64, 0x8A96, 0x8AC8, 0x8AFA, 0x8B2C, 0x8B5F, 0x8B91, 0x8BC3, 0x8BF5, 0x8C27, 0x8C59, +0x8C8B, 0x8CBD, 0x8CEF, 0x8D21, 0x8D53, 0x8D85, 0x8DB7, 0x8DE9, 0x8E1B, 0x8E4D, 0x8E7F, 0x8EB1, 0x8EE2, 0x8F14, 0x8F46, 0x8F78, +0x8FAA, 0x8FDC, 0x900E, 0x9040, 0x9072, 0x90A3, 0x90D5, 0x9107, 0x9139, 0x916B, 0x919C, 0x91CE, 0x9200, 0x9232, 0x9264, 0x9295, +0x92C7, 0x92F9, 0x932A, 0x935C, 0x938E, 0x93BF, 0x93F1, 0x9423, 0x9454, 0x9486, 0x94B8, 0x94E9, 0x951B, 0x954C, 0x957E, 0x95AF, +0x95E1, 0x9613, 0x9644, 0x9676, 0x96A7, 0x96D8, 0x970A, 0x973B, 0x976D, 0x979E, 0x97D0, 0x9801, 0x9832, 0x9864, 0x9895, 0x98C6, +0x98F8, 0x9929, 0x995A, 0x998B, 0x99BD, 0x99EE, 0x9A1F, 0x9A50, 0x9A82, 0x9AB3, 0x9AE4, 0x9B15, 0x9B46, 0x9B77, 0x9BA8, 0x9BD9, +0x9C0A, 0x9C3B, 0x9C6C, 0x9C9D, 0x9CCE, 0x9CFF, 0x9D30, 0x9D61, 0x9D92, 0x9DC3, 0x9DF4, 0x9E25, 0x9E56, 0x9E86, 0x9EB7, 0x9EE8, +0x9F19, 0x9F4A, 0x9F7A, 0x9FAB, 0x9FDC, 0xA00C, 0xA03D, 0xA06E, 0xA09E, 0xA0CF, 0xA0FF, 0xA130, 0xA161, 0xA191, 0xA1C2, 0xA1F2, +0xA223, 0xA253, 0xA283, 0xA2B4, 0xA2E4, 0xA314, 0xA345, 0xA375, 0xA3A5, 0xA3D6, 0xA406, 0xA436, 0xA466, 0xA497, 0xA4C7, 0xA4F7, +0xA527, 0xA557, 0xA587, 0xA5B7, 0xA5E7, 0xA617, 0xA647, 0xA677, 0xA6A7, 0xA6D7, 0xA707, 0xA737, 0xA766, 0xA796, 0xA7C6, 0xA7F6, +0xA826, 0xA855, 0xA885, 0xA8B5, 0xA8E4, 0xA914, 0xA943, 0xA973, 0xA9A3, 0xA9D2, 0xAA02, 0xAA31, 0xAA61, 0xAA90, 0xAABF, 0xAAEF, +0xAB1E, 0xAB4D, 0xAB7D, 0xABAC, 0xABDB, 0xAC0A, 0xAC3A, 0xAC69, 0xAC98, 0xACC7, 0xACF6, 0xAD25, 0xAD54, 0xAD83, 0xADB2, 0xADE1, +0xAE10, 0xAE3F, 0xAE6E, 0xAE9C, 0xAECB, 0xAEFA, 0xAF29, 0xAF57, 0xAF86, 0xAFB5, 0xAFE3, 0xB012, 0xB041, 0xB06F, 0xB09E, 0xB0CC, +0xB0FB, 0xB129, 0xB157, 0xB186, 0xB1B4, 0xB1E2, 0xB211, 0xB23F, 0xB26D, 0xB29B, 0xB2C9, 0xB2F8, 0xB326, 0xB354, 0xB382, 0xB3B0, +0xB3DE, 0xB40C, 0xB43A, 0xB467, 0xB495, 0xB4C3, 0xB4F1, 0xB51F, 0xB54C, 0xB57A, 0xB5A8, 0xB5D5, 0xB603, 0xB630, 0xB65E, 0xB68B, +0xB6B9, 0xB6E6, 0xB714, 0xB741, 0xB76E, 0xB79C, 0xB7C9, 0xB7F6, 0xB823, 0xB851, 0xB87E, 0xB8AB, 0xB8D8, 0xB905, 0xB932, 0xB95F, +0xB98C, 0xB9B9, 0xB9E5, 0xBA12, 0xBA3F, 0xBA6C, 0xBA98, 0xBAC5, 0xBAF2, 0xBB1E, 0xBB4B, 0xBB77, 0xBBA4, 0xBBD0, 0xBBFD, 0xBC29, +0xBC55, 0xBC82, 0xBCAE, 0xBCDA, 0xBD07, 0xBD33, 0xBD5F, 0xBD8B, 0xBDB7, 0xBDE3, 0xBE0F, 0xBE3B, 0xBE67, 0xBE93, 0xBEBE, 0xBEEA, +0xBF16, 0xBF42, 0xBF6D, 0xBF99, 0xBFC5, 0xBFF0, 0xC01C, 0xC047, 0xC073, 0xC09E, 0xC0C9, 0xC0F5, 0xC120, 0xC14B, 0xC177, 0xC1A2, +0xC1CD, 0xC1F8, 0xC223, 0xC24E, 0xC279, 0xC2A4, 0xC2CF, 0xC2FA, 0xC324, 0xC34F, 0xC37A, 0xC3A5, 0xC3CF, 0xC3FA, 0xC425, 0xC44F, +0xC47A, 0xC4A4, 0xC4CE, 0xC4F9, 0xC523, 0xC54D, 0xC578, 0xC5A2, 0xC5CC, 0xC5F6, 0xC620, 0xC64A, 0xC674, 0xC69E, 0xC6C8, 0xC6F2, +0xC71C, 0xC745, 0xC76F, 0xC799, 0xC7C2, 0xC7EC, 0xC816, 0xC83F, 0xC869, 0xC892, 0xC8BB, 0xC8E5, 0xC90E, 0xC937, 0xC961, 0xC98A, +0xC9B3, 0xC9DC, 0xCA05, 0xCA2E, 0xCA57, 0xCA80, 0xCAA9, 0xCAD1, 0xCAFA, 0xCB23, 0xCB4C, 0xCB74, 0xCB9D, 0xCBC5, 0xCBEE, 0xCC16, +0xCC3F, 0xCC67, 0xCC8F, 0xCCB7, 0xCCE0, 0xCD08, 0xCD30, 0xCD58, 0xCD80, 0xCDA8, 0xCDD0, 0xCDF8, 0xCE20, 0xCE48, 0xCE6F, 0xCE97, +0xCEBF, 0xCEE6, 0xCF0E, 0xCF35, 0xCF5D, 0xCF84, 0xCFAC, 0xCFD3, 0xCFFA, 0xD021, 0xD048, 0xD070, 0xD097, 0xD0BE, 0xD0E5, 0xD10C, +0xD132, 0xD159, 0xD180, 0xD1A7, 0xD1CE, 0xD1F4, 0xD21B, 0xD241, 0xD268, 0xD28E, 0xD2B5, 0xD2DB, 0xD301, 0xD327, 0xD34E, 0xD374, +0xD39A, 0xD3C0, 0xD3E6, 0xD40C, 0xD432, 0xD458, 0xD47D, 0xD4A3, 0xD4C9, 0xD4EE, 0xD514, 0xD539, 0xD55F, 0xD584, 0xD5AA, 0xD5CF, +0xD5F4, 0xD61A, 0xD63F, 0xD664, 0xD689, 0xD6AE, 0xD6D3, 0xD6F8, 0xD71D, 0xD741, 0xD766, 0xD78B, 0xD7AF, 0xD7D4, 0xD7F9, 0xD81D, +0xD842, 0xD866, 0xD88A, 0xD8AE, 0xD8D3, 0xD8F7, 0xD91B, 0xD93F, 0xD963, 0xD987, 0xD9AB, 0xD9CF, 0xD9F3, 0xDA16, 0xDA3A, 0xDA5E, +0xDA81, 0xDAA5, 0xDAC8, 0xDAEC, 0xDB0F, 0xDB32, 0xDB55, 0xDB79, 0xDB9C, 0xDBBF, 0xDBE2, 0xDC05, 0xDC28, 0xDC4B, 0xDC6D, 0xDC90, +0xDCB3, 0xDCD5, 0xDCF8, 0xDD1A, 0xDD3D, 0xDD5F, 0xDD82, 0xDDA4, 0xDDC6, 0xDDE8, 0xDE0B, 0xDE2D, 0xDE4F, 0xDE71, 0xDE92, 0xDEB4, +0xDED6, 0xDEF8, 0xDF1A, 0xDF3B, 0xDF5D, 0xDF7E, 0xDFA0, 0xDFC1, 0xDFE2, 0xE004, 0xE025, 0xE046, 0xE067, 0xE088, 0xE0A9, 0xE0CA, +0xE0EB, 0xE10C, 0xE12C, 0xE14D, 0xE16E, 0xE18E, 0xE1AF, 0xE1CF, 0xE1F0, 0xE210, 0xE230, 0xE250, 0xE271, 0xE291, 0xE2B1, 0xE2D1, +0xE2F1, 0xE310, 0xE330, 0xE350, 0xE370, 0xE38F, 0xE3AF, 0xE3CE, 0xE3EE, 0xE40D, 0xE42D, 0xE44C, 0xE46B, 0xE48A, 0xE4A9, 0xE4C8, +0xE4E7, 0xE506, 0xE525, 0xE544, 0xE562, 0xE581, 0xE5A0, 0xE5BE, 0xE5DD, 0xE5FB, 0xE619, 0xE638, 0xE656, 0xE674, 0xE692, 0xE6B0, +0xE6CE, 0xE6EC, 0xE70A, 0xE728, 0xE745, 0xE763, 0xE781, 0xE79E, 0xE7BC, 0xE7D9, 0xE7F6, 0xE814, 0xE831, 0xE84E, 0xE86B, 0xE888, +0xE8A5, 0xE8C2, 0xE8DF, 0xE8FC, 0xE918, 0xE935, 0xE952, 0xE96E, 0xE98B, 0xE9A7, 0xE9C3, 0xE9E0, 0xE9FC, 0xEA18, 0xEA34, 0xEA50, +0xEA6C, 0xEA88, 0xEAA4, 0xEAC0, 0xEADB, 0xEAF7, 0xEB13, 0xEB2E, 0xEB4A, 0xEB65, 0xEB80, 0xEB9B, 0xEBB7, 0xEBD2, 0xEBED, 0xEC08, +0xEC23, 0xEC3E, 0xEC58, 0xEC73, 0xEC8E, 0xECA8, 0xECC3, 0xECDD, 0xECF8, 0xED12, 0xED2C, 0xED47, 0xED61, 0xED7B, 0xED95, 0xEDAF, +0xEDC9, 0xEDE2, 0xEDFC, 0xEE16, 0xEE2F, 0xEE49, 0xEE62, 0xEE7C, 0xEE95, 0xEEAF, 0xEEC8, 0xEEE1, 0xEEFA, 0xEF13, 0xEF2C, 0xEF45, +0xEF5E, 0xEF76, 0xEF8F, 0xEFA8, 0xEFC0, 0xEFD9, 0xEFF1, 0xF009, 0xF022, 0xF03A, 0xF052, 0xF06A, 0xF082, 0xF09A, 0xF0B2, 0xF0CA, +0xF0E1, 0xF0F9, 0xF111, 0xF128, 0xF140, 0xF157, 0xF16E, 0xF186, 0xF19D, 0xF1B4, 0xF1CB, 0xF1E2, 0xF1F9, 0xF210, 0xF226, 0xF23D, +0xF254, 0xF26A, 0xF281, 0xF297, 0xF2AE, 0xF2C4, 0xF2DA, 0xF2F0, 0xF306, 0xF31C, 0xF332, 0xF348, 0xF35E, 0xF374, 0xF389, 0xF39F, +0xF3B4, 0xF3CA, 0xF3DF, 0xF3F5, 0xF40A, 0xF41F, 0xF434, 0xF449, 0xF45E, 0xF473, 0xF488, 0xF49D, 0xF4B1, 0xF4C6, 0xF4DA, 0xF4EF, +0xF503, 0xF518, 0xF52C, 0xF540, 0xF554, 0xF568, 0xF57C, 0xF590, 0xF5A4, 0xF5B8, 0xF5CC, 0xF5DF, 0xF5F3, 0xF606, 0xF61A, 0xF62D, +0xF640, 0xF653, 0xF667, 0xF67A, 0xF68D, 0xF6A0, 0xF6B2, 0xF6C5, 0xF6D8, 0xF6EA, 0xF6FD, 0xF70F, 0xF722, 0xF734, 0xF747, 0xF759, +0xF76B, 0xF77D, 0xF78F, 0xF7A1, 0xF7B3, 0xF7C4, 0xF7D6, 0xF7E8, 0xF7F9, 0xF80B, 0xF81C, 0xF82D, 0xF83F, 0xF850, 0xF861, 0xF872, +0xF883, 0xF894, 0xF8A5, 0xF8B6, 0xF8C6, 0xF8D7, 0xF8E7, 0xF8F8, 0xF908, 0xF919, 0xF929, 0xF939, 0xF949, 0xF959, 0xF969, 0xF979, +0xF989, 0xF998, 0xF9A8, 0xF9B8, 0xF9C7, 0xF9D7, 0xF9E6, 0xF9F5, 0xFA04, 0xFA14, 0xFA23, 0xFA32, 0xFA41, 0xFA4F, 0xFA5E, 0xFA6D, +0xFA7C, 0xFA8A, 0xFA99, 0xFAA7, 0xFAB5, 0xFAC4, 0xFAD2, 0xFAE0, 0xFAEE, 0xFAFC, 0xFB0A, 0xFB18, 0xFB25, 0xFB33, 0xFB41, 0xFB4E, +0xFB5C, 0xFB69, 0xFB76, 0xFB83, 0xFB91, 0xFB9E, 0xFBAB, 0xFBB8, 0xFBC4, 0xFBD1, 0xFBDE, 0xFBEB, 0xFBF7, 0xFC04, 0xFC10, 0xFC1C, +0xFC29, 0xFC35, 0xFC41, 0xFC4D, 0xFC59, 0xFC65, 0xFC70, 0xFC7C, 0xFC88, 0xFC93, 0xFC9F, 0xFCAA, 0xFCB6, 0xFCC1, 0xFCCC, 0xFCD7, +0xFCE2, 0xFCED, 0xFCF8, 0xFD03, 0xFD0E, 0xFD18, 0xFD23, 0xFD2E, 0xFD38, 0xFD42, 0xFD4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D6B, 0xFD61, 0xFD57, 0xFD4D, 0xFD42, 0xFD38, 0xFD2E, 0xFD23, 0xFD18, 0xFD0E, 0xFD03, 0xFCF8, 0xFCED, +0xFCE2, 0xFCD7, 0xFCCC, 0xFCC1, 0xFCB6, 0xFCAA, 0xFC9F, 0xFC93, 0xFC88, 0xFC7C, 0xFC70, 0xFC65, 0xFC59, 0xFC4D, 0xFC41, 0xFC35, +0xFC29, 0xFC1C, 0xFC10, 0xFC04, 0xFBF7, 0xFBEB, 0xFBDE, 0xFBD1, 0xFBC4, 0xFBB8, 0xFBAB, 0xFB9E, 0xFB91, 0xFB83, 0xFB76, 0xFB69, +0xFB5C, 0xFB4E, 0xFB41, 0xFB33, 0xFB25, 0xFB18, 0xFB0A, 0xFAFC, 0xFAEE, 0xFAE0, 0xFAD2, 0xFAC4, 0xFAB5, 0xFAA7, 0xFA99, 0xFA8A, +0xFA7C, 0xFA6D, 0xFA5E, 0xFA4F, 0xFA41, 0xFA32, 0xFA23, 0xFA14, 0xFA04, 0xF9F5, 0xF9E6, 0xF9D7, 0xF9C7, 0xF9B8, 0xF9A8, 0xF998, +0xF989, 0xF979, 0xF969, 0xF959, 0xF949, 0xF939, 0xF929, 0xF919, 0xF908, 0xF8F8, 0xF8E7, 0xF8D7, 0xF8C6, 0xF8B6, 0xF8A5, 0xF894, +0xF883, 0xF872, 0xF861, 0xF850, 0xF83F, 0xF82D, 0xF81C, 0xF80B, 0xF7F9, 0xF7E8, 0xF7D6, 0xF7C4, 0xF7B3, 0xF7A1, 0xF78F, 0xF77D, +0xF76B, 0xF759, 0xF747, 0xF734, 0xF722, 0xF70F, 0xF6FD, 0xF6EA, 0xF6D8, 0xF6C5, 0xF6B2, 0xF6A0, 0xF68D, 0xF67A, 0xF667, 0xF653, +0xF640, 0xF62D, 0xF61A, 0xF606, 0xF5F3, 0xF5DF, 0xF5CC, 0xF5B8, 0xF5A4, 0xF590, 0xF57C, 0xF568, 0xF554, 0xF540, 0xF52C, 0xF518, +0xF503, 0xF4EF, 0xF4DA, 0xF4C6, 0xF4B1, 0xF49D, 0xF488, 0xF473, 0xF45E, 0xF449, 0xF434, 0xF41F, 0xF40A, 0xF3F5, 0xF3DF, 0xF3CA, +0xF3B4, 0xF39F, 0xF389, 0xF374, 0xF35E, 0xF348, 0xF332, 0xF31C, 0xF306, 0xF2F0, 0xF2DA, 0xF2C4, 0xF2AE, 0xF297, 0xF281, 0xF26A, +0xF254, 0xF23D, 0xF226, 0xF210, 0xF1F9, 0xF1E2, 0xF1CB, 0xF1B4, 0xF19D, 0xF186, 0xF16E, 0xF157, 0xF140, 0xF128, 0xF111, 0xF0F9, +0xF0E1, 0xF0CA, 0xF0B2, 0xF09A, 0xF082, 0xF06A, 0xF052, 0xF03A, 0xF022, 0xF009, 0xEFF1, 0xEFD9, 0xEFC0, 0xEFA8, 0xEF8F, 0xEF76, +0xEF5E, 0xEF45, 0xEF2C, 0xEF13, 0xEEFA, 0xEEE1, 0xEEC8, 0xEEAF, 0xEE95, 0xEE7C, 0xEE62, 0xEE49, 0xEE2F, 0xEE16, 0xEDFC, 0xEDE2, +0xEDC9, 0xEDAF, 0xED95, 0xED7B, 0xED61, 0xED47, 0xED2C, 0xED12, 0xECF8, 0xECDD, 0xECC3, 0xECA8, 0xEC8E, 0xEC73, 0xEC58, 0xEC3E, +0xEC23, 0xEC08, 0xEBED, 0xEBD2, 0xEBB7, 0xEB9B, 0xEB80, 0xEB65, 0xEB4A, 0xEB2E, 0xEB13, 0xEAF7, 0xEADB, 0xEAC0, 0xEAA4, 0xEA88, +0xEA6C, 0xEA50, 0xEA34, 0xEA18, 0xE9FC, 0xE9E0, 0xE9C3, 0xE9A7, 0xE98B, 0xE96E, 0xE952, 0xE935, 0xE918, 0xE8FC, 0xE8DF, 0xE8C2, +0xE8A5, 0xE888, 0xE86B, 0xE84E, 0xE831, 0xE814, 0xE7F6, 0xE7D9, 0xE7BC, 0xE79E, 0xE781, 0xE763, 0xE745, 0xE728, 0xE70A, 0xE6EC, +0xE6CE, 0xE6B0, 0xE692, 0xE674, 0xE656, 0xE638, 0xE619, 0xE5FB, 0xE5DD, 0xE5BE, 0xE5A0, 0xE581, 0xE562, 0xE544, 0xE525, 0xE506, +0xE4E7, 0xE4C8, 0xE4A9, 0xE48A, 0xE46B, 0xE44C, 0xE42D, 0xE40D, 0xE3EE, 0xE3CE, 0xE3AF, 0xE38F, 0xE370, 0xE350, 0xE330, 0xE310, +0xE2F1, 0xE2D1, 0xE2B1, 0xE291, 0xE271, 0xE250, 0xE230, 0xE210, 0xE1F0, 0xE1CF, 0xE1AF, 0xE18E, 0xE16E, 0xE14D, 0xE12C, 0xE10C, +0xE0EB, 0xE0CA, 0xE0A9, 0xE088, 0xE067, 0xE046, 0xE025, 0xE004, 0xDFE2, 0xDFC1, 0xDFA0, 0xDF7E, 0xDF5D, 0xDF3B, 0xDF1A, 0xDEF8, +0xDED6, 0xDEB4, 0xDE92, 0xDE71, 0xDE4F, 0xDE2D, 0xDE0B, 0xDDE8, 0xDDC6, 0xDDA4, 0xDD82, 0xDD5F, 0xDD3D, 0xDD1A, 0xDCF8, 0xDCD5, +0xDCB3, 0xDC90, 0xDC6D, 0xDC4B, 0xDC28, 0xDC05, 0xDBE2, 0xDBBF, 0xDB9C, 0xDB79, 0xDB55, 0xDB32, 0xDB0F, 0xDAEC, 0xDAC8, 0xDAA5, +0xDA81, 0xDA5E, 0xDA3A, 0xDA16, 0xD9F3, 0xD9CF, 0xD9AB, 0xD987, 0xD963, 0xD93F, 0xD91B, 0xD8F7, 0xD8D3, 0xD8AE, 0xD88A, 0xD866, +0xD842, 0xD81D, 0xD7F9, 0xD7D4, 0xD7AF, 0xD78B, 0xD766, 0xD741, 0xD71D, 0xD6F8, 0xD6D3, 0xD6AE, 0xD689, 0xD664, 0xD63F, 0xD61A, +0xD5F4, 0xD5CF, 0xD5AA, 0xD584, 0xD55F, 0xD539, 0xD514, 0xD4EE, 0xD4C9, 0xD4A3, 0xD47D, 0xD458, 0xD432, 0xD40C, 0xD3E6, 0xD3C0, +0xD39A, 0xD374, 0xD34E, 0xD327, 0xD301, 0xD2DB, 0xD2B5, 0xD28E, 0xD268, 0xD241, 0xD21B, 0xD1F4, 0xD1CE, 0xD1A7, 0xD180, 0xD159, +0xD132, 0xD10C, 0xD0E5, 0xD0BE, 0xD097, 0xD070, 0xD048, 0xD021, 0xCFFA, 0xCFD3, 0xCFAB, 0xCF84, 0xCF5D, 0xCF35, 0xCF0E, 0xCEE6, +0xCEBF, 0xCE97, 0xCE6F, 0xCE48, 0xCE20, 0xCDF8, 0xCDD0, 0xCDA8, 0xCD80, 0xCD58, 0xCD30, 0xCD08, 0xCCE0, 0xCCB7, 0xCC8F, 0xCC67, +0xCC3F, 0xCC16, 0xCBEE, 0xCBC5, 0xCB9D, 0xCB74, 0xCB4C, 0xCB23, 0xCAFA, 0xCAD1, 0xCAA9, 0xCA80, 0xCA57, 0xCA2E, 0xCA05, 0xC9DC, +0xC9B3, 0xC98A, 0xC961, 0xC937, 0xC90E, 0xC8E5, 0xC8BB, 0xC892, 0xC869, 0xC83F, 0xC816, 0xC7EC, 0xC7C2, 0xC799, 0xC76F, 0xC745, +0xC71C, 0xC6F2, 0xC6C8, 0xC69E, 0xC674, 0xC64A, 0xC620, 0xC5F6, 0xC5CC, 0xC5A2, 0xC578, 0xC54D, 0xC523, 0xC4F9, 0xC4CE, 0xC4A4, +0xC47A, 0xC44F, 0xC425, 0xC3FA, 0xC3CF, 0xC3A5, 0xC37A, 0xC34F, 0xC324, 0xC2FA, 0xC2CF, 0xC2A4, 0xC279, 0xC24E, 0xC223, 0xC1F8, +0xC1CD, 0xC1A2, 0xC177, 0xC14B, 0xC120, 0xC0F5, 0xC0C9, 0xC09E, 0xC073, 0xC047, 0xC01C, 0xBFF0, 0xBFC5, 0xBF99, 0xBF6D, 0xBF42, +0xBF16, 0xBEEA, 0xBEBE, 0xBE93, 0xBE67, 0xBE3B, 0xBE0F, 0xBDE3, 0xBDB7, 0xBD8B, 0xBD5F, 0xBD33, 0xBD07, 0xBCDA, 0xBCAE, 0xBC82, +0xBC55, 0xBC29, 0xBBFD, 0xBBD0, 0xBBA4, 0xBB77, 0xBB4B, 0xBB1E, 0xBAF2, 0xBAC5, 0xBA98, 0xBA6C, 0xBA3F, 0xBA12, 0xB9E5, 0xB9B9, +0xB98C, 0xB95F, 0xB932, 0xB905, 0xB8D8, 0xB8AB, 0xB87E, 0xB851, 0xB823, 0xB7F6, 0xB7C9, 0xB79C, 0xB76E, 0xB741, 0xB714, 0xB6E6, +0xB6B9, 0xB68B, 0xB65E, 0xB630, 0xB603, 0xB5D5, 0xB5A8, 0xB57A, 0xB54C, 0xB51F, 0xB4F1, 0xB4C3, 0xB495, 0xB467, 0xB43A, 0xB40C, +0xB3DE, 0xB3B0, 0xB382, 0xB354, 0xB326, 0xB2F8, 0xB2C9, 0xB29B, 0xB26D, 0xB23F, 0xB211, 0xB1E2, 0xB1B4, 0xB186, 0xB157, 0xB129, +0xB0FB, 0xB0CC, 0xB09E, 0xB06F, 0xB041, 0xB012, 0xAFE3, 0xAFB5, 0xAF86, 0xAF57, 0xAF29, 0xAEFA, 0xAECB, 0xAE9C, 0xAE6E, 0xAE3F, +0xAE10, 0xADE1, 0xADB2, 0xAD83, 0xAD54, 0xAD25, 0xACF6, 0xACC7, 0xAC98, 0xAC69, 0xAC3A, 0xAC0A, 0xABDB, 0xABAC, 0xAB7D, 0xAB4D, +0xAB1E, 0xAAEF, 0xAABF, 0xAA90, 0xAA61, 0xAA31, 0xAA02, 0xA9D2, 0xA9A3, 0xA973, 0xA943, 0xA914, 0xA8E4, 0xA8B5, 0xA885, 0xA855, +0xA826, 0xA7F6, 0xA7C6, 0xA796, 0xA766, 0xA737, 0xA707, 0xA6D7, 0xA6A7, 0xA677, 0xA647, 0xA617, 0xA5E7, 0xA5B7, 0xA587, 0xA557, +0xA527, 0xA4F7, 0xA4C7, 0xA497, 0xA466, 0xA436, 0xA406, 0xA3D6, 0xA3A5, 0xA375, 0xA345, 0xA314, 0xA2E4, 0xA2B4, 0xA283, 0xA253, +0xA223, 0xA1F2, 0xA1C2, 0xA191, 0xA161, 0xA130, 0xA0FF, 0xA0CF, 0xA09E, 0xA06E, 0xA03D, 0xA00C, 0x9FDC, 0x9FAB, 0x9F7A, 0x9F4A, +0x9F19, 0x9EE8, 0x9EB7, 0x9E86, 0x9E56, 0x9E25, 0x9DF4, 0x9DC3, 0x9D92, 0x9D61, 0x9D30, 0x9CFF, 0x9CCE, 0x9C9D, 0x9C6C, 0x9C3B, +0x9C0A, 0x9BD9, 0x9BA8, 0x9B77, 0x9B46, 0x9B15, 0x9AE4, 0x9AB3, 0x9A82, 0x9A50, 0x9A1F, 0x99EE, 0x99BD, 0x998B, 0x995A, 0x9929, +0x98F8, 0x98C6, 0x9895, 0x9864, 0x9832, 0x9801, 0x97D0, 0x979E, 0x976D, 0x973B, 0x970A, 0x96D8, 0x96A7, 0x9676, 0x9644, 0x9613, +0x95E1, 0x95AF, 0x957E, 0x954C, 0x951B, 0x94E9, 0x94B8, 0x9486, 0x9454, 0x9423, 0x93F1, 0x93BF, 0x938E, 0x935C, 0x932A, 0x92F9, +0x92C7, 0x9295, 0x9264, 0x9232, 0x9200, 0x91CE, 0x919C, 0x916B, 0x9139, 0x9107, 0x90D5, 0x90A3, 0x9072, 0x9040, 0x900E, 0x8FDC, +0x8FAA, 0x8F78, 0x8F46, 0x8F14, 0x8EE2, 0x8EB1, 0x8E7F, 0x8E4D, 0x8E1B, 0x8DE9, 0x8DB7, 0x8D85, 0x8D53, 0x8D21, 0x8CEF, 0x8CBD, +0x8C8B, 0x8C59, 0x8C27, 0x8BF5, 0x8BC3, 0x8B91, 0x8B5F, 0x8B2C, 0x8AFA, 0x8AC8, 0x8A96, 0x8A64, 0x8A32, 0x8A00, 0x89CE, 0x899C, +0x896A, 0x8937, 0x8905, 0x88D3, 0x88A1, 0x886F, 0x883D, 0x880A, 0x87D8, 0x87A6, 0x8774, 0x8742, 0x8710, 0x86DD, 0x86AB, 0x8679, +0x8647, 0x8615, 0x85E2, 0x85B0, 0x857E, 0x854C, 0x851A, 0x84E7, 0x84B5, 0x8483, 0x8451, 0x841E, 0x83EC, 0x83BA, 0x8388, 0x8355, +0x8323, 0x82F1, 0x82BF, 0x828C, 0x825A, 0x8228, 0x81F6, 0x81C3, 0x8191, 0x815F, 0x812D, 0x80FA, 0x80C8, 0x8096, 0x8064, 0x8031, +0x7FFF, 0x7FCD, 0x7F9A, 0x7F68, 0x7F36, 0x7F04, 0x7ED1, 0x7E9F, 0x7E6D, 0x7E3B, 0x7E08, 0x7DD6, 0x7DA4, 0x7D72, 0x7D3F, 0x7D0D, +0x7CDB, 0x7CA9, 0x7C76, 0x7C44, 0x7C12, 0x7BE0, 0x7BAD, 0x7B7B, 0x7B49, 0x7B17, 0x7AE4, 0x7AB2, 0x7A80, 0x7A4E, 0x7A1C, 0x79E9, +0x79B7, 0x7985, 0x7953, 0x7921, 0x78EE, 0x78BC, 0x788A, 0x7858, 0x7826, 0x77F4, 0x77C1, 0x778F, 0x775D, 0x772B, 0x76F9, 0x76C7, +0x7694, 0x7662, 0x7630, 0x75FE, 0x75CC, 0x759A, 0x7568, 0x7536, 0x7504, 0x74D2, 0x749F, 0x746D, 0x743B, 0x7409, 0x73D7, 0x73A5, +0x7373, 0x7341, 0x730F, 0x72DD, 0x72AB, 0x7279, 0x7247, 0x7215, 0x71E3, 0x71B1, 0x717F, 0x714D, 0x711C, 0x70EA, 0x70B8, 0x7086, +0x7054, 0x7022, 0x6FF0, 0x6FBE, 0x6F8C, 0x6F5B, 0x6F29, 0x6EF7, 0x6EC5, 0x6E93, 0x6E62, 0x6E30, 0x6DFE, 0x6DCC, 0x6D9A, 0x6D69, +0x6D37, 0x6D05, 0x6CD4, 0x6CA2, 0x6C70, 0x6C3F, 0x6C0D, 0x6BDB, 0x6BAA, 0x6B78, 0x6B46, 0x6B15, 0x6AE3, 0x6AB2, 0x6A80, 0x6A4F, +0x6A1D, 0x69EB, 0x69BA, 0x6988, 0x6957, 0x6926, 0x68F4, 0x68C3, 0x6891, 0x6860, 0x682E, 0x67FD, 0x67CC, 0x679A, 0x6769, 0x6738, +0x6706, 0x66D5, 0x66A4, 0x6673, 0x6641, 0x6610, 0x65DF, 0x65AE, 0x657C, 0x654B, 0x651A, 0x64E9, 0x64B8, 0x6487, 0x6456, 0x6425, +0x63F4, 0x63C3, 0x6392, 0x6361, 0x6330, 0x62FF, 0x62CE, 0x629D, 0x626C, 0x623B, 0x620A, 0x61D9, 0x61A8, 0x6178, 0x6147, 0x6116, +0x60E5, 0x60B4, 0x6084, 0x6053, 0x6022, 0x5FF2, 0x5FC1, 0x5F90, 0x5F60, 0x5F2F, 0x5EFF, 0x5ECE, 0x5E9D, 0x5E6D, 0x5E3C, 0x5E0C, +0x5DDB, 0x5DAB, 0x5D7B, 0x5D4A, 0x5D1A, 0x5CEA, 0x5CB9, 0x5C89, 0x5C59, 0x5C28, 0x5BF8, 0x5BC8, 0x5B98, 0x5B67, 0x5B37, 0x5B07, +0x5AD7, 0x5AA7, 0x5A77, 0x5A47, 0x5A17, 0x59E7, 0x59B7, 0x5987, 0x5957, 0x5927, 0x58F7, 0x58C7, 0x5898, 0x5868, 0x5838, 0x5808, +0x57D8, 0x57A9, 0x5779, 0x5749, 0x571A, 0x56EA, 0x56BB, 0x568B, 0x565B, 0x562C, 0x55FC, 0x55CD, 0x559D, 0x556E, 0x553F, 0x550F, +0x54E0, 0x54B1, 0x5481, 0x5452, 0x5423, 0x53F4, 0x53C4, 0x5395, 0x5366, 0x5337, 0x5308, 0x52D9, 0x52AA, 0x527B, 0x524C, 0x521D, +0x51EE, 0x51BF, 0x5190, 0x5162, 0x5133, 0x5104, 0x50D5, 0x50A7, 0x5078, 0x5049, 0x501B, 0x4FEC, 0x4FBD, 0x4F8F, 0x4F60, 0x4F32, +0x4F03, 0x4ED5, 0x4EA7, 0x4E78, 0x4E4A, 0x4E1C, 0x4DED, 0x4DBF, 0x4D91, 0x4D63, 0x4D35, 0x4D06, 0x4CD8, 0x4CAA, 0x4C7C, 0x4C4E, +0x4C20, 0x4BF2, 0x4BC4, 0x4B97, 0x4B69, 0x4B3B, 0x4B0D, 0x4ADF, 0x4AB2, 0x4A84, 0x4A56, 0x4A29, 0x49FB, 0x49CE, 0x49A0, 0x4973, +0x4945, 0x4918, 0x48EA, 0x48BD, 0x4890, 0x4862, 0x4835, 0x4808, 0x47DB, 0x47AD, 0x4780, 0x4753, 0x4726, 0x46F9, 0x46CC, 0x469F, +0x4672, 0x4645, 0x4619, 0x45EC, 0x45BF, 0x4592, 0x4566, 0x4539, 0x450C, 0x44E0, 0x44B3, 0x4487, 0x445A, 0x442E, 0x4401, 0x43D5, +0x43A9, 0x437C, 0x4350, 0x4324, 0x42F7, 0x42CB, 0x429F, 0x4273, 0x4247, 0x421B, 0x41EF, 0x41C3, 0x4197, 0x416B, 0x4140, 0x4114, +0x40E8, 0x40BC, 0x4091, 0x4065, 0x4039, 0x400E, 0x3FE2, 0x3FB7, 0x3F8B, 0x3F60, 0x3F35, 0x3F09, 0x3EDE, 0x3EB3, 0x3E87, 0x3E5C, +0x3E31, 0x3E06, 0x3DDB, 0x3DB0, 0x3D85, 0x3D5A, 0x3D2F, 0x3D04, 0x3CDA, 0x3CAF, 0x3C84, 0x3C59, 0x3C2F, 0x3C04, 0x3BD9, 0x3BAF, +0x3B84, 0x3B5A, 0x3B30, 0x3B05, 0x3ADB, 0x3AB1, 0x3A86, 0x3A5C, 0x3A32, 0x3A08, 0x39DE, 0x39B4, 0x398A, 0x3960, 0x3936, 0x390C, +0x38E2, 0x38B9, 0x388F, 0x3865, 0x383C, 0x3812, 0x37E8, 0x37BF, 0x3795, 0x376C, 0x3743, 0x3719, 0x36F0, 0x36C7, 0x369D, 0x3674, +0x364B, 0x3622, 0x35F9, 0x35D0, 0x35A7, 0x357E, 0x3555, 0x352D, 0x3504, 0x34DB, 0x34B2, 0x348A, 0x3461, 0x3439, 0x3410, 0x33E8, +0x33BF, 0x3397, 0x336F, 0x3347, 0x331E, 0x32F6, 0x32CE, 0x32A6, 0x327E, 0x3256, 0x322E, 0x3206, 0x31DE, 0x31B6, 0x318F, 0x3167, +0x313F, 0x3118, 0x30F0, 0x30C9, 0x30A1, 0x307A, 0x3052, 0x302B, 0x3004, 0x2FDD, 0x2FB6, 0x2F8E, 0x2F67, 0x2F40, 0x2F19, 0x2EF2, +0x2ECC, 0x2EA5, 0x2E7E, 0x2E57, 0x2E30, 0x2E0A, 0x2DE3, 0x2DBD, 0x2D96, 0x2D70, 0x2D49, 0x2D23, 0x2CFD, 0x2CD7, 0x2CB0, 0x2C8A, +0x2C64, 0x2C3E, 0x2C18, 0x2BF2, 0x2BCC, 0x2BA6, 0x2B81, 0x2B5B, 0x2B35, 0x2B10, 0x2AEA, 0x2AC5, 0x2A9F, 0x2A7A, 0x2A54, 0x2A2F, +0x2A0A, 0x29E4, 0x29BF, 0x299A, 0x2975, 0x2950, 0x292B, 0x2906, 0x28E1, 0x28BD, 0x2898, 0x2873, 0x284F, 0x282A, 0x2805, 0x27E1, +0x27BC, 0x2798, 0x2774, 0x2750, 0x272B, 0x2707, 0x26E3, 0x26BF, 0x269B, 0x2677, 0x2653, 0x262F, 0x260B, 0x25E8, 0x25C4, 0x25A0, +0x257D, 0x2559, 0x2536, 0x2512, 0x24EF, 0x24CC, 0x24A9, 0x2485, 0x2462, 0x243F, 0x241C, 0x23F9, 0x23D6, 0x23B3, 0x2391, 0x236E, +0x234B, 0x2329, 0x2306, 0x22E4, 0x22C1, 0x229F, 0x227C, 0x225A, 0x2238, 0x2216, 0x21F3, 0x21D1, 0x21AF, 0x218D, 0x216C, 0x214A, +0x2128, 0x2106, 0x20E4, 0x20C3, 0x20A1, 0x2080, 0x205E, 0x203D, 0x201C, 0x1FFA, 0x1FD9, 0x1FB8, 0x1F97, 0x1F76, 0x1F55, 0x1F34, +0x1F13, 0x1EF2, 0x1ED2, 0x1EB1, 0x1E90, 0x1E70, 0x1E4F, 0x1E2F, 0x1E0E, 0x1DEE, 0x1DCE, 0x1DAE, 0x1D8D, 0x1D6D, 0x1D4D, 0x1D2D, +0x1D0D, 0x1CEE, 0x1CCE, 0x1CAE, 0x1C8E, 0x1C6F, 0x1C4F, 0x1C30, 0x1C10, 0x1BF1, 0x1BD1, 0x1BB2, 0x1B93, 0x1B74, 0x1B55, 0x1B36, +0x1B17, 0x1AF8, 0x1AD9, 0x1ABA, 0x1A9C, 0x1A7D, 0x1A5E, 0x1A40, 0x1A21, 0x1A03, 0x19E5, 0x19C6, 0x19A8, 0x198A, 0x196C, 0x194E, +0x1930, 0x1912, 0x18F4, 0x18D6, 0x18B9, 0x189B, 0x187D, 0x1860, 0x1842, 0x1825, 0x1808, 0x17EA, 0x17CD, 0x17B0, 0x1793, 0x1776, +0x1759, 0x173C, 0x171F, 0x1702, 0x16E6, 0x16C9, 0x16AC, 0x1690, 0x1673, 0x1657, 0x163B, 0x161E, 0x1602, 0x15E6, 0x15CA, 0x15AE, +0x1592, 0x1576, 0x155A, 0x153E, 0x1523, 0x1507, 0x14EB, 0x14D0, 0x14B4, 0x1499, 0x147E, 0x1463, 0x1447, 0x142C, 0x1411, 0x13F6, +0x13DB, 0x13C0, 0x13A6, 0x138B, 0x1370, 0x1356, 0x133B, 0x1321, 0x1306, 0x12EC, 0x12D2, 0x12B7, 0x129D, 0x1283, 0x1269, 0x124F, +0x1235, 0x121C, 0x1202, 0x11E8, 0x11CF, 0x11B5, 0x119C, 0x1182, 0x1169, 0x114F, 0x1136, 0x111D, 0x1104, 0x10EB, 0x10D2, 0x10B9, +0x10A0, 0x1088, 0x106F, 0x1056, 0x103E, 0x1025, 0x100D, 0x0FF5, 0x0FDC, 0x0FC4, 0x0FAC, 0x0F94, 0x0F7C, 0x0F64, 0x0F4C, 0x0F34, +0x0F1D, 0x0F05, 0x0EED, 0x0ED6, 0x0EBE, 0x0EA7, 0x0E90, 0x0E78, 0x0E61, 0x0E4A, 0x0E33, 0x0E1C, 0x0E05, 0x0DEE, 0x0DD8, 0x0DC1, +0x0DAA, 0x0D94, 0x0D7D, 0x0D67, 0x0D50, 0x0D3A, 0x0D24, 0x0D0E, 0x0CF8, 0x0CE2, 0x0CCC, 0x0CB6, 0x0CA0, 0x0C8A, 0x0C75, 0x0C5F, +0x0C4A, 0x0C34, 0x0C1F, 0x0C09, 0x0BF4, 0x0BDF, 0x0BCA, 0x0BB5, 0x0BA0, 0x0B8B, 0x0B76, 0x0B61, 0x0B4D, 0x0B38, 0x0B24, 0x0B0F, +0x0AFB, 0x0AE6, 0x0AD2, 0x0ABE, 0x0AAA, 0x0A96, 0x0A82, 0x0A6E, 0x0A5A, 0x0A46, 0x0A32, 0x0A1F, 0x0A0B, 0x09F8, 0x09E4, 0x09D1, +0x09BE, 0x09AB, 0x0997, 0x0984, 0x0971, 0x095E, 0x094C, 0x0939, 0x0926, 0x0914, 0x0901, 0x08EF, 0x08DC, 0x08CA, 0x08B7, 0x08A5, +0x0893, 0x0881, 0x086F, 0x085D, 0x084B, 0x083A, 0x0828, 0x0816, 0x0805, 0x07F3, 0x07E2, 0x07D1, 0x07BF, 0x07AE, 0x079D, 0x078C, +0x077B, 0x076A, 0x0759, 0x0748, 0x0738, 0x0727, 0x0717, 0x0706, 0x06F6, 0x06E5, 0x06D5, 0x06C5, 0x06B5, 0x06A5, 0x0695, 0x0685, +0x0675, 0x0666, 0x0656, 0x0646, 0x0637, 0x0627, 0x0618, 0x0609, 0x05FA, 0x05EA, 0x05DB, 0x05CC, 0x05BD, 0x05AF, 0x05A0, 0x0591, +0x0582, 0x0574, 0x0565, 0x0557, 0x0549, 0x053A, 0x052C, 0x051E, 0x0510, 0x0502, 0x04F4, 0x04E6, 0x04D9, 0x04CB, 0x04BD, 0x04B0, +0x04A2, 0x0495, 0x0488, 0x047B, 0x046D, 0x0460, 0x0453, 0x0446, 0x043A, 0x042D, 0x0420, 0x0413, 0x0407, 0x03FA, 0x03EE, 0x03E2, +0x03D5, 0x03C9, 0x03BD, 0x03B1, 0x03A5, 0x0399, 0x038E, 0x0382, 0x0376, 0x036B, 0x035F, 0x0354, 0x0348, 0x033D, 0x0332, 0x0327, +0x031C, 0x0311, 0x0306, 0x02FB, 0x02F0, 0x02E6, 0x02DB, 0x02D0, 0x02C6, 0x02BC, 0x02B1, 0x02A7, 0x029D, 0x0293, 0x0289, 0x027F, +0x0275, 0x026B, 0x0262, 0x0258, 0x024E, 0x0245, 0x023C, 0x0232, 0x0229, 0x0220, 0x0217, 0x020E, 0x0205, 0x01FC, 0x01F3, 0x01EB, +0x01E2, 0x01D9, 0x01D1, 0x01C8, 0x01C0, 0x01B8, 0x01B0, 0x01A8, 0x01A0, 0x0198, 0x0190, 0x0188, 0x0180, 0x0179, 0x0171, 0x016A, +0x0162, 0x015B, 0x0154, 0x014C, 0x0145, 0x013E, 0x0137, 0x0130, 0x012A, 0x0123, 0x011C, 0x0116, 0x010F, 0x0109, 0x0102, 0x00FC, +0x00F6, 0x00F0, 0x00EA, 0x00E4, 0x00DE, 0x00D8, 0x00D2, 0x00CD, 0x00C7, 0x00C2, 0x00BC, 0x00B7, 0x00B2, 0x00AC, 0x00A7, 0x00A2, +0x009D, 0x0098, 0x0094, 0x008F, 0x008A, 0x0086, 0x0081, 0x007D, 0x0078, 0x0074, 0x0070, 0x006C, 0x0068, 0x0064, 0x0060, 0x005C, +0x0058, 0x0055, 0x0051, 0x004E, 0x004A, 0x0047, 0x0043, 0x0040, 0x003D, 0x003A, 0x0037, 0x0034, 0x0031, 0x002F, 0x002C, 0x0029, +0x0027, 0x0025, 0x0022, 0x0020, 0x001E, 0x001C, 0x001A, 0x0018, 0x0016, 0x0014, 0x0012, 0x0010, 0x000F, 0x000D, 0x000C, 0x000B, +0x0009, 0x0008, 0x0007, 0x0006, 0x0005, 0x0004, 0x0003, 0x0003, 0x0002, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0002, 0x0003, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, +0x0009, 0x000B, 0x000C, 0x000D, 0x000F, 0x0010, 0x0012, 0x0014, 0x0016, 0x0018, 0x001A, 0x001C, 0x001E, 0x0020, 0x0022, 0x0025, +0x0027, 0x0029, 0x002C, 0x002F, 0x0031, 0x0034, 0x0037, 0x003A, 0x003D, 0x0040, 0x0043, 0x0047, 0x004A, 0x004E, 0x0051, 0x0055, +0x0058, 0x005C, 0x0060, 0x0064, 0x0068, 0x006C, 0x0070, 0x0074, 0x0078, 0x007D, 0x0081, 0x0086, 0x008A, 0x008F, 0x0094, 0x0098, +0x009D, 0x00A2, 0x00A7, 0x00AC, 0x00B2, 0x00B7, 0x00BC, 0x00C2, 0x00C7, 0x00CD, 0x00D2, 0x00D8, 0x00DE, 0x00E4, 0x00EA, 0x00F0, +0x00F6, 0x00FC, 0x0102, 0x0109, 0x010F, 0x0116, 0x011C, 0x0123, 0x012A, 0x0130, 0x0137, 0x013E, 0x0145, 0x014C, 0x0154, 0x015B, +0x0162, 0x016A, 0x0171, 0x0179, 0x0180, 0x0188, 0x0190, 0x0198, 0x01A0, 0x01A8, 0x01B0, 0x01B8, 0x01C0, 0x01C8, 0x01D1, 0x01D9, +0x01E2, 0x01EB, 0x01F3, 0x01FC, 0x0205, 0x020E, 0x0217, 0x0220, 0x0229, 0x0232, 0x023C, 0x0245, 0x024E, 0x0258, 0x0262, 0x026B, +0x0275, 0x027F, 0x0289, 0x0293, 0x029D, 0x02A7, 0x02B1, 0x02BC, 0x02C6, 0x02D0, 0x02DB, 0x02E6, 0x02F0, 0x02FB, 0x0306, 0x0311, +0x031C, 0x0327, 0x0332, 0x033D, 0x0348, 0x0354, 0x035F, 0x036B, 0x0376, 0x0382, 0x038E, 0x0399, 0x03A5, 0x03B1, 0x03BD, 0x03C9, +0x03D6, 0x03E2, 0x03EE, 0x03FA, 0x0407, 0x0414, 0x0420, 0x042D, 0x043A, 0x0446, 0x0453, 0x0460, 0x046D, 0x047B, 0x0488, 0x0495, +0x04A2, 0x04B0, 0x04BD, 0x04CB, 0x04D9, 0x04E6, 0x04F4, 0x0502, 0x0510, 0x051E, 0x052C, 0x053A, 0x0549, 0x0557, 0x0565, 0x0574, +0x0582, 0x0591, 0x05A0, 0x05AF, 0x05BD, 0x05CC, 0x05DB, 0x05EA, 0x05FA, 0x0609, 0x0618, 0x0627, 0x0637, 0x0646, 0x0656, 0x0666, +0x0675, 0x0685, 0x0695, 0x06A5, 0x06B5, 0x06C5, 0x06D5, 0x06E5, 0x06F6, 0x0706, 0x0717, 0x0727, 0x0738, 0x0748, 0x0759, 0x076A, +0x077B, 0x078C, 0x079D, 0x07AE, 0x07BF, 0x07D1, 0x07E2, 0x07F3, 0x0805, 0x0816, 0x0828, 0x083A, 0x084B, 0x085D, 0x086F, 0x0881, +0x0893, 0x08A5, 0x08B7, 0x08CA, 0x08DC, 0x08EF, 0x0901, 0x0914, 0x0926, 0x0939, 0x094C, 0x095E, 0x0971, 0x0984, 0x0997, 0x09AB, +0x09BE, 0x09D1, 0x09E4, 0x09F8, 0x0A0B, 0x0A1F, 0x0A32, 0x0A46, 0x0A5A, 0x0A6E, 0x0A82, 0x0A96, 0x0AAA, 0x0ABE, 0x0AD2, 0x0AE6, +0x0AFB, 0x0B0F, 0x0B24, 0x0B38, 0x0B4D, 0x0B61, 0x0B76, 0x0B8B, 0x0BA0, 0x0BB5, 0x0BCA, 0x0BDF, 0x0BF4, 0x0C09, 0x0C1F, 0x0C34, +0x0C4A, 0x0C5F, 0x0C75, 0x0C8A, 0x0CA0, 0x0CB6, 0x0CCC, 0x0CE2, 0x0CF8, 0x0D0E, 0x0D24, 0x0D3A, 0x0D50, 0x0D67, 0x0D7D, 0x0D94, +0x0DAA, 0x0DC1, 0x0DD8, 0x0DEE, 0x0E05, 0x0E1C, 0x0E33, 0x0E4A, 0x0E61, 0x0E78, 0x0E90, 0x0EA7, 0x0EBE, 0x0ED6, 0x0EED, 0x0F05, +0x0F1D, 0x0F34, 0x0F4C, 0x0F64, 0x0F7C, 0x0F94, 0x0FAC, 0x0FC4, 0x0FDC, 0x0FF5, 0x100D, 0x1025, 0x103E, 0x1056, 0x106F, 0x1088, +0x10A0, 0x10B9, 0x10D2, 0x10EB, 0x1104, 0x111D, 0x1136, 0x114F, 0x1169, 0x1182, 0x119C, 0x11B5, 0x11CF, 0x11E8, 0x1202, 0x121C, +0x1235, 0x124F, 0x1269, 0x1283, 0x129D, 0x12B7, 0x12D2, 0x12EC, 0x1306, 0x1321, 0x133B, 0x1356, 0x1370, 0x138B, 0x13A6, 0x13C0, +0x13DB, 0x13F6, 0x1411, 0x142C, 0x1447, 0x1463, 0x147E, 0x1499, 0x14B4, 0x14D0, 0x14EB, 0x1507, 0x1523, 0x153E, 0x155A, 0x1576, +0x1592, 0x15AE, 0x15CA, 0x15E6, 0x1602, 0x161E, 0x163B, 0x1657, 0x1673, 0x1690, 0x16AC, 0x16C9, 0x16E6, 0x1702, 0x171F, 0x173C, +0x1759, 0x1776, 0x1793, 0x17B0, 0x17CD, 0x17EA, 0x1808, 0x1825, 0x1842, 0x1860, 0x187D, 0x189B, 0x18B9, 0x18D6, 0x18F4, 0x1912, +0x1930, 0x194E, 0x196C, 0x198A, 0x19A8, 0x19C6, 0x19E5, 0x1A03, 0x1A21, 0x1A40, 0x1A5E, 0x1A7D, 0x1A9C, 0x1ABA, 0x1AD9, 0x1AF8, +0x1B17, 0x1B36, 0x1B55, 0x1B74, 0x1B93, 0x1BB2, 0x1BD1, 0x1BF1, 0x1C10, 0x1C30, 0x1C4F, 0x1C6F, 0x1C8E, 0x1CAE, 0x1CCE, 0x1CEE, +0x1D0D, 0x1D2D, 0x1D4D, 0x1D6D, 0x1D8D, 0x1DAE, 0x1DCE, 0x1DEE, 0x1E0E, 0x1E2F, 0x1E4F, 0x1E70, 0x1E90, 0x1EB1, 0x1ED2, 0x1EF2, +0x1F13, 0x1F34, 0x1F55, 0x1F76, 0x1F97, 0x1FB8, 0x1FD9, 0x1FFA, 0x201C, 0x203D, 0x205E, 0x2080, 0x20A1, 0x20C3, 0x20E4, 0x2106, +0x2128, 0x214A, 0x216C, 0x218D, 0x21AF, 0x21D1, 0x21F3, 0x2216, 0x2238, 0x225A, 0x227C, 0x229F, 0x22C1, 0x22E4, 0x2306, 0x2329, +0x234B, 0x236E, 0x2391, 0x23B3, 0x23D6, 0x23F9, 0x241C, 0x243F, 0x2462, 0x2485, 0x24A9, 0x24CC, 0x24EF, 0x2513, 0x2536, 0x2559, +0x257D, 0x25A0, 0x25C4, 0x25E8, 0x260B, 0x262F, 0x2653, 0x2677, 0x269B, 0x26BF, 0x26E3, 0x2707, 0x272B, 0x2750, 0x2774, 0x2798, +0x27BC, 0x27E1, 0x2805, 0x282A, 0x284F, 0x2873, 0x2898, 0x28BD, 0x28E1, 0x2906, 0x292B, 0x2950, 0x2975, 0x299A, 0x29BF, 0x29E4, +0x2A0A, 0x2A2F, 0x2A54, 0x2A7A, 0x2A9F, 0x2AC5, 0x2AEA, 0x2B10, 0x2B35, 0x2B5B, 0x2B81, 0x2BA6, 0x2BCC, 0x2BF2, 0x2C18, 0x2C3E, +0x2C64, 0x2C8A, 0x2CB0, 0x2CD7, 0x2CFD, 0x2D23, 0x2D49, 0x2D70, 0x2D96, 0x2DBD, 0x2DE3, 0x2E0A, 0x2E30, 0x2E57, 0x2E7E, 0x2EA5, +0x2ECC, 0x2EF2, 0x2F19, 0x2F40, 0x2F67, 0x2F8E, 0x2FB6, 0x2FDD, 0x3004, 0x302B, 0x3053, 0x307A, 0x30A1, 0x30C9, 0x30F0, 0x3118, +0x313F, 0x3167, 0x318F, 0x31B6, 0x31DE, 0x3206, 0x322E, 0x3256, 0x327E, 0x32A6, 0x32CE, 0x32F6, 0x331E, 0x3347, 0x336F, 0x3397, +0x33BF, 0x33E8, 0x3410, 0x3439, 0x3461, 0x348A, 0x34B2, 0x34DB, 0x3504, 0x352D, 0x3555, 0x357E, 0x35A7, 0x35D0, 0x35F9, 0x3622, +0x364B, 0x3674, 0x369D, 0x36C7, 0x36F0, 0x3719, 0x3743, 0x376C, 0x3795, 0x37BF, 0x37E8, 0x3812, 0x383C, 0x3865, 0x388F, 0x38B9, +0x38E2, 0x390C, 0x3936, 0x3960, 0x398A, 0x39B4, 0x39DE, 0x3A08, 0x3A32, 0x3A5C, 0x3A86, 0x3AB1, 0x3ADB, 0x3B05, 0x3B30, 0x3B5A, +0x3B84, 0x3BAF, 0x3BD9, 0x3C04, 0x3C2F, 0x3C59, 0x3C84, 0x3CAF, 0x3CDA, 0x3D04, 0x3D2F, 0x3D5A, 0x3D85, 0x3DB0, 0x3DDB, 0x3E06, +0x3E31, 0x3E5C, 0x3E87, 0x3EB3, 0x3EDE, 0x3F09, 0x3F35, 0x3F60, 0x3F8B, 0x3FB7, 0x3FE2, 0x400E, 0x4039, 0x4065, 0x4091, 0x40BC, +0x40E8, 0x4114, 0x4140, 0x416B, 0x4197, 0x41C3, 0x41EF, 0x421B, 0x4247, 0x4273, 0x429F, 0x42CB, 0x42F7, 0x4324, 0x4350, 0x437C, +0x43A9, 0x43D5, 0x4401, 0x442E, 0x445A, 0x4487, 0x44B3, 0x44E0, 0x450C, 0x4539, 0x4566, 0x4592, 0x45BF, 0x45EC, 0x4619, 0x4645, +0x4672, 0x469F, 0x46CC, 0x46F9, 0x4726, 0x4753, 0x4780, 0x47AD, 0x47DB, 0x4808, 0x4835, 0x4862, 0x4890, 0x48BD, 0x48EA, 0x4918, +0x4945, 0x4973, 0x49A0, 0x49CE, 0x49FB, 0x4A29, 0x4A56, 0x4A84, 0x4AB2, 0x4ADF, 0x4B0D, 0x4B3B, 0x4B69, 0x4B97, 0x4BC4, 0x4BF2, +0x4C20, 0x4C4E, 0x4C7C, 0x4CAA, 0x4CD8, 0x4D06, 0x4D35, 0x4D63, 0x4D91, 0x4DBF, 0x4DED, 0x4E1C, 0x4E4A, 0x4E78, 0x4EA7, 0x4ED5, +0x4F03, 0x4F32, 0x4F60, 0x4F8F, 0x4FBD, 0x4FEC, 0x501B, 0x5049, 0x5078, 0x50A7, 0x50D5, 0x5104, 0x5133, 0x5162, 0x5190, 0x51BF, +0x51EE, 0x521D, 0x524C, 0x527B, 0x52AA, 0x52D9, 0x5308, 0x5337, 0x5366, 0x5395, 0x53C4, 0x53F4, 0x5423, 0x5452, 0x5481, 0x54B1, +0x54E0, 0x550F, 0x553F, 0x556E, 0x559D, 0x55CD, 0x55FC, 0x562C, 0x565B, 0x568B, 0x56BB, 0x56EA, 0x571A, 0x5749, 0x5779, 0x57A9, +0x57D8, 0x5808, 0x5838, 0x5868, 0x5898, 0x58C7, 0x58F7, 0x5927, 0x5957, 0x5987, 0x59B7, 0x59E7, 0x5A17, 0x5A47, 0x5A77, 0x5AA7, +0x5AD7, 0x5B07, 0x5B37, 0x5B68, 0x5B98, 0x5BC8, 0x5BF8, 0x5C28, 0x5C59, 0x5C89, 0x5CB9, 0x5CEA, 0x5D1A, 0x5D4A, 0x5D7B, 0x5DAB, +0x5DDC, 0x5E0C, 0x5E3C, 0x5E6D, 0x5E9D, 0x5ECE, 0x5EFF, 0x5F2F, 0x5F60, 0x5F90, 0x5FC1, 0x5FF2, 0x6022, 0x6053, 0x6084, 0x60B4, +0x60E5, 0x6116, 0x6147, 0x6178, 0x61A8, 0x61D9, 0x620A, 0x623B, 0x626C, 0x629D, 0x62CE, 0x62FF, 0x6330, 0x6361, 0x6392, 0x63C3, +0x63F4, 0x6425, 0x6456, 0x6487, 0x64B8, 0x64E9, 0x651A, 0x654B, 0x657C, 0x65AE, 0x65DF, 0x6610, 0x6641, 0x6673, 0x66A4, 0x66D5, +0x6706, 0x6738, 0x6769, 0x679A, 0x67CC, 0x67FD, 0x682E, 0x6860, 0x6891, 0x68C3, 0x68F4, 0x6926, 0x6957, 0x6988, 0x69BA, 0x69EB, +0x6A1D, 0x6A4F, 0x6A80, 0x6AB2, 0x6AE3, 0x6B15, 0x6B46, 0x6B78, 0x6BAA, 0x6BDB, 0x6C0D, 0x6C3F, 0x6C70, 0x6CA2, 0x6CD4, 0x6D05, +0x6D37, 0x6D69, 0x6D9A, 0x6DCC, 0x6DFE, 0x6E30, 0x6E62, 0x6E93, 0x6EC5, 0x6EF7, 0x6F29, 0x6F5B, 0x6F8C, 0x6FBE, 0x6FF0, 0x7022, +0x7054, 0x7086, 0x70B8, 0x70EA, 0x711C, 0x714D, 0x717F, 0x71B1, 0x71E3, 0x7215, 0x7247, 0x7279, 0x72AB, 0x72DD, 0x730F, 0x7341, +0x7373, 0x73A5, 0x73D7, 0x7409, 0x743B, 0x746D, 0x74A0, 0x74D2, 0x7504, 0x7536, 0x7568, 0x759A, 0x75CC, 0x75FE, 0x7630, 0x7662, +0x7694, 0x76C7, 0x76F9, 0x772B, 0x775D, 0x778F, 0x77C1, 0x77F4, 0x7826, 0x7858, 0x788A, 0x78BC, 0x78EE, 0x7921, 0x7953, 0x7985, +0x79B7, 0x79E9, 0x7A1C, 0x7A4E, 0x7A80, 0x7AB2, 0x7AE4, 0x7B17, 0x7B49, 0x7B7B, 0x7BAD, 0x7BE0, 0x7C12, 0x7C44, 0x7C76, 0x7CA9, +0x7CDB, 0x7D0D, 0x7D3F, 0x7D72, 0x7DA4, 0x7DD6, 0x7E08, 0x7E3B, 0x7E6D, 0x7E9F, 0x7ED1, 0x7F04, 0x7F36, 0x7F68, 0x7F9A, 0x7FCD \ No newline at end of file diff --git a/FrictionWaveTable.inc b/FrictionWaveTable.inc new file mode 100644 index 0000000..1321771 --- /dev/null +++ b/FrictionWaveTable.inc @@ -0,0 +1,272 @@ + // sine + 0x80,0x83,0x86,0x89,0x8c,0x8f,0x92,0x95,0x98,0x9c,0x9f,0xa2,0xa5,0xa8,0xab,0xae, + 0xb0,0xb3,0xb6,0xb9,0xbc,0xbf,0xc1,0xc4,0xc7,0xc9,0xcc,0xce,0xd1,0xd3,0xd5,0xd8, + 0xda,0xdc,0xde,0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xed,0xef,0xf0,0xf2,0xf3,0xf5, + 0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfc,0xfd,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfd,0xfc,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7, + 0xf6,0xf5,0xf3,0xf2,0xf0,0xef,0xed,0xec,0xea,0xe8,0xe6,0xe4,0xe2,0xe0,0xde,0xdc, + 0xda,0xd8,0xd5,0xd3,0xd1,0xce,0xcc,0xc9,0xc7,0xc4,0xc1,0xbf,0xbc,0xb9,0xb6,0xb3, + 0xb0,0xae,0xab,0xa8,0xa5,0xa2,0x9f,0x9c,0x98,0x95,0x92,0x8f,0x8c,0x89,0x86,0x83, + 0x80,0x7c,0x79,0x76,0x73,0x70,0x6d,0x6a,0x67,0x63,0x60,0x5d,0x5a,0x57,0x54,0x51, + 0x4f,0x4c,0x49,0x46,0x43,0x40,0x3e,0x3b,0x38,0x36,0x33,0x31,0x2e,0x2c,0x2a,0x27, + 0x25,0x23,0x21,0x1f,0x1d,0x1b,0x19,0x17,0x15,0x13,0x12,0x10,0x0f,0x0d,0x0c,0x0a, + 0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x03,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x03,0x03,0x04,0x05,0x06,0x07,0x08, + 0x09,0x0a,0x0c,0x0d,0x0f,0x10,0x12,0x13,0x15,0x17,0x19,0x1b,0x1d,0x1f,0x21,0x23, + 0x25,0x27,0x2a,0x2c,0x2e,0x31,0x33,0x36,0x38,0x3b,0x3e,0x40,0x43,0x46,0x49,0x4c, + 0x4f,0x51,0x54,0x57,0x5a,0x5d,0x60,0x63,0x67,0x6a,0x6d,0x70,0x73,0x76,0x79,0x7c, + // square + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + // pulse + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + //triangle + 0x00,0x02,0x04,0x06,0x08,0x0a,0x0c,0x0e,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e, + 0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38,0x3a,0x3c,0x3e, + 0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4e,0x50,0x52,0x54,0x56,0x58,0x5a,0x5c,0x5e, + 0x60,0x62,0x64,0x66,0x68,0x6a,0x6c,0x6e,0x70,0x72,0x74,0x76,0x78,0x7a,0x7c,0x7e, + 0x80,0x82,0x84,0x86,0x88,0x8a,0x8c,0x8e,0x90,0x92,0x94,0x96,0x98,0x9a,0x9c,0x9e, + 0xa0,0xa2,0xa4,0xa6,0xa8,0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xb8,0xba,0xbc,0xbe, + 0xc0,0xc2,0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xd0,0xd2,0xd4,0xd6,0xd8,0xda,0xdc,0xde, + 0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xee,0xf0,0xf2,0xf4,0xf6,0xf8,0xfa,0xfc,0xfe, + 0xff,0xfd,0xfb,0xf9,0xf7,0xf5,0xf3,0xf1,0xef,0xed,0xeb,0xe9,0xe7,0xe5,0xe3,0xe1, + 0xdf,0xdd,0xdb,0xd9,0xd7,0xd5,0xd3,0xd1,0xcf,0xcd,0xcb,0xc9,0xc7,0xc5,0xc3,0xc1, + 0xbf,0xbd,0xbb,0xb9,0xb7,0xb5,0xb3,0xb1,0xaf,0xad,0xab,0xa9,0xa7,0xa5,0xa3,0xa1, + 0x9f,0x9d,0x9b,0x99,0x97,0x95,0x93,0x91,0x8f,0x8d,0x8b,0x89,0x87,0x85,0x83,0x81, + 0x7f,0x7d,0x7b,0x79,0x77,0x75,0x73,0x71,0x6f,0x6d,0x6b,0x69,0x67,0x65,0x63,0x61, + 0x5f,0x5d,0x5b,0x59,0x57,0x55,0x53,0x51,0x4f,0x4d,0x4b,0x49,0x47,0x45,0x43,0x41, + 0x3f,0x3d,0x3b,0x39,0x37,0x35,0x33,0x31,0x2f,0x2d,0x2b,0x29,0x27,0x25,0x23,0x21, + 0x1f,0x1d,0x1b,0x19,0x17,0x15,0x13,0x11,0x0f,0x0d,0x0b,0x09,0x07,0x05,0x03,0x01, + // sawtooth + 0xff,0xfe,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7,0xf6,0xf5,0xf4,0xf3,0xf2,0xf1,0xf0, + 0xef,0xee,0xed,0xec,0xeb,0xea,0xe9,0xe8,0xe7,0xe6,0xe5,0xe4,0xe3,0xe2,0xe1,0xe0, + 0xdf,0xde,0xdd,0xdc,0xdb,0xda,0xd9,0xd8,0xd7,0xd6,0xd5,0xd4,0xd3,0xd2,0xd1,0xd0, + 0xcf,0xce,0xcd,0xcc,0xcb,0xca,0xc9,0xc8,0xc7,0xc6,0xc5,0xc4,0xc3,0xc2,0xc1,0xc0, + 0xbf,0xbe,0xbd,0xbc,0xbb,0xba,0xb9,0xb8,0xb7,0xb6,0xb5,0xb4,0xb3,0xb2,0xb1,0xb0, + 0xaf,0xae,0xad,0xac,0xab,0xaa,0xa9,0xa8,0xa7,0xa6,0xa5,0xa4,0xa3,0xa2,0xa1,0xa0, + 0x9f,0x9e,0x9d,0x9c,0x9b,0x9a,0x99,0x98,0x97,0x96,0x95,0x94,0x93,0x92,0x91,0x90, + 0x8f,0x8e,0x8d,0x8c,0x8b,0x8a,0x89,0x88,0x87,0x86,0x85,0x84,0x83,0x82,0x81,0x80, + 0x7f,0x7e,0x7d,0x7c,0x7b,0x7a,0x79,0x78,0x77,0x76,0x75,0x74,0x73,0x72,0x71,0x70, + 0x6f,0x6e,0x6d,0x6c,0x6b,0x6a,0x69,0x68,0x67,0x66,0x65,0x64,0x63,0x62,0x61,0x60, + 0x5f,0x5e,0x5d,0x5c,0x5b,0x5a,0x59,0x58,0x57,0x56,0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86, + 0x77,0x67,0x58,0x4a,0x3d,0x31,0x26,0x1d,0x16,0x10,0x0c,0x0a,0x09,0x09,0x0a,0x0d, + 0x0f,0x13,0x16,0x1a,0x1d,0x20,0x22,0x24,0x25,0x25,0x25,0x24,0x22,0x21,0x1f,0x1c, + 0x1a,0x18,0x16,0x15,0x14,0x13,0x13,0x13,0x14,0x15,0x17,0x18,0x1a,0x1c,0x1e,0x1f, + 0x20,0x21,0x21,0x21,0x21,0x20,0x1f,0x1e,0x1c,0x1b,0x19,0x18,0x16,0x15,0x15,0x14, + 0x15,0x15,0x16,0x17,0x18,0x1a,0x1b,0x1d,0x1e,0x20,0x21,0x21,0x21,0x21,0x21,0x20, + 0x1e,0x1d,0x1b,0x19,0x18,0x16,0x15,0x14,0x13,0x13,0x13,0x14,0x16,0x17,0x19,0x1b, + 0x1e,0x20,0x22,0x23,0x24,0x25,0x25,0x24,0x23,0x21,0x1e,0x1b,0x18,0x15,0x11,0x0e, + 0x0b,0x09,0x09,0x09,0x0b,0x0e,0x13,0x19,0x21,0x2b,0x37,0x43,0x51,0x60,0x6f,0x7f, + // digiwave + 0x00,0x18,0x31,0x47,0x5c,0x6f,0x7e,0x8b,0x94,0x9b,0x9f,0xa1,0xa1,0x9f,0x9d,0x9a, + 0x98,0x96,0x94,0x93,0x93,0x94,0x95,0x97,0x98,0x9a,0x9b,0x9b,0x9b,0x99,0x97,0x94, + 0x90,0x8c,0x87,0x82,0x7e,0x7a,0x77,0x74,0x72,0x71,0x70,0x70,0x71,0x71,0x72,0x72, + 0x73,0x73,0x73,0x72,0x72,0x71,0x70,0x70,0x6f,0x70,0x70,0x72,0x74,0x76,0x79,0x7c, + 0x7f,0x82,0x85,0x87,0x89,0x8a,0x8a,0x89,0x88,0x87,0x85,0x82,0x80,0x7d,0x7b,0x78, + 0x76,0x74,0x72,0x70,0x6e,0x6b,0x67,0x63,0x5e,0x58,0x51,0x4a,0x42,0x39,0x30,0x28, + 0x1f,0x17,0x10,0x09,0x03,0x01,0x05,0x09,0x0d,0x10,0x14,0x19,0x1e,0x24,0x2b,0x32, + 0x3a,0x43,0x4b,0x53,0x5a,0x5f,0x62,0x63,0x61,0x5c,0x54,0x4a,0x3c,0x2d,0x1b,0x09, + 0x09,0x1b,0x2d,0x3c,0x4a,0x54,0x5c,0x61,0x63,0x62,0x5f,0x5a,0x53,0x4b,0x43,0x3a, + 0x32,0x2b,0x24,0x1e,0x19,0x14,0x10,0x0d,0x09,0x05,0x01,0x03,0x09,0x10,0x17,0x1f, + 0x28,0x30,0x39,0x42,0x4a,0x51,0x58,0x5e,0x63,0x67,0x6b,0x6e,0x70,0x72,0x74,0x76, + 0x78,0x7b,0x7d,0x80,0x82,0x85,0x87,0x88,0x89,0x8a,0x8a,0x89,0x87,0x85,0x82,0x7f, + 0x7c,0x79,0x76,0x74,0x72,0x70,0x70,0x6f,0x70,0x70,0x71,0x72,0x72,0x73,0x73,0x73, + 0x72,0x72,0x71,0x71,0x70,0x70,0x71,0x72,0x74,0x77,0x7a,0x7e,0x82,0x87,0x8c,0x90, + 0x94,0x97,0x99,0x9b,0x9b,0x9b,0x9a,0x98,0x97,0x95,0x94,0x93,0x93,0x94,0x96,0x98, + 0x9a,0x9d,0x9f,0xa1,0xa1,0x9f,0x9b,0x94,0x8b,0x7e,0x6f,0x5c,0x47,0x31,0x18,0x00, + // digiwave2 + 0x00,0x17,0x2e,0x45,0x5a,0x6e,0x80,0x90,0x9e,0xaa,0xb4,0xbb,0xc0,0xc4,0xc6,0xc6, + 0xc5,0xc3,0xc0,0xbc,0xb8,0xb4,0xb1,0xad,0xaa,0xa7,0xa4,0xa2,0xa0,0x9e,0x9c,0x9b, + 0x99,0x96,0x94,0x90,0x8c,0x88,0x83,0x7d,0x76,0x6f,0x68,0x61,0x59,0x51,0x4a,0x42, + 0x3c,0x36,0x30,0x2b,0x27,0x23,0x20,0x1e,0x1d,0x1b,0x1b,0x1a,0x1a,0x1a,0x1a,0x1a, + 0x1a,0x1a,0x1a,0x1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x2d,0x26,0x21,0x20,0x21,0x25,0x2b, + 0x33,0x3b,0x45,0x4f,0x59,0x62,0x6a,0x71,0x76,0x79,0x7a,0x79,0x77,0x72,0x6c,0x65, + 0x5d,0x54,0x4b,0x43,0x3b,0x34,0x2f,0x2b,0x28,0x27,0x28,0x2b,0x2f,0x34,0x3a,0x41, + 0x48,0x4f,0x55,0x5b,0x5f,0x62,0x63,0x63,0x60,0x5c,0x57,0x50,0x47,0x3e,0x34,0x2a, + 0x21,0x17,0x0f,0x08,0x03,0x00,0x01,0x01,0x00,0x04,0x09,0x10,0x17,0x1f,0x27,0x2e, + 0x34,0x38,0x3a,0x3a,0x37,0x32,0x29,0x1d,0x0f,0x01,0x14,0x29,0x40,0x57,0x6d,0x83, + 0x98,0xaa,0xba,0xc6,0xce,0xd2,0xd1,0xcc,0xc1,0xb3,0x9f,0x88,0x6d,0x50,0x31,0x10, + 0x10,0x31,0x50,0x6d,0x88,0x9f,0xb3,0xc1,0xcc,0xd1,0xd2,0xce,0xc6,0xba,0xaa,0x98, + 0x83,0x6d,0x57,0x40,0x29,0x14,0x01,0x0f,0x1d,0x29,0x32,0x37,0x3a,0x3a,0x38,0x34, + 0x2e,0x27,0x1f,0x17,0x10,0x09,0x04,0x00,0x01,0x01,0x00,0x03,0x08,0x0f,0x17,0x21, + 0x2a,0x34,0x3e,0x47,0x50,0x57,0x5c,0x60,0x63,0x63,0x62,0x5f,0x5b,0x55,0x4f,0x48, + 0x41,0x3a,0x34,0x2f,0x2b,0x28,0x27,0x28,0x2b,0x2f,0x34,0x3b,0x43,0x4b,0x54,0x5d, + 0x65,0x6c,0x72,0x77,0x79,0x7a,0x79,0x76,0x71,0x6a,0x62,0x59,0x4f,0x45,0x3b,0x33, + 0x2b,0x25,0x21,0x20,0x21,0x26,0x2d,0x37,0x44,0x53,0x65,0x77,0x8b,0x9f,0xb2,0xc4, + 0xd5,0xe2,0xed,0xf4,0xf7,0xf5,0xee,0xe3,0xd3,0xbe,0xa6,0x89,0x6a,0x48,0x24,0x00, + // digiwave4 + 0x7e,0x66,0x31,0x3f,0x39,0x8d,0x9c,0x4b,0xae,0x25,0x03,0xa8,0xae,0x41,0x17,0x27, + 0x06,0x4e,0x94,0xc8,0xe4,0xeb,0xe1,0xcb,0xb0,0x92,0x74,0x59,0x41,0x2d,0x1d,0x10, + 0x08,0x02,0x00,0x01,0x00,0x02,0x06,0x0a,0x10,0x15,0x1b,0x21,0x26,0x2c,0x31,0x36, + 0x3a,0x3e,0x42,0x45,0x47,0x4a,0x4b,0x4d,0x4d,0x4e,0x4e,0x4d,0x4c,0x4b,0x4a,0x48, + 0x46,0x44,0x41,0x3f,0x3c,0x39,0x36,0x33,0x30,0x2c,0x29,0x26,0x23,0x1f,0x1c,0x19, + 0x16,0x13,0x11,0x0e,0x0c,0x09,0x07,0x05,0x04,0x02,0x01,0x00,0x00,0x00,0x01,0x01, + 0x00,0x00,0x00,0x01,0x02,0x04,0x06,0x08,0x0a,0x0d,0x10,0x13,0x16,0x1a,0x1d,0x21, + 0x26,0x2a,0x2f,0x34,0x38,0x3e,0x43,0x48,0x4e,0x53,0x59,0x5f,0x64,0x6a,0x70,0x76, + 0x7c,0x82,0x88,0x8d,0x93,0x99,0x9e,0xa4,0xa9,0xae,0xb4,0xb9,0xbd,0xc2,0xc6,0xca, + 0xce,0xd2,0xd6,0xd9,0xdc,0xdf,0xe1,0xe4,0xe5,0xe7,0xe8,0xea,0xea,0xeb,0xeb,0xeb, + 0xea,0xea,0xe8,0xe7,0xe5,0xe3,0xe1,0xdf,0xdc,0xd9,0xd5,0xd1,0xce,0xc9,0xc5,0xc0, + 0xbb,0xb6,0xb1,0xac,0xa6,0xa0,0x9a,0x94,0x8e,0x88,0x81,0x7b,0x74,0x6e,0x67,0x60, + 0x5a,0x53,0x4d,0x46,0x40,0x39,0x33,0x2d,0x27,0x21,0x1b,0x15,0x10,0x0a,0x05,0x00, + 0x03,0x08,0x0c,0x10,0x14,0x17,0x1b,0x1d,0x20,0x22,0x24,0x26,0x28,0x29,0x29,0x2a, + 0x2a,0x2a,0x2a,0x29,0x28,0x27,0x25,0x23,0x21,0x1e,0x1b,0x18,0x15,0x12,0x0e,0x0a, + 0x06,0x01,0x03,0x07,0x0c,0x12,0x17,0x1c,0x22,0x28,0x2d,0x33,0x39,0x3f,0x45,0x4b, + // digiwave5 + 0x00,0x00,0x00,0x01,0x06,0x0e,0x1e,0x39,0x5f,0x93,0xcd,0xf9,0xeb,0x6d,0x76,0xfd, + 0x19,0xfd,0x75,0x43,0x91,0x79,0x1c,0xf2,0x1b,0xbc,0xc0,0x1d,0xfc,0xb0,0xda,0xb9, + 0xfd,0xeb,0x6b,0x3a,0xfa,0xca,0xe9,0xfd,0x53,0x60,0xfc,0xd2,0xf6,0x80,0xfd,0xf8, + 0xfa,0x76,0xbf,0x97,0xed,0x01,0xf2,0x71,0xef,0x33,0x48,0x1d,0xbf,0x5d,0x82,0x7c, + 0x38,0x81,0x34,0xbd,0xa2,0x7a,0x85,0xc2,0x92,0x0d,0xd1,0xe9,0x40,0x62,0x94,0x3c, + 0xca,0x16,0x0b,0xfd,0xf7,0x3d,0x0f,0xa0,0xc0,0xfa,0xd0,0xb3,0x9a,0x5a,0x4a,0xfd, + 0x6a,0x53,0xfc,0xc9,0xe3,0xef,0xb0,0xe8,0x78,0x26,0x1b,0x80,0xf7,0x54,0xe6,0xb5, + 0xcb,0xe8,0x1f,0xf0,0xfd,0xfd,0xf2,0xda,0xe6,0xf5,0x41,0x2a,0xba,0x5f,0xee,0x83, + 0x71,0x9e,0xc5,0xba,0x2b,0xf8,0xcb,0xe8,0xfc,0x54,0xfa,0xe4,0x8e,0x1f,0xf8,0x4c, + 0x66,0xe5,0xc0,0xfd,0x2a,0xfd,0x1e,0xfd,0xd2,0xf6,0x16,0x36,0x84,0xe3,0xaa,0x86, + 0xcd,0xfa,0xfb,0x4b,0xa5,0x27,0xd3,0xb6,0x60,0xda,0xae,0xbb,0xd1,0x0e,0xfd,0x3d, + 0xe8,0x0e,0x59,0x9b,0x41,0xe7,0x04,0xca,0xdd,0xab,0x6f,0xfd,0xfd,0xa7,0x83,0xf8, + 0x91,0xad,0xc8,0xb4,0xfd,0x3f,0xdf,0xe8,0xe2,0xb3,0xc8,0xec,0x4c,0xf7,0x4b,0x30, + 0xfc,0xfd,0xa4,0x66,0xf9,0xfa,0xd0,0xf9,0x70,0x40,0xc4,0xee,0xa7,0xc9,0x21,0xee, + 0xb7,0x8a,0x64,0x19,0xe6,0x23,0xe3,0xbe,0xde,0xe2,0x39,0xae,0xfb,0xb1,0xca,0xb3, + 0x99,0x4e,0xde,0xd2,0xd7,0xf4,0x6d,0xd5,0x9c,0x47,0x23,0xfd,0x8f,0x10,0xa2,0xc5, + // digiwave6 + 0x00,0x29,0x51,0x77,0x99,0xb7,0xcf,0xe1,0xed,0xf2,0xf0,0xe9,0xdc,0xca,0xb4,0x9b, + 0x81,0x65,0x4a,0x30,0x19,0x04,0x0c,0x19,0x23,0x28,0x29,0x27,0x22,0x1b,0x12,0x08, + 0x01,0x0a,0x12,0x19,0x1d,0x1f,0x1e,0x1b,0x16,0x0e,0x05,0x05,0x10,0x1b,0x26,0x2f, + 0x37,0x3d,0x41,0x43,0x42,0x3f,0x3b,0x34,0x2d,0x25,0x1c,0x14,0x0d,0x07,0x03,0x00, + 0x00,0x01,0x05,0x0a,0x11,0x18,0x21,0x29,0x31,0x38,0x3d,0x41,0x43,0x42,0x3f,0x3a, + 0x33,0x2a,0x20,0x15,0x0a,0x00,0x09,0x12,0x19,0x1d,0x1f,0x1e,0x1b,0x16,0x0e,0x06, + 0x03,0x0d,0x17,0x1f,0x25,0x29,0x29,0x26,0x1f,0x13,0x04,0x0e,0x24,0x3d,0x58,0x73, + 0x8e,0xa8,0xbf,0xd3,0xe3,0xed,0xf2,0xf0,0xe8,0xd9,0xc4,0xa9,0x89,0x65,0x3e,0x14, + 0x14,0x3e,0x65,0x89,0xa9,0xc4,0xd9,0xe8,0xf0,0xf2,0xed,0xe3,0xd3,0xbf,0xa8,0x8e, + 0x73,0x58,0x3d,0x24,0x0e,0x04,0x13,0x1f,0x26,0x29,0x29,0x25,0x1f,0x17,0x0d,0x03, + 0x06,0x0e,0x16,0x1b,0x1e,0x1f,0x1d,0x19,0x12,0x09,0x00,0x0a,0x15,0x20,0x2a,0x33, + 0x3a,0x3f,0x42,0x43,0x41,0x3d,0x38,0x31,0x29,0x21,0x18,0x11,0x0a,0x05,0x01,0x00, + 0x00,0x03,0x07,0x0d,0x14,0x1c,0x25,0x2d,0x34,0x3b,0x3f,0x42,0x43,0x41,0x3d,0x37, + 0x2f,0x26,0x1b,0x10,0x05,0x05,0x0e,0x16,0x1b,0x1e,0x1f,0x1d,0x19,0x12,0x0a,0x01, + 0x08,0x12,0x1b,0x22,0x27,0x29,0x28,0x23,0x19,0x0c,0x04,0x19,0x30,0x4a,0x65,0x81, + 0x9b,0xb4,0xca,0xdc,0xe9,0xf0,0xf2,0xed,0xe1,0xcf,0xb7,0x99,0x77,0x51,0x29,0x00, + // tanwave + 0x00,0x0c,0x19,0x25,0x32,0x3e,0x4b,0x57,0x64,0x70,0x7d,0x89,0x95,0xa2,0xae,0xb9, + 0xc5,0xd0,0xda,0xe2,0xe8,0xeb,0xe8,0xde,0xc6,0x9d,0x5e,0x14,0x0a,0xd2,0x02,0x09, + 0xeb,0xdc,0x89,0x69,0xfa,0xcf,0x82,0x44,0x1b,0x02,0x0b,0x12,0x15,0x15,0x14,0x12, + 0x10,0x0e,0x0b,0x09,0x07,0x06,0x04,0x03,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x03,0x05,0x06,0x08,0x0a,0x0d,0x0f, + 0x11,0x13,0x15,0x15,0x14,0x0f,0x05,0x0d,0x2d,0x60,0xa8,0xf0,0xd3,0x00,0x8b,0x11, + 0x2d,0xe7,0xe3,0x54,0x01,0x38,0x80,0xb4,0xd4,0xe4,0xea,0xea,0xe5,0xde,0xd5,0xca, + 0xbf,0xb4,0xa8,0x9b,0x8f,0x83,0x76,0x6a,0x5d,0x51,0x44,0x38,0x2b,0x1f,0x12,0x06, + 0x06,0x12,0x1f,0x2b,0x38,0x44,0x51,0x5d,0x6a,0x76,0x83,0x8f,0x9b,0xa8,0xb4,0xbf, + 0xca,0xd5,0xde,0xe5,0xea,0xea,0xe4,0xd4,0xb4,0x80,0x38,0x01,0x54,0xe3,0xe7,0x2d, + 0x11,0x8b,0x00,0xd3,0xf0,0xa8,0x60,0x2d,0x0d,0x05,0x0f,0x14,0x15,0x15,0x13,0x11, + 0x0f,0x0d,0x0a,0x08,0x06,0x05,0x03,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x06,0x07,0x09,0x0b,0x0e,0x10, + 0x12,0x14,0x15,0x15,0x12,0x0b,0x02,0x1b,0x44,0x82,0xcf,0xfa,0x69,0x89,0xdc,0xeb, + 0x09,0x02,0xd2,0x0a,0x14,0x5e,0x9d,0xc6,0xde,0xe8,0xeb,0xe8,0xe2,0xda,0xd0,0xc5, + 0xb9,0xae,0xa2,0x95,0x89,0x7d,0x70,0x64,0x57,0x4b,0x3e,0x32,0x25,0x19,0x0c,0x00, + // tanwave2 + 0x00,0x12,0x25,0x38,0x4c,0x5f,0x74,0x88,0x9c,0xae,0xba,0xba,0x98,0x30,0x20,0x26, + 0xc6,0x69,0xe0,0x6f,0x10,0x0d,0x0e,0x03,0x0b,0x1c,0x2c,0x3c,0x4b,0x59,0x66,0x73, + 0x80,0x8c,0x99,0xa5,0xb1,0xbd,0xca,0xd6,0xe1,0xeb,0xee,0xe2,0xb1,0x37,0x0b,0x4f, + 0xaa,0x10,0xcd,0x42,0x1a,0x3b,0x43,0x3f,0x38,0x30,0x27,0x20,0x18,0x11,0x0b,0x04, + 0x01,0x07,0x0e,0x15,0x1c,0x23,0x2c,0x34,0x3c,0x42,0x41,0x30,0x09,0x8e,0x7a,0x12, + 0xc8,0xdc,0x11,0x7e,0xd0,0xeb,0xee,0xe7,0xdc,0xd0,0xc3,0xb7,0xab,0x9f,0x93,0x86, + 0x7a,0x6d,0x60,0x52,0x43,0x34,0x24,0x14,0x04,0x09,0x0f,0x03,0x35,0xb9,0x4c,0xba, + 0x1d,0xa7,0x18,0x6f,0xaf,0xbd,0xb5,0xa5,0x92,0x7e,0x69,0x56,0x42,0x2f,0x1c,0x09, + 0x09,0x1c,0x2f,0x42,0x56,0x69,0x7e,0x92,0xa5,0xb5,0xbd,0xaf,0x6f,0x18,0xa7,0x1d, + 0xba,0x4c,0xb9,0x35,0x03,0x0f,0x09,0x04,0x14,0x24,0x34,0x43,0x52,0x60,0x6d,0x7a, + 0x86,0x93,0x9f,0xab,0xb7,0xc3,0xd0,0xdc,0xe7,0xee,0xeb,0xd0,0x7e,0x11,0xdc,0xc8, + 0x12,0x7a,0x8e,0x09,0x30,0x41,0x42,0x3c,0x34,0x2c,0x23,0x1c,0x15,0x0e,0x07,0x01, + 0x04,0x0b,0x11,0x18,0x20,0x27,0x30,0x38,0x3f,0x43,0x3b,0x1a,0x42,0xcd,0x10,0xaa, + 0x4f,0x0b,0x37,0xb1,0xe2,0xee,0xeb,0xe1,0xd6,0xca,0xbd,0xb1,0xa5,0x99,0x8c,0x80, + 0x73,0x66,0x59,0x4b,0x3c,0x2c,0x1c,0x0b,0x03,0x0e,0x0d,0x10,0x6f,0xe0,0x69,0xc6, + 0x26,0x20,0x30,0x98,0xba,0xba,0xae,0x9c,0x88,0x74,0x5f,0x4c,0x38,0x25,0x12,0x00, + //tanwave3 + 0x00,0x0f,0x1f,0x2f,0x3f,0x50,0x61,0x73,0x84,0x93,0x9d,0x9a,0x76,0x0c,0x46,0x4e, + 0x9d,0x3f,0xb4,0x42,0x1d,0x3b,0x3c,0x32,0x22,0x12,0x01,0x0f,0x1f,0x2e,0x3d,0x4c, + 0x5b,0x6a,0x79,0x88,0x97,0xa7,0xb7,0xc7,0xd6,0xe4,0xec,0xe4,0xb8,0x43,0x1c,0x66, + 0xc7,0x11,0xf5,0x70,0x19,0x01,0x02,0x07,0x14,0x23,0x32,0x40,0x4e,0x5b,0x68,0x75, + 0x82,0x8e,0x9b,0xa7,0xb4,0xc2,0xd0,0xdd,0xea,0xf5,0xf9,0xed,0xb7,0x36,0x4e,0xdf, + 0x07,0x09,0xe7,0x59,0x09,0x0f,0x10,0x08,0x02,0x0f,0x1b,0x27,0x33,0x3e,0x48,0x53, + 0x5d,0x67,0x72,0x7d,0x88,0x93,0x9f,0xaa,0xb5,0xbe,0xbe,0xac,0x6d,0x1d,0x49,0x2b, + 0xa5,0x28,0x90,0x00,0x47,0x5d,0x5e,0x57,0x4d,0x41,0x36,0x2c,0x21,0x17,0x0e,0x04, + 0x04,0x0e,0x17,0x21,0x2c,0x36,0x41,0x4d,0x57,0x5e,0x5d,0x47,0x00,0x90,0x28,0xa5, + 0x2b,0x49,0x1d,0x6d,0xac,0xbe,0xbe,0xb5,0xaa,0x9f,0x93,0x88,0x7d,0x72,0x67,0x5d, + 0x53,0x48,0x3e,0x33,0x27,0x1b,0x0f,0x02,0x08,0x10,0x0f,0x09,0x59,0xe7,0x09,0x07, + 0xdf,0x4e,0x36,0xb7,0xed,0xf9,0xf5,0xea,0xdd,0xd0,0xc2,0xb4,0xa7,0x9b,0x8e,0x82, + 0x75,0x68,0x5b,0x4e,0x40,0x32,0x23,0x14,0x07,0x02,0x01,0x19,0x70,0xf5,0x11,0xc7, + 0x66,0x1c,0x43,0xb8,0xe4,0xec,0xe4,0xd6,0xc7,0xb7,0xa7,0x97,0x88,0x79,0x6a,0x5b, + 0x4c,0x3d,0x2e,0x1f,0x0f,0x01,0x12,0x22,0x32,0x3c,0x3b,0x1d,0x42,0xb4,0x3f,0x9c, + 0x4e,0x46,0x0c,0x76,0x9a,0x9d,0x93,0x84,0x73,0x61,0x50,0x3f,0x2f,0x1f,0x0f,0x00, + //tanwave4 + 0x7f,0x81,0x84,0x86,0x88,0x8a,0x8b,0x8c,0x8d,0x8c,0x8c,0x8a,0x88,0x85,0x81,0x7b, + 0x74,0x6c,0x61,0x54,0x43,0x30,0x19,0x00,0x1a,0x2f,0x30,0x03,0x89,0xb2,0x3b,0x28, + 0x9b,0xb1,0x20,0xdd,0x74,0x06,0x18,0x0c,0x0f,0x2e,0x4c,0x66,0x7d,0x90,0xa1,0xaf, + 0xbc,0xc6,0xcf,0xd7,0xde,0xe4,0xe9,0xed,0xf1,0xf4,0xf7,0xf9,0xfb,0xfc,0xfd,0xfd, + 0xfd,0xfd,0xfd,0xfb,0xfa,0xf8,0xf6,0xf3,0xef,0xeb,0xe7,0xe1,0xdb,0xd3,0xcb,0xc1, + 0xb6,0xa8,0x99,0x87,0x72,0x59,0x3d,0x1f,0x00,0x15,0x10,0x31,0xbe,0x74,0xdb,0x9b, + 0x08,0x0f,0x07,0xca,0x3d,0x1f,0x34,0x26,0x0d,0x0d,0x25,0x3a,0x4c,0x5b,0x66,0x70, + 0x78,0x7e,0x83,0x86,0x89,0x8b,0x8c,0x8d,0x8c,0x8c,0x8b,0x89,0x88,0x85,0x83,0x80, + 0x7d,0x79,0x76,0x72,0x6d,0x68,0x63,0x5e,0x58,0x51,0x4a,0x42,0x39,0x30,0x25,0x19, + 0x0c,0x03,0x14,0x29,0x40,0x5a,0x78,0x98,0xb6,0xc9,0xb9,0x62,0x26,0xa1,0x9e,0xba, + 0x1b,0x20,0x4a,0x04,0x95,0xdb,0xe3,0xd1,0xb6,0x9b,0x82,0x6c,0x5a,0x4b,0x3e,0x33, + 0x2a,0x23,0x1c,0x17,0x12,0x0e,0x0b,0x08,0x06,0x04,0x03,0x02,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x01,0x02,0x04,0x05,0x07,0x0a,0x0d,0x10,0x14,0x19,0x1f,0x26,0x2e, + 0x38,0x44,0x52,0x63,0x77,0x8e,0xa8,0xc4,0xdc,0xe4,0xc2,0x50,0x1c,0xdc,0x06,0x17, + 0x87,0x6f,0x0b,0x18,0x99,0xc7,0xc2,0xa8,0x88,0x69,0x4d,0x34,0x1e,0x0b,0x04,0x13, + 0x1f,0x2b,0x35,0x3e,0x46,0x4e,0x55,0x5b,0x61,0x66,0x6b,0x6f,0x74,0x78,0x7b,0x7f diff --git a/HaarnetPresets.h b/HaarnetPresets.h new file mode 100644 index 0000000..9044ebb --- /dev/null +++ b/HaarnetPresets.h @@ -0,0 +1,120 @@ +// Presets for CFO HÃ¥rnet +// +// Presets are ordered in three Banks of 16 presets in each +// +// Just copy arrays into below. Each line most be 128 byte. + + + +//////////// +// BANK A // +//////////// + +// Preset 0 +16, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 64, 64, 127, 1, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 46, 0, 64, +// Preset 1 +17, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 64, 64, 127, 1, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 127, 0, 64, +// Preset 15 +31, 15, 0, 0, 127, 1, 127, 0, 49, 0, 0, 79, 64, 127, 4, 0, 0, 0, 0, 0, 0, 71, 64, 127, 4, 0, 0, 0, 0, 0, 0, 76, 64, 127, 4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 127, 0, 64, + + +//////////// +// BANK B // +//////////// + +// Preset 0 +16, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 64, 64, 127, 1, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 46, 0, 64, +// Preset 1 +17, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 64, 64, 127, 1, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 127, 0, 64, +// Preset 15 +31, 15, 0, 0, 127, 1, 127, 0, 49, 0, 0, 79, 64, 127, 4, 0, 0, 0, 0, 0, 0, 71, 64, 127, 4, 0, 0, 0, 0, 0, 0, 76, 64, 127, 4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 127, 0, 64, + + +//////////// +// BANK C // +//////////// + +// Preset 0 +16, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 64, 64, 127, 1, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 64, 64, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 46, 0, 64, +// Preset 1 +17, 1,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 0, 67, 64, 127, 4, 0, 0, 0, 0, 0, 0, 71, 64, 127, 4, 0, 0, 0, 0, 0, 0, 76, 64, 127, 4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 127, 0, 64, +// Preset 15 +31, 15, 0, 0, 127, 1, 127, 0, 49, 0, 0, 79, 64, 127, 4, 0, 0, 0, 0, 0, 0, 71, 64, 127, 4, 0, 0, 0, 0, 0, 0, 76, 64, 127, 4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 64, 127, 64, 0, 0, 0, 0, 0, 1, 0, 127, 0, 64, diff --git a/Mcp4251.cpp b/Mcp4251.cpp new file mode 100644 index 0000000..1b0cacd --- /dev/null +++ b/Mcp4251.cpp @@ -0,0 +1,218 @@ + +// MCP4251 2-channel Digital Potentiometer +// ww1.microchip.com/downloads/en/DeviceDoc/22059b.pdf + +// The default SPI Control Register - SPCR = B01010000; +// interrupt disabled,spi enabled,msb 1st,master,clk low when idle, +// sample on leading edge of clk,system clock/4 rate (fastest). +// Enable the digital pins 11-13 for SPI (the MOSI,MISO,SPICLK) +#include + +//---------- constructor ---------------------------------------------------- + +MCP4251::MCP4251(uint8_t slave_select_pin, float rAB_ohms) +{ + setup_ss(slave_select_pin); + setup_resistance(rAB_ohms, 0.0); //rW_ohms_typical); +} + +MCP4251::MCP4251(uint8_t slave_select_pin, float rAB_ohms, float rW_ohms) +{ + setup_ss(slave_select_pin); + setup_resistance(rAB_ohms, rW_ohms); +} + +//------------------ protected ----------------------------------------------- + +uint16_t MCP4251::byte2uint16(byte high_byte, byte low_byte) +{ + return (uint16_t)high_byte<<8 | (uint16_t)low_byte; +} + +byte MCP4251::uint16_high_byte(uint16_t uint16) +{ + return (byte)(uint16>>8); +} + +byte MCP4251::uint16_low_byte(uint16_t uint16) +{ + return (byte)(uint16 & 0x00FF); +} + +void MCP4251::setup_ss(uint8_t slave_select_pin) +{ + // Set slave select (Chip Select) pin for SPI Bus, and start high (disabled) + ::pinMode(slave_select_pin,OUTPUT); + ::digitalWrite(slave_select_pin,HIGH); + this->slave_select_pin = slave_select_pin; +} + +void MCP4251::setup_resistance(float rAB_ohms, float rW_ohms) +{ + this->rAB_ohms = rAB_ohms; + this->rW_ohms = rW_ohms; + this->rAW_ohms_max = rAB_ohms - rW_ohms; + this->scale = rAW_ohms_max; +} + +float MCP4251::step_increment() +{ + return (rAW_ohms_max - rW_ohms) / resolution; +} + +unsigned int MCP4251::ohms2wiper_pos(float ohms) +{ + if(ohms <= 0.0) + return 0; + else if(scale != rAW_ohms_max) + ohms = ohms * rAW_ohms_max / scale; + + return (unsigned int)((ohms - rW_ohms) / step_increment() ) + 0.5; +} + +float MCP4251::wiper_pos2ohms(unsigned int wiper_pos) +{ + float ohms = rW_ohms + ( (float)wiper_pos * step_increment() ); + + if(scale != rAW_ohms_max) + ohms = ohms * scale / rAW_ohms_max; + + return ohms; +} + +void MCP4251::write(byte cmd_byte, byte data_byte) +{ + cmd_byte |= kCMD_WRITE; + ::digitalWriteFast(slave_select_pin, LOW); +// byte high_byte = spi4teensy3::send(cmd_byte); +// byte low_byte = spi4teensy3::send(data_byte); + spi4teensy3::send(cmd_byte); + spi4teensy3::send(data_byte); + ::digitalWriteFast(slave_select_pin, HIGH); + //bool result = ~low_byte; +} + +uint16_t MCP4251::read(byte cmd_byte) +{ + cmd_byte |= kCMD_READ; + ::digitalWrite(slave_select_pin, LOW); +// byte high_byte = spi4teensy3::receive(cmd_byte); +// byte low_byte = spi4teensy3::receive(0xFF); + spi4teensy3::send(cmd_byte); + spi4teensy3::send(0xFF); + ::digitalWrite(slave_select_pin, HIGH); +// return byte2uint16(high_byte, low_byte); +} + +void MCP4251::wiper_pos(byte pot, unsigned int wiper_pos) +{ + byte cmd_byte = 0x00; + byte data_byte = 0x00; + cmd_byte |= pot; + + // Calculate the 9-bit data value to send + if(wiper_pos > 255) + cmd_byte |= B00000001; // Table 5-1 (page 36) + else + data_byte = (byte)(wiper_pos & 0x00FF); + + write(cmd_byte|kADR_VOLATILE, data_byte); + + if(non_volatile) + { + // EEPROM write cycles take 4ms each. So we block with delay(5); after any NV Writes + write(cmd_byte|kADR_NON_VOLATILE, data_byte); + delay(5); + } +} + +//---------- public ---------------------------------------------------- + +float MCP4251::wiper0() +{ + return wiper_pos2ohms( wiper0_pos() ); +} + +float MCP4251::wiper1() +{ + return wiper_pos2ohms( wiper1_pos() ); +} + +unsigned int MCP4251::wiper0_pos() +{ + return (unsigned int)( 0x01FF & this->read(kADR_WIPER0|kADR_VOLATILE) ); +} + +unsigned int MCP4251::wiper1_pos() +{ + return 0x01FF & this->read(kADR_WIPER1|kADR_VOLATILE); +} + +void MCP4251::wiper0(float ohms) +{ + wiper0_pos( ohms2wiper_pos(ohms) ); +} + +void MCP4251::wiper1(float ohms) +{ + wiper1_pos( ohms2wiper_pos(ohms) ); +} + +void MCP4251::wiper0_pos(unsigned int wiper_pos) +{ + this->wiper_pos(kADR_WIPER0, wiper_pos); +} + +void MCP4251::wiper1_pos(unsigned int wiper_pos) +{ + this->wiper_pos(kADR_WIPER1, wiper_pos); +} + + +// // Not implemented +// bool MCP4251::pot0_connected(bool terminal_a, bool wiper, bool terminal_b) +// { +// +// } +// +// bool MCP4251::pot1_connected(bool terminal_a, bool wiper, bool terminal_b) +// { +// +// } +// +// void MCP4251::pot0_connect(bool terminal_a, bool wiper, bool terminal_b) +// { +// +// } +// +// void MCP4251::pot1_connect(bool terminal_a, bool wiper, bool terminal_b) +// { +// +// } +// +// bool MCP4251::pot0_shutdown() +// { +// +// } +// +// bool MCP4251::pot1_shutdown() +// { +// +// } +// +// void MCP4251::pot0_shutdown(bool shutdown) +// { +// +// } +// +// void MCP4251::pot1_shutdown(bool shutdown) +// { +// +// } +// +// bool MCP4251::hw_shutdown() +// { +// +// } + + diff --git a/Mcp4251.h b/Mcp4251.h new file mode 100644 index 0000000..88ab266 --- /dev/null +++ b/Mcp4251.h @@ -0,0 +1,99 @@ + +// MCP4251 2-channel Digital Potentiometer +// ww1.microchip.com/downloads/en/DeviceDoc/22059b.pdf + +#include +#include + +#ifndef Mcp4251_h +#define Mcp4251_h + +class MCP4251 +{ + public: + // You must at least specify the slave select pin and the rated resistance + MCP4251(uint8_t slave_select, float rAB_ohms); + + // If you have measured wiper resistance, rW + MCP4251(uint8_t slave_select, float rAB_ohms, float rW_ohms); + + // The resistance scaling, defaults to rAB_ohms + float scale; + + // Read potentiometer values + float wiper0(); + float wiper1(); + unsigned int wiper0_pos(); + unsigned int wiper1_pos(); + + // Write potentiometer values + void wiper0(float ohms); + void wiper1(float ohms); + + void wiper0_pos(unsigned int wiper_pos); + void wiper1_pos(unsigned int wiper_pos); + + // // Not implemented + // // Connect / disconnect potentiometers + // bool pot0_connected(bool terminal_a, bool wiper, bool terminal_b); + // bool pot1_connected(bool terminal_a, bool wiper, bool terminal_b); + // void pot0_connect(bool terminal_a, bool wiper, bool terminal_b); + // void pot1_connect(bool terminal_a, bool wiper, bool terminal_b); + // + // bool pot0_shutdown(); + // bool pot1_shutdown(); + // void pot0_shutdown(bool shutdown); + // void pot1_shutdown(bool shutdown); + // + // bool hw_shutdown(); + + protected: +// const static float rW_ohms_typical = 117.50f; + const static unsigned int resolution_7bit = 128; + const static unsigned int resolution_8bit = 256; + + // Other devices can be configured below vv as per the device numbering scheme: + // MCP4N-- N=1 single pot, N=2 dual pot + // MCP4--N N=1 potentiometer, N=2 rheostat + // MCP4-N- N=3 7-bit volatile, N=4 7-bit non-volatile, N=5 8-bit volatile, N=6 8-bit non-volatile + const static bool non_volatile = false; + const static unsigned int resolution = resolution_8bit; + + float rW_ohms; + float rAB_ohms; + float rAW_ohms_max; + + uint8_t slave_select_pin; + + const static uint8_t kADR_WIPER0 = B00000000; + const static uint8_t kADR_WIPER1 = B00010000; + + const static uint8_t kCMD_READ = B00001100; + const static uint8_t kCMD_WRITE = B00000000; + + const static uint8_t kADR_VOLATILE = B00000000; + const static uint8_t kADR_NON_VOLATILE = B00100000; + + const static uint8_t kTCON_REGISTER = B01000000; + const static uint8_t kSTATUS_REGISTER = B01010000; + + uint16_t byte2uint16(byte high_byte, byte low_byte); + byte uint16_high_byte(uint16_t uint16); + byte uint16_low_byte(uint16_t uint16); + + void setup_ss(uint8_t slave_select_pin); + void setup_resistance(float rAB_ohms, float rW_ohms); + + float step_increment(); + unsigned int ohms2wiper_pos(float ohms); + float wiper_pos2ohms(unsigned int wiper_pos); + + uint16_t read(byte cmd_byte); + void write(byte cmd_byte, byte data_byte); + void wiper_pos(byte pot, unsigned int wiper_pos); +}; + +#endif // Mcp4251_h + + + diff --git a/Sampler.cpp b/Sampler.cpp new file mode 100644 index 0000000..6f8cb90 --- /dev/null +++ b/Sampler.cpp @@ -0,0 +1,46 @@ +/* + Sampler.cpp - Friction Music library + Copyright (c) 2014 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: gauthiier + + contact: d@gauthiier.info + */ + +#include "Sampler.h" +#include + + +Sampler::Sampler(int len) { + _samples = (int*)malloc(len * 2); + _len = len; + memset(_samples, 0, len * 2); +} + +void Sampler::record(int in) { + _samples[_indx++] = in; + if(_indx > _len) _indx = 0; +} + +int Sampler::next() { + if(_indx > _len) _indx = 0; + return _samples[_indx++]; +} + +void Sampler::reset() { + _indx = 0; +} \ No newline at end of file diff --git a/Sampler.h b/Sampler.h new file mode 100644 index 0000000..b553a71 --- /dev/null +++ b/Sampler.h @@ -0,0 +1,39 @@ +/* + Sampler.h - Friction Music library + Copyright (c) 2014 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: gauthiier + + contact: d@gauthiier.info + */ + +#pragma once + + +class Sampler { + +public: + Sampler(int len); + + void record(int in); + int next(); + void reset(); + + int* _samples; + int _indx; + int _len; +}; diff --git a/Sequencer.cpp b/Sequencer.cpp new file mode 100644 index 0000000..0e8c7ce --- /dev/null +++ b/Sequencer.cpp @@ -0,0 +1,336 @@ +/* + Haarnet.h - Friction Music library + Copyright (c) 2014 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: gauthiier + + contact: d@gauthiier.info + */ + +#include "Sequencer.h" +#include +#include + +MSequencer Sequencer; +iSequencer iSeq; // instrument sequencer +//extern iSeq; +//int iSeq0,iSeq1; +//iSeq.iSeqInit(120); + +IntervalTimer sequencerTimer; +IntervalTimer iSeqTimer; + +boolean sequencerTimerRunning = false; +boolean iSeqTimerRunning = false; + +#ifndef SAMPLE_RATE +unsigned int sampleRate = 48000; +#endif + +void sequencer_isr(void) +{ + Sequencer.clockStep++; +} + +void iSeq_isr(void) +{ + iSeq.clockStep++; +} + + +void MSequencer::init(int bpm) +{ + setbpm(bpm); + for(int i = 0; i < MAX_SEQ; i++) { + _sequences[i] = NULL; + } + if(!sequencerTimerRunning) { + sequencerTimerRunning = true; + clockStep = 0; + sequencerTimer.begin(sequencer_isr, 60 * 1000000 / (_bpm * TICKS_PER_QUARTER_NOTE)); + } +} + + +void iSequencer::init(int bpm) +{ + for(int i = 0; i < ISEQ_NBR_STEPS; i++) { + // _notes[i] = i; + // _velocity[i] = 127; + // _CCnumbers[i] = 100; + // _CCvalues[i] = 0; + } + + + +// +// int iSeq_indx0 = 0; +// int iSeq_indx1 = 0; +//#define ISEQ_NBR_STEPS 32 +// const int iSeq_nbr_notes = 32; +// const int iSeq_nbr_steps = 32; +// +// int iSeq_notes[ISEQ_NBR_STEPS]; +// int iSeq_velocity[ISEQ_NBR_STEPS]; +// int iSeq_midi_numbers[ISEQ_NBR_STEPS]; +// int iSeq_midi_values[ISEQ_NBR_STEPS]; +// +// void iSeqNote() { +// // Music.noteOn(iSeq_notes[iSeq_indx0++] + Music.notePlayed, Music.velocityPlayed); +// // if(iSeq_indx0 >= iSeq_nbr_notes) iSeq_indx0 = 0; +// } +// +// void iSeqController() { +// // Midi.controller(MIDI_CHANNEL - 1, iSeq_midi_numbers[iSeq_indx1], iSeq_midi_values[iSeq_indx1]); +// // iSeq_indx1++; +// // if(iSeq_indx1 >= iSeq_nbr_steps) iSeq_indx1 = 0; +// } +// +// for(int i = 0; i < ISEQ_NBR_STEPS; i++) { +// // iSeq_notes[i] = i; +// // iSeq_velocity[i] = 127; +// // iSeq_midi_numbers[i] = 100; +// // iSeq_midi_values[i] = 0; +// } + + setbpm(bpm); + for(int i = 0; i < INSTR_SEQ; i++) { + _sequences[i] = NULL; + } + if(!iSeqTimerRunning) { + iSeqTimerRunning = true; + clockStep = 0; + iSeqTimer.begin(iSeq_isr, 60 * 1000000 / (_bpm * TICKS_PER_QUARTER_NOTE)); + } +} + + + +void MSequencer::update() +{ + for(int i = 0; i < MAX_SEQ; i++) { + seq* s = _sequences[i]; + if(s == NULL || s->_stopped) continue; + if(clockStep >= s -> step) { + //boom! + s->_callback(); // add to queue??? + s->step += s -> _subdiv; +// Serial.println(s -> step); + } + } + // queue goes here +} + + +void iSequencer::update() +{ + for(int i = 0; i < INSTR_SEQ; i++) { + iseq* s = _sequences[i]; + if(s == NULL || s->_stopped) continue; + if(clockStep >= s -> step) { + //boom! +// s->_callback(); // add to queue??? + s->step += s -> _subdiv; +// Serial.println(s -> step); + } + } + // queue goes here +} + + +int MSequencer::newSequence(func_cb cb, SUBDIV subdiv) +{ + int j = -1; + for(int i = 0; i < MAX_SEQ; i++) { + if(_sequences[i] == NULL) j = i; + } + + if(j >= 0) { + seq* s = new seq(j, cb, subdiv); + _sequences[j] = s; + Serial.print("Created sequence "); + Serial.println(j); + } + + return j; +} + + +int iSequencer::newSequence(SUBDIV subdiv, int steps, SEQ_LOOP_TYPE loop) +{ + int j = -1; + for(int i = 0; i < MAX_SEQ; i++) { + if(_sequences[i] == NULL) j = i; + } + + if(j >= 0) { + iseq* s = new iseq(j, subdiv, steps, loop); + _sequences[j] = s; + Serial.print("Created sequence "); + Serial.println(j); + } + + return j; +} + + +bool MSequencer::stopSequence(int index) +{ + if(index >= 0 && index < MAX_SEQ) { + _sequences[index]->_stopped = true; +// _sequences[index]-> step = 0; + return true; + } + return false; +} + +bool MSequencer::startSequence(int index) +{ + if(index >= 0 && index < MAX_SEQ && _sequences[index] != NULL) { + _sequences[index]->_stopped = false; + _sequences[index]-> step = 0; + return true; + } + return false; +} + + +void MSequencer::setbpm(int bpm) +{ + _bpm = bpm; + _bpmInClockSteps = _bpm * 24; +} + +int MSequencer::getbpm() +{ + return _bpm; +} + +void iSequencer::setbpm(int bpm) +{ + _bpm = bpm; + _bpmInClockSteps = _bpm * 24; +} + +int iSequencer::getbpm() +{ + return _bpm; +} + +bool MSequencer::setSequenceSubdiv(int index, SUBDIV subdiv) +{ + if(index >= 0 && index < MAX_SEQ && _sequences[index] != NULL) { + _sequences[index]->setsubdiv(subdiv); + return true; + } + return false; +} + +int MSequencer::getSequenceSubdiv(int index) +{ + if(index >= 0 && index < MAX_SEQ && _sequences[index] != NULL) { + return _sequences[index]->getsubdiv(); + } + return -1; +} + +bool MSequencer::setCallback(int index, func_cb cb) +{ + if(index >= 0 && index < MAX_SEQ && _sequences[index] != NULL) { + _sequences[index]->callback(cb); + return true; + } + return false; +} + +func_cb MSequencer::getCallback(int index) +{ + if(index >= 0 && index < MAX_SEQ && _sequences[index] != NULL) { + return _sequences[index]->_callback; + } + return NULL; +} + + +// seq + +seq::seq(int id, func_cb cb, SUBDIV subdiv) : _id(id), _stopped(true) +{ + setsubdiv(subdiv); + callback(cb); +} + +void seq::setsubdiv(SUBDIV v) +{ + _subdiv = v; + +} + +SUBDIV seq::getsubdiv() +{ + return _subdiv; +} + +void seq::callback(func_cb cb) +{ + _callback = cb; +} + +// iseq + +iseq::iseq(int id, SUBDIV subdiv, int steps, SEQ_LOOP_TYPE loop) : _id(id), _stopped(true) +{ + setsubdiv(subdiv); + setsteps(steps); + setlooptype(loop); +} + +void iseq::setsteps(int steps) +{ + _steps = steps; + +} + +int iseq::getsteps() +{ + return _steps; + +} + +void iseq::setsubdiv(SUBDIV v) +{ + _subdiv = v; + +} + +SUBDIV iseq::getsubdiv() +{ + return _subdiv; +} + +void iseq::setlooptype(SEQ_LOOP_TYPE loop) +{ + _loop = loop; +} + +SEQ_LOOP_TYPE iseq::getlooptype() +{ + return _loop; +} + + + diff --git a/Sequencer.h b/Sequencer.h new file mode 100644 index 0000000..9d1d507 --- /dev/null +++ b/Sequencer.h @@ -0,0 +1,203 @@ +/* + Sequencer.h - Friction Music library + Copyright (c) 2014 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: gauthiier + + contact: d@gauthiier.info + */ + +#pragma once + +#define MAX_SEQ 3 +#define INSTR_SEQ 4 +#define ISEQ_NBR_STEPS 32 + + +#define TICKS_PER_QUARTER_NOTE 96 // + +enum SUBDIV { + NOTE_1 = (TICKS_PER_QUARTER_NOTE * 4), + NOTE_1DOT = (TICKS_PER_QUARTER_NOTE * 3), + NOTE_2 = (TICKS_PER_QUARTER_NOTE * 2), + NOTE_3 = ((TICKS_PER_QUARTER_NOTE * 3) / 2), + NOTE_4 = (TICKS_PER_QUARTER_NOTE * 1), + NOTE_6 = ((TICKS_PER_QUARTER_NOTE * 2) / 3), + NOTE_8 = (TICKS_PER_QUARTER_NOTE / 2), + NOTE_12 = (TICKS_PER_QUARTER_NOTE / 3), + NOTE_16 = (TICKS_PER_QUARTER_NOTE / 4), + NOTE_24 = (TICKS_PER_QUARTER_NOTE / 6), + NOTE_32 = (TICKS_PER_QUARTER_NOTE / 8), + NOTE_48 = (TICKS_PER_QUARTER_NOTE / 12) +#if (TICKS_PER_QUARTER_NOTE > 64) + ,NOTE_64 = (TICKS_PER_QUARTER_NOTE / 16), + NOTE_96 = (TICKS_PER_QUARTER_NOTE / 24), + NOTE_128 = (TICKS_PER_QUARTER_NOTE / 32), + NOTE_192 = (TICKS_PER_QUARTER_NOTE / 48), +// NOTE_256 = (TICKS_PER_QUARTER_NOTE / 64), + NOTE_384 = (TICKS_PER_QUARTER_NOTE / 92) +#endif +}; + +enum SEQ_LOOP_TYPE { + NO_LOOP = 0, + FORWARD_LOOP = 1, + BACKWARD_LOOP = 2, + PINGPONG = 3 +}; + +typedef void (*func_cb)(void); + +class seq; +class iseq; + +class MSequencer { +public: + void init(int bpm); + void update(); + + int newSequence(func_cb cb, SUBDIV subdiv); + + bool stopSequence(int index); + bool startSequence(int index); + + bool setSequenceSubdiv(int index, SUBDIV subdiv); + + int getSequenceSubdiv(int index); + + bool setCallback(int index, func_cb cb); + func_cb getCallback(int index); + + unsigned long clockStep; + + void setbpm(int v); + int getbpm(); + + + +private: + seq* _sequences[MAX_SEQ]; + int _bpm; + int _bpmInClockSteps; + + +}; + + +class iSequencer { +public: + void init(int bpm); + void update(); + + int newSequence(SUBDIV subdiv, int steps, SEQ_LOOP_TYPE loop); + + bool stopSequence(int index); + bool startSequence(int index); + + bool setSequenceSubdiv(int index, SUBDIV subdiv); + + int getSequenceSubdiv(int index); + +// bool setCallback(int index, func_cb cb); +// func_cb getCallback(int index); + + unsigned long clockStep; + + void setbpm(int v); + int getbpm(); + + + +private: + iseq* _sequences[INSTR_SEQ]; + int _bpm; + int _bpmInClockSteps; + + +}; + + +class seq { + + friend class MSequencer; + +private: + + seq(int id, func_cb cb, SUBDIV subdiv); + + int _id; + SUBDIV _subdiv; + + unsigned long lastStep; + unsigned long stepNum; + unsigned long step; + + void setsubdiv(SUBDIV v); + SUBDIV getsubdiv(); + + bool _stopped; + + void callback(func_cb cb); + + func_cb _callback; +}; + + +class iseq { + + friend class iSequencer; + +private: + + iseq(int id, SUBDIV subdiv, int steps, SEQ_LOOP_TYPE loop); + + int _id; + int _steps; + int _length; + int _direction; + SUBDIV _subdiv; + SEQ_LOOP_TYPE _loop; + + int indx; + + int _notes[]; + int _velocity[]; + int _ccNumbers[]; + int _ccValues[]; + + unsigned long lastStep; + unsigned long stepNum; + unsigned long step; + + void setsubdiv(SUBDIV v); + SUBDIV getsubdiv(); + + void setsteps(int steps); + int getsteps(); + + void setlooptype(SEQ_LOOP_TYPE loop); + SEQ_LOOP_TYPE getlooptype(); + + + + bool _stopped; + +}; + + +extern MSequencer Sequencer; +extern iSequencer iSeq; diff --git a/filterCoefficientTable.inc b/filterCoefficientTable.inc new file mode 100644 index 0000000..73599ed --- /dev/null +++ b/filterCoefficientTable.inc @@ -0,0 +1,135 @@ +// value of x for implementation of single pole low pass filter +// in 32bit fixed integer calculation with coefficients +// a0 = 1 - x +// b1 = x +// x = EXP(-(2*PI()*fc)) +// where fc is a value between 0.0 and 0.5 of the sampling rate (in this case 48KHz) +// +4290373254, +4290100233, +4289810996, +4289504581, +4289179970, +4288836083, +4288471778, +4288085843, +4287676998, +4287243884, +4286785064, +4286299013, +4285784121, +4285238680, +4284660880, +4284048808, +4283400436, +4282713616, +4281986075, +4281215408, +4280399067, +4279534352, +4278618410, +4277648216, +4276620570, +4275532089, +4274379185, +4273158065, +4271864714, +4270494881, +4269044076, +4267507537, +4265880234, +4264156844, +4262331738, +4260398955, +4258352199, +4256184808, +4253889743, +4251459553, +4248886373, +4246161883, +4243277292, +4240223313, +4236990127, +4233567382, +4229944123, +4226108800, +4222049200, +4217752472, +4213205021, +4208392501, +4203299810, +4197911016, +4192209318, +4186177034, +4179795529, +4173045162, +4165905296, +4158354192, +4150369010, +4141925733, +4132999132, +4123562709, +4113588682, +4103047864, +4091909728, +4080142291, +4067712036, +4054583930, +4040721407, +4026086291, +4010638755, +3994337308, +3977138813, +3958998423, +3939869591, +3919704125, +3898452117, +3876062167, +3852481062, +3827654212, +3801525689, +3774038004, +3745132631, +3714749847, +3682829367, +3649309994, +3614130143, +3577228361, +3538543245, +3498014098, +3455581234, +3411186725, +3364774287, +3316290864, +3265686384, +3212914905, +3157935534, +3100712973, +3041218570, +2979431317, +2915339041, +2848938943, +2780239798, +2709261927, +2636039303, +2560620544, +2483069880, +2403468642, +2321915945, +2238530967, +2153452027, +2066839367, +1978873676, +1889758159, +1799717893, +1708999312, +1617870277, +1526617863, +1435548103, +1344982938, +1255257551, +1166718303, +1079717790, +994610846, +911750234, +831480728 \ No newline at end of file diff --git a/filterCoefficientsMoogLadder.inc b/filterCoefficientsMoogLadder.inc new file mode 100644 index 0000000..554e6ee --- /dev/null +++ b/filterCoefficientsMoogLadder.inc @@ -0,0 +1,25 @@ +// value of coefficients for implementation of Moog Ladder style resonant low pass filter +// in 32bit fixed integer calculation with coefficients +// g = (1 - x)^4 +// b1 = 4x +// b2 = -6x^2 +// b3 = 4x^3 +// b4 = -x^4 +// x = EXP(-(14.445 * fc)) +// where fc is a value between 0.0 and 0.5 of the sampling rate (in this case 48KHz) +// + +// g +7730393,7956911,8190067,8430055,8677075,8931333,9193043,9462420,9739690,10025087,10318845,10621212,10932438,11252784,11582517,11921914,12271254,12630830,13000945,13381904,13774027,14177639,14593080,15020692,15460836,15913877,16380194,16860175,17354220,17862745,18386170,18924934,19479484,20050284,20637809,21242556,21865018,22505724,23165206,23844011,24542710,25261881,26002132,26764071,27548340,28355589,29186497,30041754,30922075,31828195,32760865,33720874,34709012,35726109,36773013,37850601,38959772,40101444,41276577,42486152,43731176,45012690,46331764,47689495,49087025,50525515,52006173,53530223,55098946,56713656,58375693,60086452,61847358,63659885,65525548,67445905,69422566,71457166,73551427,75707092,77925956,80209887,82560785,84980619,87471425,90035275,92674310,95390762,98186887,101065027,104027599,107077090,110216037,113447099,116772968,120196439,123720382,127347756,131081629,134925093,138881416,142953919,147146006,151461256,155903251,160475754,165182630,170027814,175015454,180149716,185434966,190875690,196476463,202242051,208177322,214287380,220577347,227052624,233718714,240581292,247646284,254919670,262407680,270116787,278053595,286224953,294637873,303299699,312217887,321400231,330854639,340589422,350613094,360934464,371562610,382506856,393777000,405382984,417335149,429644299,442321370,455377944,468825746,482677110,496944728,511641719,526781782,542378866,558447751,575003583,592062139,609639593,627753073,646420287,665659424,685489529,705930641,727003191,748728900,771130064,794230170,818053830,842626179,867974307,894125997,921110611,948958631,977702385,1007375692,1038014044,1069654650,1102337124,1136102744,1170995524,1207061686,1244350164,1282912925,1322805006,1364084973,1406815195,1451061624,1496895349,1544391890,1593631939,1644702479,1697696804,1752714830,1809865105,1869264035,1931037925,1995324032,2062270847,2132040807,2204810956,2280774706,2360144704,2443154837,2530062428,2621152714,2716741893,2817182420,2922866347,3034233898,3151781638,3276065795,3407721513,3547467988,3696130526,3854655329,4024136766,4205846353,4401269145,4612154019,4840571078,5088993792,5360401603,5658414293,5987476367,6353111379,6762261327,7223785189,7749168552,8353573824,9057436956,9889002851,10888442000,12114878218,13659111791,15668055402,18396174389,22325770963,28495882501,39631229567,65894430866,204816793749,-175652025025,-60228320333,-35828969727,-25197653708,-19224318982,-15382805412,-12693055725,-10695206179,-9144803901,-7899806521,-6871970546,-6003501819,-5254884437,-4598105816,-4012652847,-3483069834,-2997374010,-2546008524,-2121116169,-1716013394,-1324789764, + +// gg +13914,14741,15618,16546,17530,18573,19677,20847,22087,23400,24791,26266,27828,29482,31235,33093,35060,37145,39354,41694,44174,46800,49583,52532,55655,58965,62471,66186,70121,74291,78709,83389,88348,93601,99167,105064,111311,117930,124943,132373,140244,148584,157419,166780,176698,187205,198337,210131,222627,235865,249891,264751,280495,297175,314846,333569,353405,374421,396687,420276,445269,471748,499802,529524,561014,594377,629724,667173,706849,748886,793422,840607,890599,943565,999681,1059135,1122126,1188863,1259570,1334484,1413854,1497945,1587040,1681434,1781446,1887407,1999672,2118619,2244642,2378165,2519633,2669520,2828328,2996587,3174861,3363747,3563876,3775920,4000588,4238631,4490849,4758086,5041237,5341254,5659141,5995964,6352854,6731008,7131698,7556267,8006144,8482842,8987961,9523203,10090367,10691369,11328227,12003094,12718243,13476088,14279197,15130275,16032204,16988041,18001022,19074586,20212372,21418256,22696333,24050965,25486758,27008623,28621764,30331706,32144313,34065799,36102796,38262309,40551793,42979192,45552895,48281874,51175612,54244230,57498473,60949765,64610281,68492916,72611470,76980591,81615890,86533938,91752485,97290423,103167833,109406164,116028374,123058827,130523687,138450781,146869934,155813077,165314152,175409810,186139089,197543939,209669229,222563267,236277884,250868768,266395759,282923490,300521367,319264484,339233762,360516675,383207941,407410107,433234454,460801877,490243509,521702619,555335151,591311314,629817659,671058529,715257897,762662780,813544735,868203926,926972831,990219658,1058354509,1131834311,1211169469,1296932582,1389767406,1490399216,1599649329,1718449991,1847864312,1989106573,2143572863,2312876167,2498879817,2703761196,2930064017,3180788100,3459483317,3770384171,4118574677,4510202000,4952765232,5455484699,6029814904,6690133676,7454690595,8346949063,9397516072,10646921175,12149818349,13981390104,16247433527,19100765745,22769062173,27603974843,34172617423,43439523997,57157119757,78794367644,116052117450,189062049498,365691808283,1010968354323,9767226642373,7183671438948,844581651071,298888206408,147829240284,86048254815,55094878737,37512198006,26632900166,19471030305,14530248724,10995189469,8391689997,6429341259,4922639833,3748895338,2824649091,2091808932,1509245346,1047536219,685616855,408633593, + +// ggg +25,27,30,32,35,39,42,46,50,55,60,65,71,77,84,92,100,109,119,130,142,154,168,184,200,218,238,260,283,309,337,367,401,437,477,520,567,618,674,735,801,874,953,1039,1133,1236,1348,1470,1603,1748,1906,2079,2267,2472,2696,2940,3206,3496,3812,4157,4534,4944,5392,5880,6412,6992,7625,8315,9068,9889,10784,11760,12825,13985,15251,16632,18138,19780,21570,23523,25652,27975,30507,33269,36281,39566,43148,47054,51315,55961,61028,66553,72580,79152,86319,94136,102661,111958,122097,133155,145215,158368,172713,188358,205421,224031,244328,266465,290609,316943,345665,376992,411161,448430,489081,533421,581786,634541,692087,754859,823333,898029,979512,1068403,1165375,1271167,1386583,1512503,1649885,1799778,1963324,2141775,2336494,2548974,2780842,3033877,3310025,3611410,3940353,4299396,4691309,5119131,5586176,6096076,6652801,7260694,7924512,8649451,9441216,10306043,11250767,12282868,13410557,14642836,15989561,17461548,19070689,20829998,22753807,24857828,27159353,29677405,32432851,35448747,38750423,42365822,46325714,50664096,55418489,60630335,66345432,72614538,79493772,87045431,95338578,104449918,114464765,125478052,137595602,150935511,165629560,181825418,199688390,219403905,241180571,265253224,291886535,321380038,354072525,390348655,430646158,475463721,525371870,581024375,643172462,712682624,790557116,877958503,976241468,1086989670,1212062979,1353652371,1514354126,1697261034,1906066829,2145223598,2420113493,2737298606,3104823596,3532632618,4033113896,4621830978,5318530852,6148512813,7144569096,8349726741,9821198837,11636214390,13900796486,16763169158,20435004924,25225837833,31600737810,40280628376,52424920898,69980574551,96391210910,138148971466,208509368587,337491493681,603253253254,1254372752245,3374371678766,15510521906258,465775850394381,-293791861126116,-11843567301560,-2493349951485,-867282507162,-385152897419,-197327183287,-110861011699,-66320495312,-41457534274,-26725734030,-17592361704,-11729897504,-7866286980,-5270079440,-3502474994,-2290692656,-1459832705,-894663743,-517337120,-273931703,-126043708, + +// G = gggg +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,6,6,7,8,9,10,12,13,15,16,18,21,23,26,29,33,37,41,46,52,58,65,73,82,92,104,116,131,147,165,185,207,233,261,293,329,369,415,465,522,586,658,739,829,931,1045,1173,1317,1478,1659,1863,2091,2347,2634,2957,3320,3726,4183,4696,5271,5917,6642,7457,8371,9397,10549,11842,13294,14924,16754,18809,21116,23706,26614,29879,33545,37661,42283,47473,53301,59845,67193,75446,84713,95121,106809,119937,134681,151241,169842,190736,214207,240574,270195,303474,340865,382878,430087,483139,542761,609770,685089,769755,864936,971949,1092274,1227582,1379757,1550921,1743464,1960089,2203841,2478157,2786915,3134502,3525865,3966604,4463042,5022338,5652596,6362975,7163873,8067060,9085892,10235511,11533128,12998292,14653229,16523222,18637092,21027655,23732383,26794045,30261528,34190790,38645928,43700471,49438879,55958214,63370360,71804302,81409018,92356997,104848191,119114728,135426995,154100134,175502630,200066396,228298588,260796925,298267442,341546601,391629087,449701548,517184339,595785206,687565276,795024101,921204910,1069834600,1245503352,1453887751,1702067583,1998915138,2355643766,2786522922,3309873118,3949426433,4736222811,5711308551,6929578562,8465412021,10421008012,12938960425,16221673847,20562044422,26392967093,34370013958,45513564077,61462422880,84945757885,120706435350,177412160472,271892124207,439349618992,760642890569,1445541245043,3135784986587,8322405293673,31136558075793,237966192290634,22211744516035900,12015256877698800,166082327562704,20799729956799,5088160811660,1723948436947,706744767506,327631132494,165149423120,88270991373,49157097929,28147872413,16396041262,9624387376,5642041313,3272252217,1857672466,1018788807,530346650,255492546,109446810,38878390, + +// Gstage +7716504,7942197,8174479,8413541,8659580,8912799,9173408,9441619,9717654,10001741,10294113,10595012,10904682,11223379,11551366,11888913,12236293,12593794,12961710,13340339,13729995,14130993,14543665,14968344,15405381,15855130,16317961,16794248,17284381,17788762,18307796,18841911,19391535,19957117,20539117,21138009,21754271,22388409,23040933,23712369,24403262,25114166,25845660,26598323,27372768,28169612,28989499,29833083,30701039,31594065,32512866,33458185,34430766,35431386,36460840,37519946,38609544,39730487,40883667,42069992,43290395,44545835,45837296,47165786,48532351,49938049,51383984,52871263,54401050,55974531,57592910,59257442,60969401,62730102,64540889,66403145,68318289,70287759,72313063,74395724,76537298,78739403,81003677,83331808,85725537,88186621,90716874,93318175,95992413,98741536,101567550,104472504,107458473,110527627,113682141,116924265,120256292,123680570,127199523,130815562,134531234,138349100,142271761,146301944,150442336,154695752,159065055,163553124,168162987,172897633,177760181,182753799,187881676,193147112,198553426,204104083,209802486,215652211,221656840,227820022,234145536,240637109,247298590,254133932,261147090,268342114,275723070,283294182,291059630,299023739,307190782,315565210,324151483,332954130,341977720,351226834,360706243,370420619,380374740,390573527,401021756,411724470,422686551,433913081,445409128,457179780,469230250,481565597,494191163,507112187,520333990,533861770,547701010,561857159,576335536,591141579,606280923,621758917,637581253,653753406,670281047,687169945,704425506,722053734,740060295,758451085,777231857,796408655,815987510,835974493,856375675,877197491,898446180,920128373,942250664,964819817,987842843,1011326899,1035279419,1059708129,1084620754,1110025732,1135931607,1162347239,1189282170,1216746363,1244750091,1273304642,1302421578,1332113360,1362393412,1393275766,1424775789,1456909849,1489695424,1523151574,1557298891,1592159423,1627757351,1664118871,1701272730,1739249752,1778083998,1817813274,1858477605,1900122518,1942796904,1986555550,2031458306,2077571776,2124969830,2173734255,2223956537,2275738290,2329193578,2384450539,2441653032,2500963392,2562566115,2626670049,2693514005,2763371812,2836558465,2913437519,2994432687,3080039626,3170840682,3267527014,3370921657,3482018158,3602020921,3732409626,3875018714,4032153473,4206752535,4402618211,4624765942,4879946767,5177473195,5530569783,5958658981,6491508120,7177163478,8098547824,9412184160,11453182589,15091789849,23511984362,65147491412,-61046159117,-18425566938,-9921154401,-6252304812,-4190776664,-2857833714,-1915686403 \ No newline at end of file diff --git a/filterCoefficients_1poleLP.inc b/filterCoefficients_1poleLP.inc new file mode 100644 index 0000000..364cd09 --- /dev/null +++ b/filterCoefficients_1poleLP.inc @@ -0,0 +1,8 @@ +// value of x for implementation of single pole low pass filter +// in 32bit fixed integer calculation with coefficients +// a0 = 1 - x +// b1 = x +// x = EXP(-(2*PI()*fc)) +// where fc is a value between 0.0 and 0.5 of the sampling rate (in this case 48KHz) +// +4279217041, 4278893259, 4278562833, 4278225627, 4277881504, 4277530322, 4277171937, 4276806201, 4276432966, 4276052078, 4275663377, 4275266708, 4274861908, 4274448809, 4274027242, 4273597039, 4273158019, 4272710004, 4272252807, 4271786247, 4271310131, 4270824262, 4270328440, 4269822472, 4269306140, 4268779240, 4268241554, 4267692866, 4267132948, 4266561575, 4265978512, 4265383523, 4264776365, 4264156790, 4263524548, 4262879380, 4262221026, 4261549219, 4260863681, 4260164139, 4259450309, 4258721905, 4257978620, 4257220163, 4256446223, 4255656484, 4254850636, 4254028346, 4253189285, 4252333114, 4251459486, 4250568054, 4249658451, 4248730312, 4247783273, 4246816942, 4245830935, 4244824861, 4243798308, 4242750868, 4241682119, 4240591639, 4239478990, 4238343723, 4237185386, 4236003522, 4234797658, 4233567307, 4232311988, 4231031200, 4229724432, 4228391157, 4227030868, 4225643010, 4224227034, 4222782384, 4221308495, 4219804783, 4218270641, 4216705473, 4215108686, 4213479625, 4211817657, 4210122143, 4208392419, 4206627794, 4204827577, 4202991098, 4201117609, 4199206394, 4197256727, 4195267822, 4193238938, 4191169264, 4189058020, 4186904401, 4184707556, 4182466664, 4180180844, 4177849247, 4175470962, 4173045097, 4170570716, 4168046881, 4165472643, 4162847034, 4160169043, 4157437673, 4154651906, 4151810674, 4148912960, 4145957624, 4142943595, 4139869729, 4136734929, 4133538012, 4130277799, 4126953089, 4123562666, 4120105272, 4116579668, 4112984576, 4109318655, 4105580601, 4101769070, 4097882680, 4093920065, 4089879767, 4085760375, 4081560417, 4077278404, 4072912845, 4068462164, 4063924852, 4059299319, 4054583930, 4049777075, 4044877097, 4039882311, 4034791009, 4029601465, 4024311932, 4018920607, 4013425694, 4007825337, 4002117707, 3996300890, 3990372963, 3984332097, 3978176178, 3971903323, 3965511417, 3958998490, 3952362489, 3945601242, 3938712674, 3931694620, 3924544917, 3917261408, 3909841789, 3902283847, 3894585353, 3886743918, 3878757267, 3870623016, 3862338854, 3853902344, 3845311080, 3836562636, 3827654518, 3818584224, 3809349306, 3799947238, 3790375493, 3780631341, 3770712425, 3760616026, 3750339570, 3739880391, 3729235830, 3718403355, 3707380220, 3696163712, 3684751155, 3673139962, 3661327297, 3649310519, 3637086937, 3624653724, 3612008302, 3599147960, 3586069915, 3572771543, 3559250155, 3545502997, 3531527490, 3517320911, 3502880673, 3488204192, 3473288756, 3458131940, 3442731112, 3427083848, 3411187619, 3395040065, 3378638607, 3361981114, 3345065329, 3327888844, 3310449536, 3292745187, 3274774007, 3256533607, 3238022468, 3219238453, 3200179919, 3180845259, 3161232827, 3141341156, 3121168802, 3100714475, 3079977210, 3058955764, 3037649200, 3016056968, 2994178354, 2972012619, 2949559517, 2926818948, 2903790851, 2880475148, 2856872243, 2832982802, 2808807134, 2784346313, 2759601414, 2734573489, 2709264197, 2683675160, 2657808232, 2631665649, 2605249687, 2578563127, 2551608749, 2524389787, 2496909503, 2469171697, 2441180289, 2412939590, 2384454024, 2355728676, 2326768121, 2297578440, 2268165045, 2238534044, 2208692047 \ No newline at end of file diff --git a/filterCoefficients_4stageLP.inc b/filterCoefficients_4stageLP.inc new file mode 100644 index 0000000..4b6975a --- /dev/null +++ b/filterCoefficients_4stageLP.inc @@ -0,0 +1,25 @@ +// value of x for implementation of four stage low pass filter +// in 32bit fixed integer calculation with coefficients +// a0 = (1 - x)^4 +// b1 = 4x +// b2 = -6x^2 +// b3 = 4x^3 +// b4 = -x^4 +// x = EXP(-(14.445 * fc)) +// where fc is a value between 0.0 and 0.5 of the sampling rate (in this case 48KHz) +// + +// a0 +20,22,25,28,31,35,40,44,50,56,63,70,79,88,99,111,125,140,157,176,197,221,248,278,312,350,392,440,493,553,620,695,779,873,979,1098,1231,1379,1546,1733,1942,2177,2439,2734,3063,3433,3846,4309,4828,5409,6059,6787,7602,8515,9536,10680,11959,13391,14994,16787,18793,21037,23547,26355,29494,33005,36931,41320,46226,51710,57838,64687,72338,80886,90434,101097,113004,126298,141139,157704,176189,196815,219825,245489,274110,306021,341593,381240,425419,474636,529456,590502,658464,734110,818288,911935,1016091,1131904,1260644,1403713,1562660,1739196,1935205,2152771,2394182,2661966,2958902,3288047,3652765,4056749,4504056,4999142,5546883,6152633,6822246,7562139,8379310,9281420,10276823,11374627,12584769,13918045,15386204,17002021,18779343,20733193,22879824,25236844,27823245,30659544,33767812,37171845,40897196,44971294,49423522,54285288,59590216,65374073,71674958,78533412,85992292,94097108,102895761,112438848,122779508,133973447,146079010,159156856,173270334,188484974,204868559,222490692,241423108,261739038,283512758,306819598,331735715,358336882,386699043,416896828,449003701,483091188,519227244,557477492,597902539,640558361,685494633,732754880,782374892,834381953,888793830,945618867,1004853643,1066483754,1130481855,1196807534,1265406920,1336211852,1409139855,1484093865,1560961173,1639615567,1719915608,1801705539,1884816876,1969068201,2054265615,2140205839,2226675027,2313451941,2400309450,2487015015,2573334323,2659031961,2743873426,2827628048,2910070486,2990982176,3070154485,3147389781,3222503817,3295325858,3365701888,3433495954,3498587958,3560879279,3620289028,3676757366,3730243444,3780726504,3828204945,3872695363,3914232296,3952866364,3988663721,4021704445,4052080758,4079895657,4105261554,4128297983,4149130507,4167888924,4184705587,4199713832,4213046939,4224836618,4235211728,4244297498,4252214336,4259077474,4264995979,4270072545,4274402998,4278076182,4281173865,4283770704,4285934433,4287726010,4289199913,4290404475,4291382228,4292170351,4292801069,4293302095,4293697081,4294006041,4294245772,4294430253,4294571010,4294677470,4294757264,4294816520,4294860104,4294891848,4294914734,4294931065, + +// b1 +17038279068,17034147808,17029896544,17025521801,17021020052,17016387642,17011620781,17006715662,17001668287,16996474564,16991130317,16985631212,16979972858,16974150663,16968159948,16961995879,16955653549,16949127860,16942413545,16935505290,16928397533,16921084639,16913560719,16905819871,16897855875,16889662455,16881233068,16872561100,16863639683,16854461730,16845020092,16835307279,16825315756,16815037656,16804464945,16793589302,16782402425,16770895477,16759059586,16746885620,16734364142,16721485583,16708239896,16694617142,16680606767,16666198178,16651380353,16636142089,16620471885,16604357892,16587788116,16570749976,16553230931,16535217865,16516697471,16497656006,16478079455,16457953627,16437263726,16415994700,16394131203,16371657456,16348557353,16324814475,16300411801,16275332217,16249557932,16223071183,16195853363,16167885627,16139148899,16109623408,16079289189,16048125758,16016112229,15983227336,15949449257,15914756166,15879125152,15842533346,15804957512,15766373600,15726757537,15686084632,15644329617,15601467239,15557471683,15512316280,15465974673,15418419822,15369624189,15319559923,15268199180,15215513067,15161473074,15106050020,15049214574,14990937081,14931187310,14869935869,14807151840,14742804881,14676864702,14609299821,14540080298,14469174989,14396552966,14322184034,14246036661,14168081107,14088286683,14006623153,13923061264,13837571386,13750124981,13660692692,13569247792,13475762396,13380210322,13282566132,13182804250,13080901918,12976836558,12870586133,12762130880,12651451934,12538532667,12423356602,12305910644,12186182273,12064162718,11939843495,11813219203,11684286654,11553045462,11419498603,11283649896,11145508389,11005085486,10862394590,10717455304,10570287775,10420918803,10269376941,10115695645,9959912867,9802069802,9642214712,9480397251,9316673738,9151104752,8983757849,8814702555,8644014503,8471776576,8298075897,8123003129,7946658088,7769142476,7590566329,7411043333,7230691978,7049640365,6868015988,6685955524,6503598818,6321092495,6138585531,5956232149,5774191022,5592625379,5411699564,5231583720,5052448349,4874467744,4697817807,4522675130,4349217443,4177622187,4008066093,3840726673,3675776951,3513389135,3353732669,3196971570,3043265692,2892770764,2745634125,2601998384,2461997652,2325757122,2193394338,2065015744,1940718035,1820587487,1704698154,1593112198,1485880197,1383039181,1284613438,1190613500,1101037876,1015870782,935082148,858631609,786462991,718509733,654691797,594918625,539088277,487088702,438798845,394088820,352821698,314853747,280035717,248214198,219232495,192931434,169151121,147731425,128513200,111339394,96056069,82512906,70564240,60069888,50895519,42913483,36002837,30050068,24949046,20601325,16916082,13810074,11207554,9039996,7245869,5770290,4564639,3586191,2797628,2166637,1665443,1270356,961336,721569,537068,396299,289834,210036,150778,107193,75449,52562,36232, + +// b2 +-25346783828,-25334493682,-25321849647,-25308841657,-25295459516,-25281692655,-25267530138,-25252960994,-25237973710,-25222556514,-25206697417,-25190383983,-25173603637,-25156343246,-25138589439,-25120328430,-25101546251,-25082228404,-25062359934,-25041925789,-25020910225,-24999297343,-24977070529,-24954213193,-24930707865,-24906536958,-24881682174,-24856125069,-24829846517,-24802826828,-24775046206,-24746483935,-24717119256,-24686930530,-24655895722,-24623992065,-24591196953,-24557486332,-24522836163,-24487221786,-24450617775,-24412998472,-24374336971,-24334606847,-24293780045,-24251828586,-24208723421,-24164435185,-24118933856,-24072188622,-24024168488,-23974841004,-23924174102,-23872134321,-23818687944,-23763800305,-23707436268,-23649560543,-23590136447,-23529126948,-23466494567,-23402201000,-23336207454,-23268474700,-23198962289,-23127630012,-23054436284,-22979340161,-22902298908,-22823269738,-22742209884,-22659075303,-22573822133,-22486405825,-22396781505,-22304904071,-22210727760,-22114207721,-22015297052,-21913949995,-21810120840,-21703762745,-21594829969,-21483276309,-21369055249,-21252121661,-21132430279,-21009934982,-20884592022,-20756357392,-20625187409,-20491039285,-20353872056,-20213643837,-20070315725,-19923849079,-19774206970,-19621353822,-19465254838,-19305879780,-19143196896,-18977178472,-18807799567,-18635034904,-18458865967,-18279274069,-18096244077,-17909765781,-17719828804,-17526430509,-17329569236,-17129247904,-16925475353,-16718263086,-16507628925,-16293592474,-16076183439,-15855432617,-15631378769,-15404066338,-15173543468,-14939868851,-14703105588,-14463322068,-14220595877,-13975010607,-13726658780,-13475637179,-13222053832,-12966021755,-12707665629,-12447114220,-12184506160,-11919987849,-11653714416,-11385850522,-11116564999,-10846039272,-10574461185,-10302023982,-10028933889,-9755398814,-9481639312,-9207878851,-8934349030,-8661288097,-8388938068,-8117550567,-7847376288,-7578673208,-7311701616,-7046727559,-6784013921,-6523826165,-6266432903,-6012100225,-5761089836,-5513666090,-5270084496,-5030599760,-4795458221,-4564898538,-4339156668,-4118451931,-3902998398,-3692996478,-3488636313,-3290091903,-3097523709,-2911077052,-2730881559,-2557047308,-2389669088,-2228820899,-2074559084,-1926920273,-1785920788,-1651557311,-1523806173,-1402623644,-1287947645,-1179694913,-1077764599,-982037991,-892378205,-808632415,-730633272,-658198267,-591133336,-529232706,-472280621,-420053727,-372321522,-328848822,-289397326,-253726827,-221597130,-192769800,-167009192,-144084190,-123769322,-105846359,-90104887,-76343302,-64370243,-54004256,-45075102,-37423569,-30901996,-25374131,-20715123,-16811341,-13559998,-10868810,-8655440,-6846967,-5379286,-4196442,-3249955,-2498165,-1905536,-1442005,-1082353,-805603,-594450,-434751,-315054,-226168,-160790,-113174,-78843,-54347,-37056,-24985,-16652,-10967,-7135,-4584,-2907,-1819,-1123,-683,-410,-242,-141,-81,-45,-25,-14,-7,-4,-2,-1,0,0,0, + +// b3 +16758590019,16746402641,16733867419,16720974639,16707714479,16694076766,16680050981,16665626598,16650792570,16635537622,16619850287,16603718684,16587130822,16570074189,16552536068,16534503367,16515962848,16496900789,16477303052,16457155451,16436443157,16415151234,16393264095,16370766224,16347641295,16323872925,16299444092,16274337693,16248536026,16222020905,16194774114,16166776617,16138009419,16108452749,16078086545,16046890124,16014843068,15981923651,15948110278,15913380869,15877712726,15841083057,15803468003,15764844318,15725187329,15684472606,15642674855,15599768657,15555728151,15510526917,15464138571,15416535548,15367690891,15317576546,15266164474,15213426002,15159332290,15103854655,15046963395,14988628809,14928821118,14867510122,14804665541,14740257081,14674253710,14606625068,14537339952,14466368251,14393678664,14319240378,14243023144,14164996097,14085129143,14003392174,13919755434,13834189642,13746665611,13657155745,13565631318,13472065467,13376432207,13278705377,13178860729,13076874519,12972723689,12866387449,12757845908,12647079477,12534071818,12418807494,12301272530,12181454967,12059345711,11934936122,11808221517,11679198778,11547867664,11414230514,11278291777,11140061318,10999549147,10856770267,10711743558,10564489138,10415034421,10263408192,10109643776,9953780159,9795857701,9635924710,9474031763,9310234660,9144595446,8977179684,8808059340,8637309060,8465012715,8291256095,8116132252,7939739535,7762179916,7583564113,7404006634,7223626305,7042548998,6860904977,6678830814,6496465692,6313956226,6131451595,5949108004,5767082941,5585538927,5404641655,5224560250,5045467372,4867535220,4690940713,4515860901,4342471931,4170953401,4001480715,3834231500,3669379075,3507095218,3347548763,3190903478,3037320974,2886954252,2739952010,2596455448,2456599770,2320509126,2188299472,2060078530,1935942718,1815976217,1700254282,1588837760,1481776947,1379108238,1280854737,1187028596,1097625498,1012629895,932012045,855729947,783727759,715937555,652279510,592662546,536983980,485131901,436984409,392411655,351276263,313434266,278736382,247028908,218154873,191955473,168270407,146939669,127804345,110707391,95494840,82016712,70127489,59687221,50561878,42623919,35752832,29835299,24765530,20445369,16784282,13699332,11115057,8963214,7182534,5718376,4522380,3552022,2770190,2144771,1648144,1256777,950760,713400,530811,391548,286257,207368,148808,105752,74405,51813,35701,24332,16398,10924,7191,4676,3003,1903,1190,734,447,268,158,92,53,30,16,9,5,3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + +// b4 +-4155117982,-4151089493,-4146947044,-4142687514,-4138307750,-4133804491,-4129174368,-4124414014,-4119519901,-4114488432,-4109315954,-4103998687,-4098532825,-4092914399,-4087139380,-4081203631,-4075102975,-4068833088,-4062389525,-4055767832,-4048963365,-4041971455,-4034787237,-4027405884,-4019822321,-4012031476,-4004028081,-3995806868,-3987362389,-3978689063,-3969781324,-3960633360,-3951239402,-3941593452,-3931689450,-3921521163,-3911082475,-3900366880,-3889367951,-3878079140,-3866493738,-3854605048,-3842406070,-3829890050,-3817049818,-3803878335,-3790368337,-3776512573,-3762303712,-3747734300,-3732796962,-3717484012,-3701788027,-3685701309,-3669216242,-3652325087,-3635020140,-3617293834,-3599138372,-3580546052,-3561509251,-3542020319,-3522071692,-3501655915,-3480765421,-3459392982,-3437531235,-3415173296,-3392312050,-3368940680,-3345052701,-3320641593,-3295701241,-3270225696,-3244209296,-3217646707,-3190532816,-3162863193,-3134633261,-3105839225,-3076477772,-3046545752,-3016040825,-2984961035,-2953304872,-2921071751,-2888261609,-2854874719,-2820912593,-2786377265,-2751271471,-2715598811,-2679364003,-2642572166,-2605229857,-2567344359,-2528924064,-2489978382,-2450517598,-2410553823,-2370099455,-2329168575,-2287776601,-2245939530,-2203675639,-2161003782,-2117944271,-2074519162,-2030751027,-1986664761,-1942285970,-1897641754,-1852760945,-1807673321,-1762410346,-1717004121,-1671489082,-1625899998,-1580273333,-1534646660,-1489058172,-1443547929,-1398156513,-1352925094,-1307896048,-1263112201,-1218617229,-1174454664,-1130668987,-1087304361,-1044405610,-1002016765,-960181870,-918944459,-878347522,-838433445,-799243037,-760816606,-723192865,-686408655,-650499811,-615499487,-581439455,-548348716,-516254045,-485179684,-455146926,-426174680,-398278253,-371470217,-345759847,-321153456,-297653572,-275259552,-253967665,-233770692,-214657928,-196615866,-179627487,-163673048,-148729755,-134772069,-121772241,-109699751,-98522264,-88205451,-78713465,-70008971,-62053591,-54808137,-48232899,-42287807,-36932880,-32128317,-27834874,-24014034,-20628233,-17641071,-15017481,-12723891,-10728378,-9000716,-7512517,-6237265,-5150336,-4229022,-3452523,-2801890,-2260001,-1811469,-1442573,-1141162,-896549,-699407,-541660,-416361,-317589,-240334,-180392,-134267,-99075,-72459,-52509,-37695,-26798,-18862,-13140,-9058,-6176,-4164,-2775,-1828,-1189,-764,-485,-303,-187,-114,-68,-40,-23,-13,-8,-4,-2,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/filterCoefficients_4stageLPinFloats.inc b/filterCoefficients_4stageLPinFloats.inc new file mode 100644 index 0000000..3502cbb --- /dev/null +++ b/filterCoefficients_4stageLPinFloats.inc @@ -0,0 +1,25 @@ +// value of x for implementation of four stage low pass filter +// in single precision float calculation with coefficients +// a0 = (1 - x)^4 +// b1 = 4x +// b2 = -6x^2 +// b3 = 4x^3 +// b4 = -x^4 +// x = EXP(-(14.445 * fc)) +// where fc is a value between 0.0 and 0.5 of the sampling rate (in this case 48KHz) +// + +// a0 +0.000000004613731727365660000000,0.000000005176230969328230000000,0.000000005807226140952210000000,0.000000006515048838524650000000,0.000000007309033784469370000000,0.000000008199653346037200000000,0.000000009198656401868580000000,0.000000010319197204301000000000,0.000000011576043086155800000000,0.000000012985747553178700000000,0.000000014566860505508300000000,0.000000016340190907999300000000,0.000000018329045066453400000000,0.000000020559576229388400000000,0.000000023061088831002400000000,0.000000025866440936143500000000,0.000000029012433980626000000000,0.000000032540341789532600000000,0.000000036496442894391300000000,0.000000040932543797034500000000,0.000000045906768675514200000000,0.000000051484195885369700000000,0.000000057737832333602400000000,0.000000064749357492340500000000,0.000000072610429362990600000000,0.000000081423638133443600000000,0.000000091304021339414800000000,0.000000102380331165032000000000,0.000000114796890171546000000000,0.000000128715420277157000000000,0.000000144316867145311000000000,0.000000161804139943715000000000,0.000000181404203016005000000000,0.000000203371475095039000000000,0.000000227990777406150000000000,0.000000255581226781474000000000,0.000000286499483895789000000000,0.000000321145721242199000000000,0.000000359967372437236000000000,0.000000403465340266089000000000,0.000000452200547927312000000000,0.000000506800318683209000000000,0.000000567967726558461000000000,0.000000636487788494692000000000,0.000000713240655118326000000000,0.000000799209798577538000000000,0.000000895496399069103000000000,0.000001003331603950610000000000,0.000001124092502013200000000000,0.000001259319671833220000000000,0.000001410734501348690000000000,0.000001580264444387730000000000,0.000001770060863504200000000000,0.000001982531475344610000000000,0.000002220365980485000000000000,0.000002486571810667770000000000,0.000002784508975628030000000000,0.000003117928794874210000000000,0.000003491026435221470000000000,0.000003908486382241310000000000,0.000004375539162796580000000000,0.000004898027085208320000000000,0.000005482472149134200000000000,0.000006136153317170690000000000,0.000006867201420418480000000000,0.000007684681501186200000000000,0.000008598717579921850000000000,0.000009620588238783330000000000,0.000010762890289939900000000000,0.000012039665318136300000000000,0.000013466559942057500000000000,0.000015061030189889800000000000,0.000016842519062503200000000000,0.000018832696705753500000000000,0.000021055703083055900000000000,0.000023538421536655200000000000,0.000026310797604647300000000000,0.000029406131013027100000000000,0.000032861543410688600000000000,0.000036718296288775300000000000,0.000041022279121982200000000000,0.000045824571588262600000000000,0.000051181914276245800000000000,0.000057157397330643100000000000,0.000063821151529730300000000000,0.000071251009054479400000000000,0.000079533421298609000000000000,0.000088764451498592700000000000,0.000099050561288766200000000000,0.000110509913742446000000000000,0.000123273580727125000000000000,0.000137486856384098000000000000,0.000153310638528679000000000000,0.000170923384528625000000000000,0.000190522465115459000000000000,0.000212326462103198000000000000,0.000236577155410040000000000000,0.000263541948221230000000000000,0.000293516598717711000000000000,0.000326827325550388000000000000,0.000363835112450333000000000000,0.000404938009049899000000000000,0.000450575008052283000000000000,0.000501230971259985000000000000,0.000557439031216422000000000000,0.000619787328152427000000000000,0.000688923168284303000000000000,0.000765558004895797000000000000,0.000850475611829806000000000000,0.000944535375695951000000000000,0.001048682332647230000000000000,0.001163953342688260000000000000,0.001291484420910980000000000000,0.001432521539796840000000000000,0.001588427922647640000000000000,0.001760697636941340000000000000,0.001950960126048560000000000000,0.002160999094162740000000000000,0.002392759322762610000000000000,0.002648361707691960000000000000,0.002930119982139650000000000000,0.003240547487756420000000000000,0.003582379857970010000000000000,0.003958591381161600000000000000,0.004372406516262540000000000000,0.004827322723475290000000000000,0.005327124180484900000000000000,0.005875910729101420000000000000,0.006478103938605880000000000000,0.007138481353571250000000000000,0.007862181370412810000000000000,0.008654744553847910000000000000,0.009522120519738140000000000000,0.010470695422754600000000000000,0.011507310414573300000000000000,0.012639278534611300000000000000,0.013874428341592400000000000000,0.015221087490177100000000000000,0.016688126580173800000000000000,0.018284984894894600000000000000,0.020021640737514800000000000000,0.021908690187039200000000000000,0.023957286281626800000000000000,0.026179209284143200000000000000,0.028586831909591500000000000000,0.031193123851377600000000000000,0.034011669977441800000000000000,0.037056593315000500000000000000,0.040342643303444900000000000000,0.043885077727601000000000000000,0.047699678565973200000000000000,0.051802651124936100000000000000,0.056210697556566900000000000000,0.060940868731794800000000000000,0.066010457942272800000000000000,0.071437004395611600000000000000,0.077238240024062700000000000000,0.083431806842929100000000000000,0.090035386976970300000000000000,0.097066356818964800000000000000,0.104541820759649000000000000000,0.112478432281249000000000000000,0.120892013350121000000000000000,0.129797843192465000000000000000,0.139210032988202000000000000000,0.149141615480298000000000000000,0.159604156590397000000000000000,0.170607790355494000000000000000,0.182160849726121000000000000000,0.194269687160368000000000000000,0.206938439412508000000000000000,0.220169049524868000000000000000,0.233960720424579000000000000000,0.248310098956965000000000000000,0.263210818016032000000000000000,0.278653468361157000000000000000,0.294625507645715000000000000000,0.311111065642452000000000000000,0.328090939455693000000000000000,0.345542529770487000000000000000,0.363439594667802000000000000000,0.381752747899152000000000000000,0.400449058025762000000000000000,0.419492260209973000000000000000,0.438843126313668000000000000000,0.458459416647719000000000000000,0.478295985438578000000000000000,0.498305503110738000000000000000,0.518438179828263000000000000000,0.538642504565039000000000000000,0.558865594131836000000000000000,0.579053306795471000000000000000,0.599151086777235000000000000000,0.619104122880539000000000000000,0.638857815771724000000000000000,0.658358458481038000000000000000,0.677553584366236000000000000000,0.696392305241026000000000000000,0.714826044930909000000000000000,0.732808788519859000000000000000,0.750297637857153000000000000000,0.767252840469215000000000000000,0.783638536854628000000000000000,0.799423073031810000000000000000,0.814578486172380000000000000000,0.829081814464901000000000000000,0.842914224718520000000000000000,0.856061784054115000000000000000,0.868514982056019000000000000000,0.880268985313666000000000000000,0.891323421471368000000000000000,0.901682153994239000000000000000,0.911353224775040000000000000000,0.920348419759477000000000000000,0.928683141579872000000000000000,0.936376034502292000000000000000,0.943448570973194000000000000000,0.949924731799648000000000000000,0.955830689950577000000000000000,0.961194276495881000000000000000,0.966044726527294000000000000000,0.970412260818434000000000000000,0.974327695231791000000000000000,0.977822074590333000000000000000,0.980926430451191000000000000000,0.983671429186012000000000000000,0.986087072622550000000000000000,0.988202518372260000000000000000,0.990045800750474000000000000000,0.991643749663706000000000000000,0.993021758976086000000000000000,0.994203739035142000000000000000,0.995212001250006000000000000000,0.996067230993009000000000000000,0.996788466633002000000000000000,0.997393090381519000000000000000,0.997896872599435000000000000000,0.998314006753347000000000000000,0.998657176451572000000000000000,0.998937635556803000000000000000,0.999165286302675000000000000000,0.999348785511623000000000000000,0.999495635960190000000000000000,0.999612290212276000000000000000,0.999704255031274000000000000000,0.999776190362342000000000000000,0.999832007214173000000000000000,0.999874959948381000000000000000,0.999907732553278000000000000000,0.999932519529119000000000000000,0.999951098146747000000000000000,0.999964894621099000000000000000,0.999975042376996000000000000000,0.999982433282298000000000000000,0.999987762049658000000000000000,0.999991564199853000000000000000, + +// b1 +3.967033482189860000000000000000,3.966071598170450000000000000000,3.965081773646280000000000000000,3.964063199371980000000000000000,3.963015054450190000000000000000,3.961936487332910000000000000000,3.960826615929470000000000000000,3.959684553935640000000000000000,3.958509370411140000000000000000,3.957300112551720000000000000000,3.956055808187760000000000000000,3.954775448051170000000000000000,3.953458009724340000000000000000,3.952102424459920000000000000000,3.950707602332880000000000000000,3.949272418128150000000000000000,3.947795729343890000000000000000,3.946276349034510000000000000000,3.944713050777200000000000000000,3.943104597370600000000000000000,3.941449693560520000000000000000,3.939747027816180000000000000000,3.937995228684510000000000000000,3.936192921959340000000000000000,3.934338659835870000000000000000,3.932430980453570000000000000000,3.930468360828530000000000000000,3.928449260971590000000000000000,3.926372081631310000000000000000,3.924235172967370000000000000000,3.922036870363820000000000000000,3.919775429873040000000000000000,3.917449097119120000000000000000,3.915056040487720000000000000000,3.912594389374030000000000000000,3.910062206420350000000000000000,3.907457558663380000000000000000,3.904778388655110000000000000000,3.902022630388580000000000000000,3.899188158146940000000000000000,3.896272774293780000000000000000,3.893274251050760000000000000000,3.890190249194550000000000000000,3.887018454753800000000000000000,3.883756410029400000000000000000,3.880401649119030000000000000000,3.876951605285490000000000000000,3.873403670395470000000000000000,3.869755166747000000000000000000,3.866003335392940000000000000000,3.862145383868520000000000000000,3.858178382752080000000000000000,3.854099412295960000000000000000,3.849905418554240000000000000000,3.845593303123310000000000000000,3.841159866718590000000000000000,3.836601845584080000000000000000,3.831915936201840000000000000000,3.827098693209370000000000000000,3.822146612218740000000000000000,3.817056120214990000000000000000,3.811823543184590000000000000000,3.806445131397120000000000000000,3.800917061719950000000000000000,3.795235371504450000000000000000,3.789396075666290000000000000000,3.783395032346430000000000000000,3.777228105532050000000000000000,3.770890963111110000000000000000,3.764379216964560000000000000000,3.757688426123140000000000000000,3.750813987170680000000000000000,3.743751251374920000000000000000,3.736495449566250000000000000000,3.729041719090060000000000000000,3.721385108283850000000000000000,3.713520536438890000000000000000,3.705442921802260000000000000000,3.697146929878400000000000000000,3.688627236020540000000000000000,3.679878430384790000000000000000,3.670894913435210000000000000000,3.661671079852530000000000000000,3.652201181323800000000000000000,3.642479334294510000000000000000,3.632499659230980000000000000000,3.622256145484940000000000000000,3.611742584042100000000000000000,3.600952837933170000000000000000,3.589880611355590000000000000000,3.578519492695920000000000000000,3.566862997369200000000000000000,3.554904642522170000000000000000,3.542637700956430000000000000000,3.530055534461910000000000000000,3.517151349251090000000000000000,3.503918315864400000000000000000,3.490349529646000000000000000000,3.476437951983300000000000000000,3.462176739363260000000000000000,3.447558693638350000000000000000,3.432576749704150000000000000000,3.417223855277330000000000000000,3.401492680632660000000000000000,3.385376254475610000000000000000,3.368867325818390000000000000000,3.351958693558690000000000000000,3.334643327074970000000000000000,3.316913885263290000000000000000,3.298763443578290000000000000000,3.280184856390620000000000000000,3.261171084089440000000000000000,3.241715315743660000000000000000,3.221810652468520000000000000000,3.201450449535530000000000000000,3.180627872213590000000000000000,3.159336697310650000000000000000,3.137570432290960000000000000000,3.115322981595590000000000000000,3.092588421998200000000000000000,3.069360798693930000000000000000,3.045634813127700000000000000000,3.021405208497460000000000000000,2.996666853466050000000000000000,2.971415147099320000000000000000,2.945645697006850000000000000000,2.919354631414780000000000000000,2.892538114099400000000000000000,2.865193096091830000000000000000,2.837316662279080000000000000000,2.808906770830920000000000000000,2.779961446041940000000000000000,2.750479430563100000000000000000,2.720459982303280000000000000000,2.689903011125050000000000000000,2.658809209925270000000000000000,2.627179468020070000000000000000,2.595015891996140000000000000000,2.562321137254010000000000000000,2.529098324043430000000000000000,2.495352016648940000000000000000,2.461086906269960000000000000000,2.426309232294310000000000000000,2.391025643059480000000000000000,2.355243928139770000000000000000,2.318972923520440000000000000000,2.282222221122640000000000000000,2.245003057665530000000000000000,2.207326994102820000000000000000,2.169207143073740000000000000000,2.130657609512810000000000000000,2.091694122432500000000000000000,2.052332869473070000000000000000,2.012591460511630000000000000000,1.972489193085750000000000000000,1.932046352227370000000000000000,1.891284046824350000000000000000,1.850225517467940000000000000000,1.808894443442060000000000000000,1.767316444140310000000000000000,1.725517989296560000000000000000,1.683526667273600000000000000000,1.641372303814570000000000000000,1.599084583169820000000000000000,1.556695328054890000000000000000,1.514237098915210000000000000000,1.471744034098560000000000000000,1.429250820418960000000000000000,1.386793365058360000000000000000,1.344408612255430000000000000000,1.302134566646490000000000000000,1.260009492639830000000000000000,1.218073004754590000000000000000,1.176364801186850000000000000000,1.134925462243710000000000000000,1.093795943788980000000000000000,1.053017361644420000000000000000,1.012631096731080000000000000000,0.972678462753104000000000000000,0.933200608287723000000000000000,0.894238863354069000000000000000,0.855833513351410000000000000000,0.818024653791738000000000000000,0.780851735938396000000000000000,0.744352948444269000000000000000,0.708565509855335000000000000000,0.673525678856731000000000000000,0.639267760605051000000000000000,0.605824958476150000000000000000,0.573228497932786000000000000000,0.541507527700213000000000000000,0.510689415442825000000000000000,0.480798944873432000000000000000,0.451858629176645000000000000000,0.423888556388324000000000000000,0.396905968441230000000000000000,0.370925338440070000000000000000,0.345958442667148000000000000000,0.322013902759242000000000000000,0.299097373660380000000000000000,0.277211307557855000000000000000,0.256355357369746000000000000000,0.236525847975935000000000000000,0.217715778308292000000000000000,0.199915750085903000000000000000,0.183112684517274000000000000000,0.167291083552773000000000000000,0.152432312506896000000000000000,0.138515286279969000000000000000,0.125516270439138000000000000000,0.113409175890776000000000000000,0.102165817437249000000000000000,0.091755953510471400000000000000,0.082147702989241400000000000000,0.073307600638999400000000000000,0.065200896215655700000000000000,0.057791871564358200000000000000,0.051044042901494300000000000000,0.044920350022800500000000000000,0.039383564427277500000000000000,0.034396402709336800000000000000,0.029921811013169600000000000000,0.025923222790015200000000000000,0.022364796271818500000000000000,0.019211533040953700000000000000,0.016429517313042500000000000000,0.013986110772290900000000000000,0.011850036464975500000000000000,0.009991573776262640000000000000,0.008382563807780720000000000000,0.006996576659065250000000000000,0.005808902474049970000000000000,0.004796619689822470000000000000,0.003938582350970370000000000000,0.003215408358781770000000000000,0.002609461992584920000000000000,0.002104788117744180000000000000,0.001687060261202450000000000000,0.001343500269242290000000000000,0.001062787937499430000000000000,0.000834975104727819000000000000,0.000651373578932398000000000000,0.000504459461542728000000000000,0.000387766170055980000000000000,0.000295777773793009000000000000,0.000223828424143332000000000000,0.000168003369955191000000000000,0.000125045915176920000000000000,0.000092270639375065300000000000,0.000067482178553169500000000000,0.000048902750050285600000000000,0.000035105841055312200000000000,0.000024957856588586900000000000,0.000017566833424837700000000000,0.000012238006505035000000000000,0.000008435826833623310000000000, + +// b2 +-5.901507993305770000000000000000,-5.898646470680350000000000000000,-5.895702551888220000000000000000,-5.892673893230720000000000000000,-5.889558120674580000000000000000,-5.886352773622450000000000000000,-5.883055305545730000000000000000,-5.879663162503670000000000000000,-5.876173663362290000000000000000,-5.872584067800710000000000000000,-5.868891584061040000000000000000,-5.865093316690630000000000000000,-5.861186337995070000000000000000,-5.857167590033230000000000000000,-5.853033959674050000000000000000,-5.848782237220410000000000000000,-5.844409170234680000000000000000,-5.839911383605940000000000000000,-5.835285394864500000000000000000,-5.830527699676940000000000000000,-5.825634632575610000000000000000,-5.820602491194920000000000000000,-5.815427407928240000000000000000,-5.810105519581040000000000000000,-5.804632758854660000000000000000,-5.799005031011630000000000000000,-5.793218075802780000000000000000,-5.787267598510590000000000000000,-5.781149146280180000000000000000,-5.774858134782850000000000000000,-5.768389954684960000000000000000,-5.761739782738650000000000000000,-5.754902785694780000000000000000,-5.747873925059770000000000000000,-5.740648070910420000000000000000,-5.733219921778790000000000000000,-5.725584214783350000000000000000,-5.717735349190510000000000000000,-5.709667728024240000000000000000,-5.701375609737500000000000000000,-5.692853074388610000000000000000,-5.684094147710580000000000000000,-5.675092565598130000000000000000,-5.665842175348720000000000000000,-5.656336444666660000000000000000,-5.646568859432130000000000000000,-5.636532656147150000000000000000,-5.626220997687420000000000000000,-5.615626893961910000000000000000,-5.604743170976010000000000000000,-5.593562612301350000000000000000,-5.582077662425780000000000000000,-5.570280854947530000000000000000,-5.558164399429990000000000000000,-5.545720444885060000000000000000,-5.532940920633590000000000000000,-5.519817645577190000000000000000,-5.506342403294110000000000000000,-5.492506652836820000000000000000,-5.478301771985700000000000000000,-5.463719034326520000000000000000,-5.448749521641130000000000000000,-5.433384201876310000000000000000,-5.417613941277680000000000000000,-5.401429321919460000000000000000,-5.384820981853170000000000000000,-5.367779239043870000000000000000,-5.350294560457970000000000000000,-5.332356995877380000000000000000,-5.313956583418030000000000000000,-5.295083365432430000000000000000,-5.275727087383200000000000000000,-5.255877537064230000000000000000,-5.235524341735970000000000000000,-5.214657053517820000000000000000,-5.193265171558810000000000000000,-5.171338040457530000000000000000,-5.148865217525420000000000000000,-5.125835782915990000000000000000,-5.102239082367200000000000000000,-5.078064473404210000000000000000,-5.053301049556690000000000000000,-5.027938161385650000000000000000,-5.001965050823600000000000000000,-4.975370887785960000000000000000,-4.948145165367430000000000000000,-4.920277343813770000000000000000,-4.891756685018680000000000000000,-4.862573002882100000000000000000,-4.832716051420050000000000000000,-4.802175659851740000000000000000,-4.770941865750600000000000000000,-4.739005131534640000000000000000,-4.706355705089200000000000000000,-4.672984528644430000000000000000,-4.638882605077030000000000000000,-4.604041336593770000000000000000,-4.568452439662530000000000000000,-4.532107812746190000000000000000,-4.495000415470490000000000000000,-4.457122854780520000000000000000,-4.418468678478560000000000000000,-4.379032078903670000000000000000,-4.338807171149100000000000000000,-4.297789644137740000000000000000,-4.255975147112520000000000000000,-4.213360156246380000000000000000,-4.169942294552100000000000000000,-4.125719145844650000000000000000,-4.080690096258190000000000000000,-4.034854759535390000000000000000,-3.988213814887900000000000000000,-3.940769320622640000000000000000,-3.892523955134850000000000000000,-3.843481867811710000000000000000,-3.793647623063240000000000000000,-3.743028137615170000000000000000,-3.691630581594940000000000000000,-3.639463979871610000000000000000,-3.586538680454010000000000000000,-3.532865892209650000000000000000,-3.478459280600780000000000000000,-3.423333537725850000000000000000,-3.367504586498300000000000000000,-3.310990491154230000000000000000,-3.253810714610610000000000000000,-3.195986798986100000000000000000,-3.137541278069140000000000000000,-3.078499304209600000000000000000,-3.018887190767440000000000000000,-2.958733967707420000000000000000,-2.898069615554840000000000000000,-2.836926411731510000000000000000,-2.775338443242590000000000000000,-2.713341828472350000000000000000,-2.650974905543790000000000000000,-2.588276983944840000000000000000,-2.525290304892190000000000000000,-2.462058603907010000000000000000,-2.398626874754720000000000000000,-2.335043132622730000000000000000,-2.271355785080030000000000000000,-2.207616184018730000000000000000,-2.143876359662990000000000000000,-2.080190235389710000000000000000,-2.016613282507850000000000000000,-1.953201849969740000000000000000,-1.890014523347840000000000000000,-1.827109672085620000000000000000,-1.764547361085810000000000000000,-1.702388193365570000000000000000,-1.640694113182000000000000000000,-1.579526327669830000000000000000,-1.518946645096620000000000000000,-1.459017606315030000000000000000,-1.399801165183160000000000000000,-1.341358254664600000000000000000,-1.283750424558560000000000000000,-1.227037165318340000000000000000,-1.171277780148280000000000000000,-1.116529624269770000000000000000,-1.062848264783000000000000000000,-1.010288639898580000000000000000,-0.958901814049270000000000000000,-0.908737629145466000000000000000,-0.859842746899179000000000000000,-0.812261438214263000000000000000,-0.766034215375601000000000000000,-0.721198439013713000000000000000,-0.677787943764967000000000000000,-0.635832911120868000000000000000,-0.595358970578429000000000000000,-0.556388191841953000000000000000,-0.518937804551764000000000000000,-0.483020926818412000000000000000,-0.448646087493456000000000000000,-0.415817086471718000000000000000,-0.384533151775046000000000000000,-0.354788771963903000000000000000,-0.326573765740716000000000000000,-0.299873679274791000000000000000,-0.274669125965782000000000000000,-0.250936625329160000000000000000,-0.228648537569252000000000000000,-0.207772991946629000000000000000,-0.188274405658706000000000000000,-0.170113815029783000000000000000,-0.153248726155874000000000000000,-0.137633955117236000000000000000,-0.123221591565854000000000000000,-0.109961400958499000000000000000,-0.097801379642000400000000000000,-0.086687859521777000000000000000,-0.076566082785523700000000000000,-0.067380565588866500000000000000,-0.059075380419101400000000000000,-0.051594602511330100000000000000,-0.044882716519754500000000000000,-0.038884857588839400000000000000,-0.033547214598951400000000000000,-0.028817290889225800000000000000,-0.024644275969563800000000000000,-0.020979178785275700000000000000,-0.017775060046644600000000000000,-0.014987365174653500000000000000,-0.012573845711671100000000000000,-0.010494864988597900000000000000,-0.008713353711074950000000000000,-0.007194931699958140000000000000,-0.005907875304356520000000000000,-0.004823115441084370000000000000,-0.003914195344733000000000000000,-0.003157183126730920000000000000,-0.002530591914903230000000000000,-0.002015251616792630000000000000,-0.001594183825246760000000000000,-0.001252462657091730000000000000,-0.000977060368398598000000000000,-0.000756689192314092000000000000,-0.000581649430124070000000000000,-0.000443667194753577000000000000,-0.000335743040365440000000000000,-0.000252005054932787000000000000,-0.000187569042104979000000000000,-0.000138406125668871000000000000,-0.000101223389677336000000000000,-0.000073354235450546400000000000,-0.000052658761582968300000000000,-0.000037436829947437200000000000,-0.000026350265996818200000000000,-0.000018357031854816200000000000,-0.000012653755482383900000000000,-0.000008627835168297240000000000,-0.000005817161600765750000000000,-0.000003877069092646370000000000,-0.000002553484459029480000000000,-0.000001661299882723900000000000,-0.000001067314621848180000000000,-0.000000676872365045288000000000,-0.000000423569325035356000000000,-0.000000261443784568212000000000,-0.000000159107827249201000000000,-0.000000095429755627492200000000,-0.000000056385975989956300000000,-0.000000032806684301230600000000,-0.000000018787186295432800000000,-0.000000010584424618612800000000,-0.000000005863680338412540000000,-0.000000003192701584006260000000,-0.000000001707691658355700000000,-0.000000000896804610930264000000,-0.000000000462157528575316000000,-0.000000000233585477061177000000,-0.000000000115722613715999000000,-0.000000000056163301206479300000,-0.000000000026686190387579600000, + +// b3 +3.901913300809180000000000000000,3.899075705835610000000000000000,3.896157121888640000000000000000,3.893155287675980000000000000000,3.890067916048790000000000000000,3.886892638521350000000000000000,3.883627006198430000000000000000,3.880268567818360000000000000000,3.876814751430460000000000000000,3.873262932079530000000000000000,3.869610439791490000000000000000,3.865854508229520000000000000000,3.861992345738910000000000000000,3.858021038839730000000000000000,3.853937626866130000000000000000,3.849739061515410000000000000000,3.845422260465120000000000000000,3.840984028930260000000000000000,3.836421075355270000000000000000,3.831730096282130000000000000000,3.826907639560120000000000000000,3.821950227464110000000000000000,3.816854230863750000000000000000,3.811616037001960000000000000000,3.806231844885270000000000000000,3.800697839959370000000000000000,3.795010059053790000000000000000,3.789164520068960000000000000000,3.783157101283530000000000000000,3.776983568568600000000000000000,3.770639680818450000000000000000,3.764121005616830000000000000000,3.757423120304720000000000000000,3.750541421711190000000000000000,3.743471238935830000000000000000,3.736207756207250000000000000000,3.728746219636490000000000000000,3.721081570594750000000000000000,3.713208781124990000000000000000,3.705122710439380000000000000000,3.696818073632500000000000000000,3.688289564304990000000000000000,3.679531626994390000000000000000,3.670538849550480000000000000000,3.661305487376170000000000000000,3.651825852334100000000000000000,3.642094054915630000000000000000,3.632104177149760000000000000000,3.621850197905420000000000000000,3.611325965502350000000000000000,3.600525337079870000000000000000,3.589441894669060000000000000000,3.578069361562790000000000000000,3.566401206430130000000000000000,3.554430900640670000000000000000,3.542151768210450000000000000000,3.529557094384830000000000000000,3.516640200894450000000000000000,3.503394172252590000000000000000,3.489812093084510000000000000000,3.475887029851860000000000000000,3.461611951251240000000000000000,3.446979807040350000000000000000,3.431983543869040000000000000000,3.416615936538340000000000000000,3.400869916133320000000000000000,3.384738217955150000000000000000,3.368213831106180000000000000000,3.351289467972720000000000000000,3.333957953745140000000000000000,3.316212246273770000000000000000,3.298045158642020000000000000000,3.279449684409590000000000000000,3.260418813164960000000000000000,3.240945617219200000000000000000,3.221023278801360000000000000000,3.200645002351120000000000000000,3.179804362598900000000000000000,3.158494671311460000000000000000,3.136709673984680000000000000000,3.114443320630580000000000000000,3.091689519812410000000000000000,3.068442626138790000000000000000,3.044697111259720000000000000000,3.020447606535140000000000000000,2.995689271170430000000000000000,2.970417474353290000000000000000,2.944627655009100000000000000000,2.918316009064250000000000000000,2.891478942196630000000000000000,2.864113201021560000000000000000,2.836216000590900000000000000000,2.807785223838150000000000000000,2.778818859160070000000000000000,2.749315816299360000000000000000,2.719275368910680000000000000000,2.688697461047960000000000000000,2.657582637331040000000000000000,2.625931933785150000000000000000,2.593747646978350000000000000000,2.561032107768800000000000000000,2.527788809173590000000000000000,2.494022147175720000000000000000,2.459736805890030000000000000000,2.424939167999180000000000000000,2.389635935433750000000000000000,2.353834867470640000000000000000,2.317545041135970000000000000000,2.280775853591450000000000000000,2.243538552351410000000000000000,2.205844913327270000000000000000,2.167707928379740000000000000000,2.129142043745860000000000000000,2.090162523940390000000000000000,2.050786125581240000000000000000,2.011030227878630000000000000000,1.970914359038990000000000000000,1.930458493292230000000000000000,1.889684296197230000000000000000,1.848614666370130000000000000000,1.807273346098530000000000000000,1.765686113507480000000000000000,1.723879630218150000000000000000,1.681881562209060000000000000000,1.639721216219580000000000000000,1.597428921727920000000000000000,1.555036477260100000000000000000,1.512576288562520000000000000000,1.470082492124140000000000000000,1.427589821317560000000000000000,1.385134645830140000000000000000,1.342753633198000000000000000000,1.300484623581450000000000000000,1.258366195364890000000000000000,1.216437725769890000000000000000,1.174739415690100000000000000000,1.133311358294800000000000000000,1.092194745516500000000000000000,1.051430800324840000000000000000,1.011060534824620000000000000000,0.971125764992068000000000000000,0.931667330356831000000000000000,0.892726588107833000000000000000,0.854343891917203000000000000000,0.816559236879542000000000000000,0.779411933224564000000000000000,0.742940110723131000000000000000,0.707181397324695000000000000000,0.672171416730157000000000000000,0.637944789993209000000000000000,0.604534393089851000000000000000,0.571971705542068000000000000000,0.540285633412479000000000000000,0.509503174482374000000000000000,0.479649410163040000000000000000,0.450746789172625000000000000000,0.422814911353885000000000000000,0.395871298929759000000000000000,0.369930118373542000000000000000,0.345003080252037000000000000000,0.321098658710001000000000000000,0.298222232837942000000000000000,0.276376632064672000000000000000,0.255560851269960000000000000000,0.235771270286404000000000000000,0.217000964431316000000000000000,0.199240154303359000000000000000,0.182475838465762000000000000000,0.166692201685778000000000000000,0.151870658146754000000000000000,0.137990002030325000000000000000,0.125026325742849000000000000000,0.112953572774483000000000000000,0.101743361213313000000000000000,0.091365458107128700000000000000,0.081787878449522600000000000000,0.072977101887186500000000000000,0.064898371201904000000000000000,0.057515899552651800000000000000,0.050793139473341500000000000000,0.044693116350748600000000000000,0.039178507180742700000000000000,0.034212057676425500000000000000,0.029756767913454400000000000000,0.025776073193760100000000000000,0.022234125039711900000000000000,0.019096003791807100000000000000,0.016327828330873700000000000000,0.013897014190634600000000000000,0.011772354641030300000000000000,0.009924154395914780000000000000,0.008324354899812490000000000000,0.006946571898567780000000000000,0.005766174201482040000000000000,0.004760308446015570000000000000,0.003907895179379590000000000000,0.003189624233032670000000000000,0.002587925784974220000000000000,0.002086910791736590000000000000,0.001672313963361250000000000000,0.001331413147946220000000000000,0.001052948695549360000000000000,0.000827019675337683000000000000,0.000644985172088643000000000000,0.000499368391783699000000000000,0.000383738440495019000000000000,0.000292616222613767000000000000,0.000221366109311616000000000000,0.000166101337364087000000000000,0.000123589079070386000000000000,0.000091164257899909300000000000,0.000066649494500620300000000000,0.000048281724700061200000000000,0.000034647052168741100000000000,0.000024622210118488700000000000,0.000017323702356431800000000000,0.000012063693502966700000000000,0.000008312185226981310000000000,0.000005665123896203200000000000,0.000003817904634230090000000000,0.000002543425916610960000000000,0.000001674339967133610000000000,0.000001088797197205440000000000,0.000000699157235596333000000000,0.000000443165642726319000000000,0.000000277175238864774000000000,0.000000170990077104675000000000,0.000000104001374159771000000000,0.000000062342141394869600000000,0.000000036813797678387300000000,0.000000021406063434187400000000,0.000000012250738587940600000000,0.000000006897407341466220000000,0.000000003818561668919760000000,0.000000002077726728011600000000,0.000000001110536774082280000000,0.000000000582780708861179000000,0.000000000300104014120066000000,0.000000000151563034113502000000,0.000000000075027394890391800000,0.000000000036383175233380000000,0.000000000017273105811911600000,0.000000000008023407189833140000,0.000000000003644095659082310000,0.000000000001617248008024670000,0.000000000000700851050432323000,0.000000000000296369834160607000,0.000000000000122204879036951000,0.000000000000049098769415006800,0.000000000000019206458900486200,0.000000000000007309368622044380,0.000000000000002704071456780160,0.000000000000000971632139611585,0.000000000000000338813313105965,0.000000000000000114554474251522,0.000000000000000037520013493121, + +// b4 +-0.967438794306997000000000000000,-0.966500838501938000000000000000,-0.965536349453924000000000000000,-0.964544600332301000000000000000,-0.963524857133442000000000000000,-0.962476360431465000000000000000,-0.961398325780827000000000000000,-0.960289969569520000000000000000,-0.959150470055350000000000000000,-0.957978989816296000000000000000,-0.956774678485071000000000000000,-0.955536655930253000000000000000,-0.954264035797225000000000000000,-0.952955893825992000000000000000,-0.951611292586048000000000000000,-0.950229268289584000000000000000,-0.948808848586757000000000000000,-0.947349026899173000000000000000,-0.945848767764415000000000000000,-0.944307034908335000000000000000,-0.942722746451790000000000000000,-0.941094815569569000000000000000,-0.939422109357859000000000000000,-0.937703504129613000000000000000,-0.935937818476906000000000000000,-0.934123870824948000000000000000,-0.932260435383559000000000000000,-0.930346284910294000000000000000,-0.928380151431556000000000000000,-0.926360735468545000000000000000,-0.924286740814177000000000000000,-0.922156814555366000000000000000,-0.919969613133265000000000000000,-0.917723740510612000000000000000,-0.915417785390211000000000000000,-0.913050296430034000000000000000,-0.910619850016006000000000000000,-0.908124931205075000000000000000,-0.905564043456707000000000000000,-0.902935662314158000000000000000,-0.900238225738219000000000000000,-0.897470174445492000000000000000,-0.894629878558533000000000000000,-0.891715765443343000000000000000,-0.888726165979564000000000000000,-0.885659441230796000000000000000,-0.882513899550369000000000000000,-0.879287853189413000000000000000,-0.875979594783008000000000000000,-0.872587389238952000000000000000,-0.869109519381542000000000000000,-0.865544195259802000000000000000,-0.861889688972084000000000000000,-0.858144208085859000000000000000,-0.854305979244894000000000000000,-0.850373200867268000000000000000,-0.846344078900702000000000000000,-0.842216851730967000000000000000,-0.837989703651575000000000000000,-0.833660841803934000000000000000,-0.829228491279497000000000000000,-0.824690870821789000000000000000,-0.820046219033309000000000000000,-0.815292800464620000000000000000,-0.810428853324758000000000000000,-0.805452694627948000000000000000,-0.800362609975290000000000000000,-0.795156996768504000000000000000,-0.789834198096736000000000000000,-0.784392626956994000000000000000,-0.778830773524423000000000000000,-0.773147119459689000000000000000,-0.767340241239344000000000000000,-0.761408753691942000000000000000,-0.755351338494531000000000000000,-0.749166753947938000000000000000,-0.742853809130087000000000000000,-0.736411473006753000000000000000,-0.729838679817278000000000000000,-0.723134545934313000000000000000,-0.716298299890278000000000000000,-0.709329208262521000000000000000,-0.702226726519947000000000000000,-0.694990399157244000000000000000,-0.687619874195223000000000000000,-0.680115016043031000000000000000,-0.672475809445753000000000000000,-0.664702318484025000000000000000,-0.656794894676608000000000000000,-0.648754012045916000000000000000,-0.640580307446458000000000000000,-0.632274619065884000000000000000,-0.623838045464213000000000000000,-0.615271778411825000000000000000,-0.606577344581951000000000000000,-0.597756439546841000000000000000,-0.588811017474003000000000000000,-0.579743269262737000000000000000,-0.570555589620974000000000000000,-0.561250798196664000000000000000,-0.551831781739079000000000000000,-0.542301818408226000000000000000,-0.532664498557427000000000000000,-0.522923546344856000000000000000,-0.513083217368266000000000000000,-0.503147901467763000000000000000,-0.493122327951237000000000000000,-0.483011631663735000000000000000,-0.472821068621919000000000000000,-0.462556435047212000000000000000,-0.452223692515149000000000000000,-0.441829150923964000000000000000,-0.431379523287794000000000000000,-0.420881742813852000000000000000,-0.410343135227705000000000000000,-0.399771174665926000000000000000,-0.389173878860525000000000000000,-0.378559343082417000000000000000,-0.367936057243970000000000000000,-0.357312769622021000000000000000,-0.346698372564952000000000000000,-0.336102193522157000000000000000,-0.325533680847738000000000000000,-0.315002420557974000000000000000,-0.304518278680937000000000000000,-0.294091226847634000000000000000,-0.283731433869262000000000000000,-0.273449035321881000000000000000,-0.263254387944972000000000000000,-0.253157774182770000000000000000,-0.243169630324048000000000000000,-0.233300208238949000000000000000,-0.223559762932773000000000000000,-0.213958429848338000000000000000,-0.204506218837158000000000000000,-0.195212998606191000000000000000,-0.186088270711628000000000000000,-0.177141420110625000000000000000,-0.168381460252015000000000000000,-0.159816969008212000000000000000,-0.151456289755794000000000000000,-0.143307141733793000000000000000,-0.135376922665040000000000000000,-0.127672384597829000000000000000,-0.120199761539186000000000000000,-0.112964698088530000000000000000,-0.105972151853478000000000000000,-0.099226524957382700000000000000,-0.092731382050800800000000000000,-0.086489649708746700000000000000,-0.080503487803068700000000000000,-0.074774365917502400000000000000,-0.069302872772281600000000000000,-0.064088858629174400000000000000,-0.059131454876034600000000000000,-0.054428980612448100000000000000,-0.049978943537690800000000000000,-0.045778198682063700000000000000,-0.041822783474235300000000000000,-0.038108101063030300000000000000,-0.034628844496444000000000000000,-0.031379067609784400000000000000,-0.028352309330781400000000000000,-0.025541463582971700000000000000,-0.022939002184025600000000000000,-0.020536931927642400000000000000,-0.018326906778052900000000000000,-0.016300233864614200000000000000,-0.014447977456550500000000000000,-0.012761013797587300000000000000,-0.011230096968456600000000000000,-0.009845897329116840000000000000,-0.008599106111698820000000000000,-0.007480456805361260000000000000,-0.006480811548458840000000000000,-0.005591203106199600000000000000,-0.004802884705606330000000000000,-0.004107381800390300000000000000,-0.003496529797545960000000000000,-0.002962511790835340000000000000,-0.002497895097827790000000000000,-0.002095642465522400000000000000,-0.001749144164766310000000000000,-0.001452226492571050000000000000,-0.001199156005068160000000000000,-0.000984645884059421000000000000,-0.000803853057332975000000000000,-0.000652365890788833000000000000,-0.000526197377811481000000000000,-0.000421765573000616000000000000,-0.000335875269465439000000000000,-0.000265697496107741000000000000,-0.000208744027457426000000000000,-0.000162843473142213000000000000,-0.000126115017196543000000000000,-0.000096941682546154300000000000,-0.000073944528008393100000000000,-0.000055957173394240000000000000,-0.000042000893047342300000000000,-0.000031261544648558200000000000,-0.000023067673727618300000000000,-0.000016870564946222700000000000,-0.000012225720625126800000000000,-0.000008776465546161670000000000,-0.000006239475413289330000000000,-0.000004391710999469700000000000,-0.000003059505309136040000000000,-0.000002108959247063990000000000,-0.000001437973393529520000000000,-0.000000969527516995158000000000,-0.000000646178959945180000000000,-0.000000425581255464707000000000,-0.000000276883480436512000000000,-0.000000177885984438156000000000,-0.000000112812196638481000000000,-0.000000070595057463288900000000,-0.000000043573964094702000000000,-0.000000026517971208200100000000,-0.000000015904959271248700000000,-0.000000009397668321212650000000,-0.000000005467793880569670000000,-0.000000003131205254273040000000,-0.000000001764070769768800000000,-0.000000000977281821004985000000,-0.000000000532118211740761000000,-0.000000000284615961604719000000,-0.000000000149467884959283000000,-0.000000000077026254762552700000,-0.000000000038931006569814800000,-0.000000000019287125502863200000,-0.000000000009360572736631610000,-0.000000000004447709105776710000,-0.000000000002067764991425190000,-0.000000000000939982474706208000,-0.000000000000417546243032049000,-0.000000000000181118968958474000,-0.000000000000076664369453846100,-0.000000000000031643347278081500,-0.000000000000012726561071166700,-0.000000000000004983638141969650,-0.000000000000001898690346926380,-0.000000000000000703202796998929,-0.000000000000000252967729420080,-0.000000000000000088316063564998,-0.000000000000000029896625967795,-0.000000000000000009804399136092,-0.000000000000000003111945680753,-0.000000000000000000955076308641,-0.000000000000000000283148427903,-0.000000000000000000081005855556,-0.000000000000000000022340514172,-0.000000000000000000005933043923,-0.000000000000000000001515615975,-0.000000000000000000000371992315,-0.000000000000000000000087619900,-0.000000000000000000000019782021 \ No newline at end of file diff --git a/filterCutoffFrequenciesMoogLadder.inc b/filterCutoffFrequenciesMoogLadder.inc new file mode 100644 index 0000000..a78632d --- /dev/null +++ b/filterCutoffFrequenciesMoogLadder.inc @@ -0,0 +1,3 @@ +// Cutoff frequencies for Moog Ladder type lowpass filter in 256 steps + +27.50,28.31,29.14,29.99,30.87,31.77,32.70,33.66,34.65,35.66,36.71,37.78,38.89,40.03,41.20,42.41,43.65,44.93,46.25,47.60,49.00,50.44,51.91,53.43,55.00,56.61,58.27,59.98,61.74,63.54,65.41,67.32,69.30,71.33,73.42,75.57,77.78,80.06,82.41,84.82,87.31,89.87,92.50,95.21,98.00,100.87,103.83,106.87,110.00,113.22,116.54,119.96,123.47,127.09,130.81,134.65,138.59,142.65,146.83,151.13,155.56,160.12,164.81,169.64,174.61,179.73,185.00,190.42,196.00,201.74,207.65,213.74,220.00,226.45,233.08,239.91,246.94,254.18,261.63,269.29,277.18,285.30,293.66,302.27,311.13,320.24,329.63,339.29,349.23,359.46,369.99,380.84,392.00,403.48,415.30,427.47,440.00,452.89,466.16,479.82,493.88,508.36,523.25,538.58,554.37,570.61,587.33,604.54,622.25,640.49,659.26,678.57,698.46,718.92,739.99,761.67,783.99,806.96,830.61,854.95,880.00,905.79,932.33,959.65,987.77,1016.71,1046.50,1077.17,1108.73,1141.22,1174.66,1209.08,1244.51,1280.97,1318.51,1357.15,1396.91,1437.85,1479.98,1523.34,1567.98,1613.93,1661.22,1709.90,1760.00,1811.57,1864.66,1919.29,1975.53,2033.42,2093.01,2154.33,2217.46,2282.44,2349.32,2418.16,2489.02,2561.95,2637.02,2714.29,2793.83,2875.69,2959.96,3046.69,3135.96,3227.86,3322.44,3419.79,3520.00,3623.14,3729.31,3838.59,3951.07,4066.84,4186.01,4308.67,4434.92,4564.88,4698.64,4836.32,4978.03,5123.90,5274.04,5428.58,5587.65,5751.38,5919.91,6093.38,6271.93,6455.71,6644.88,6839.59,7040.00,7246.29,7458.62,7677.18,7902.14,8133.69,8372.02,8617.34,8869.85,9129.75,9397.27,9672.64,9956.07,10247.80,10548.09,10857.17,11175.31,11502.77,11839.83,12186.76,12543.86,12911.42,13289.75,13679.17,14080.01,14492.58,14917.25,15354.35,15804.27,16267.37,16744.04,17234.68,17739.69,18259.51,18794.55,19345.28,19912.13,20495.60,21096.17,21714.34,22350.62,23005.54,23679.65,24373.52,25087.72,25822.84,26579.51,27358.35,28160.01,28985.16,29834.49,30708.71,31608.55,32534.75,33488.09,34469.36,35479.39,36519.02,37589.11,38690.55,39824.27,40991.21,42192.34,43428.68 \ No newline at end of file diff --git a/keywords.txt b/keywords.txt new file mode 100644 index 0000000..259a48b --- /dev/null +++ b/keywords.txt @@ -0,0 +1,91 @@ +####################################### +# Syntax Coloring Map For MMM Library +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +Music KEYWORD1 +MotorA KEYWORD1 +MotorB KEYWORD1 +MotionA KEYWORD1 +MotionB KEYWORD1 +Midi KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +init KEYWORD2 +checkMidi KEYWORD2 +enableEnvelope KEYWORD2 +disableEnvelope KEYWORD2 +setEnvStage KEYWORD2 +setDetune KEYWORD2 +setDetune1 KEYWORD2 +setDetune2 KEYWORD2 +setDetune3 KEYWORD2 +setFrequency KEYWORD2 +setFrequency1 KEYWORD2 +setFrequency2 KEYWORD2 +setFrequency3 KEYWORD2 +setSemitone1 KEYWORD2 +setSemitone2 KEYWORD2 +setSemitone3 KEYWORD2 +setWaveform KEYWORD2 +setWaveform1 KEYWORD2 +setWaveform2 KEYWORD2 +setWaveform3 KEYWORD2 +setGain KEYWORD2 +setGain1 KEYWORD2 +setGain2 KEYWORD2 +setGain3 KEYWORD2 +getGain KEYWORD2 +getGain1 KEYWORD2 +getGain2 KEYWORD2 +getGain3 KEYWORD2 +noteOn KEYWORD2 +noteOff KEYWORD2 +getNoteFrequency KEYWORD2 +setAttack KEYWORD2 +setDecay KEYWORD2 +setSustain KEYWORD2 +setRelease KEYWORD2 +update_position KEYWORD2 +update_mass_spring_damper KEYWORD2 +torque KEYWORD2 +direction KEYWORD2 +stop KEYWORD2 +start KEYWORD2 +restart KEYWORD2 +setFM2 KEYWORD2 + + +####################################### +# Constants (LITERAL1) +####################################### + +NUM_OSCILLATORS LITERAL1 +BIT_DEPTH LITERAL1 +MIDI LITERAL1 +MIDI_CHANNEL LITERAL1 +FM LITERAL1 +CFO LITERAL1 + +SINE LITERAL1 +SQUARE LITERAL1 +PULSE LITERAL1 +TRIANGLE LITERAL1 +SAW LITERAL1 +FUZZ LITERAL1 +DIGI1 LITERAL1 +DIGI2 LITERAL1 +DIGI3 LITERAL1 +DIGI4 LITERAL1 +NOISE LITERAL1 +DIGI6 LITERAL1 +TAN1 LITERAL1 +TAN2 LITERAL1 +TAN3 LITERAL1 +TAN4 LITERAL1 \ No newline at end of file diff --git a/uCFO.h b/uCFO.h new file mode 100644 index 0000000..6996b39 --- /dev/null +++ b/uCFO.h @@ -0,0 +1,67 @@ +/* + M3T3.h - Motors, Music and Motion library for Teensy 3.1 + Copyright (c) 2013 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: Jakob Bak + + contact: j.bak@ciid.dk + */ + +#ifndef UCFO_h // include guard +#define UCFO_h + +#include +#include +#include "Sequencer.h" +#include "uSynth.h" + + +/////////////////////////////////////////////////////////////////////// +// THE BELOW FUNCTIONS ARE NEEDED FOR THE MUSIC PART TO RESPOND TO MIDI +/////////////////////////////////////////////////////////////////////// + +void OnNoteOn(byte channel, byte note, byte velocity) { + if(channel == MIDI_CHANNEL) { + Midi.noteOn(channel, note, velocity); + } + channel = channel - 1; + MIDI_SERIAL.write(byte(0x90 | (channel & 0x0F))); + MIDI_SERIAL.write(0x7F & note); + MIDI_SERIAL.write(0x7F & velocity); +} + +void OnNoteOff(byte channel, byte note, byte velocity) { + if(channel == MIDI_CHANNEL) { + Midi.noteOff(channel, note, velocity); + } + channel = channel - 1; + MIDI_SERIAL.write(byte(0x80 | (channel & 0x0F))); + MIDI_SERIAL.write(0x7F & note); + MIDI_SERIAL.write(0x7F & velocity); +} + +void OnControlChange(byte channel, byte control, byte value) { + if(channel == MIDI_CHANNEL) { + Midi.controller(channel, control, value); + } + channel = channel - 1; + MIDI_SERIAL.write(byte(0xB0 | (channel & 0x0F))); + MIDI_SERIAL.write(0x7F & control); + MIDI_SERIAL.write(0x7F & value); +} + +#endif // close guard UCFO_h diff --git a/uSynth.cpp b/uSynth.cpp new file mode 100644 index 0000000..02e6980 --- /dev/null +++ b/uSynth.cpp @@ -0,0 +1,2375 @@ +/* + Synth.cpp - Friction Music library + Copyright (c) 2013 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: Jakob Bak + + contact: j.bak@ciid.dk + */ + +#include "uSynth.h" + +IntervalTimer synthTimer; + +MMusic Music; + +MMidi Midi; + + + +const uint16_t sineTable[] = { +#include +}; + +const uint16_t waveTable[] = { +#include +}; + +// Table of MIDI note values to frequency in Hertz +const float hertzTable[] = { +#include +}; + +uint8_t sequencer[128]; +uint8_t instrument[128]; +uint8_t userPresets[MAX_PRESETS][PRESET_SIZE]; + +bool commandFlags[128]; + + +const uint8_t programPresets[] = { +#include +}; + + + +int64_t filterSamplesLP24dB[4]; +int64_t filterSamplesHP24dB[8]; +int64_t filterSamplesMoogLadder[4]; + +const int64_t filterCoefficient[] = { +#include +}; + +const float fcMoog[] = { +#include +}; + +float filterCoefficientsMoogLadderFloat[8][256]; +// T = 1 / samplerate +// [0] wd = 2 * PI() * fc +// [1] wa = (2/T) * tan(wd*T/2) +// [2] g = wa * (T/2) +// [3] gg = g * g +// [4] ggg = g * g * g +// [5] G = g * g * g * g +// [6] Gstage = g / (1.0 + g) +// [7] nothing yet + +const int64_t filterCoefficientsMoogLadder[] = { +#include +}; + + +// Used in the functions that set the envelope timing +const uint32_t envTimeTable[] = {1,5,9,14,19,26,34,42,53,65,79,95,113,134,157,182,211,243,278,317,359,405,456,511,570,633,702,776,854,939,1029,1124,1226,1333,1448,1568,1695,1829,1971,2119,2274,2438,2610,2789,2977,3172,3377,3590,3813,4044,4285,4535,4795,5065,5345,5635,5936,6247,6569,6902,7247,7602,7970,8349,8740,9143,9559,9986,10427,10880,11347,11827,12321,12828,13349,13883,14433,14996,15574,16167,16775,17398,18036,18690,19359,20045,20746,21464,22198,22949,23716,24501,25303,26122,26959,27813,28686,29577,30486,31413,32359,33325,34309,35312,36335,37378,38440,39522,40625,41748,42892,44056,45241,46448,47675,48925,50196,51489,52803,54141,55500,56883,58288,59716,61167,62642,64140,65662}; + +const float semitoneTable[] = {0.25,0.2648658,0.2806155,0.29730177,0.31498027,0.33370996,0.35355338,0.37457678,0.39685026,0.4204482,0.44544938,0.47193715,0.5,0.5297315,0.561231,0.59460354,0.62996054,0.6674199,0.70710677,0.74915355,0.7937005,0.8408964,0.8908987,0.9438743,1.0,1.0594631,1.122462,1.1892071,1.2599211,1.3348398,1.4142135,1.4983071,1.587401,1.6817929,1.7817974,1.8877486,2.0,2.1189263,2.244924,2.3784142,2.5198421,2.6696796,2.828427,2.9966142,3.174802,3.3635857,3.563595,3.7754972,4.0}; + +const extern uint32_t portamentoTimeTable[] = {1,5,9,13,17,21,26,30,35,39,44,49,54,59,64,69,74,79,85,90,96,101,107,113,119,125,132,138,144,151,158,165,172,179,187,194,202,210,218,226,234,243,252,261,270,279,289,299,309,320,330,341,353,364,376,388,401,414,427,440,455,469,484,500,516,532,549,566,584,602,622,642,663,684,706,729,753,778,804,831,859,888,919,951,984,1019,1056,1094,1134,1176,1221,1268,1317,1370,1425,1484,1547,1614,1684,1760,1841,1929,2023,2125,2234,2354,2484,2627,2785,2959,3152,3368,3611,3886,4201,4563,4987,5487,6087,6821,7739,8918,10491,12693,15996,21500,32509,65535}; + +void MMusic::generateFilterCoefficientsMoogLadder() { + + for(int i=0; i<256; i++) { + float T = 1.0f/float(SAMPLE_RATE); + float wd = 2.0f * PI * fcMoog[i]; + float wa = (2.0f/T) * tan(wd*T/2.0f); + // float g = tan(wd*T/2.0f); + float g = wa * (T/2.0f); + float gg = g * g; + float ggg = g * g * g; + float G = g * g * g * g; + float Gstage = g / (1.0 + g); + + filterCoefficientsMoogLadderFloat[0][i] = wd; + filterCoefficientsMoogLadderFloat[1][i] = wa; + filterCoefficientsMoogLadderFloat[2][i] = g; + filterCoefficientsMoogLadderFloat[3][i] = gg; + filterCoefficientsMoogLadderFloat[4][i] = ggg; + filterCoefficientsMoogLadderFloat[5][i] = G; + filterCoefficientsMoogLadderFloat[6][i] = Gstage; + filterCoefficientsMoogLadderFloat[7][i] = 0; + } + +} + +////////////////////////////////////////////////////////// +// +// SYNTH INTERRUPT +// +////////////////////////////////////////////////////////// + +void synth_isr(void) { + +// Music.output2T3DAC(); + Music.output2DAC(); + + Music.envelope1(); + Music.envelope2(); + if(Music.is12bit) Music.synthInterrupt12bitSineFM(); +// if(Music.is12bit) Music.synthInterrupt12bitSawFM(); + else Music.synthInterrupt8bitFM(); + + Music.amplifier(); + + if(Music.lowpass) Music.filterLP6dB(); + if(Music.highpass) Music.filterHP6dB(); + if(Music.lowpass24dB) Music.filterLP24dB(); + if(Music.highpass24dB) Music.filterHP24dB(); + if(Music.moogLadder) Music.filterMoogLadder(); + +// iSeq.iSeqUpdate(); + +} + + +void MMusic::set12bit(bool b) { + is12bit = b; +} + + + + +///////////////////////////////////////////////////////// +// +// 8 BIT OSCILLATOR - WAVETABLE - 16 WAVEFORMS +// +///////////////////////////////////////////////////////// + + + +void MMusic::synthInterrupt8bitFM () +{ + + dPhase1 = dPhase1 + (period1 - dPhase1) / portamento; + modulator1 = (fmAmount1 * fmOctaves1 * (*osc1modSource_ptr))>>10; + modulator1 = (modulator1 * (*osc1modShape_ptr))>>16; + modulator1 = (modulator1 * int64_t(dPhase1))>>16; + modulator1 = (modulator1>>((modulator1>>31)&zeroFM)); + accumulator1 = accumulator1 + dPhase1 + modulator1; + index1 = accumulator1 >> 24; + oscil1 = waveTable[index1 + waveForm1]; + oscil1 -= 128; + oscil1 <<= 8; + sample = (oscil1 * gain1); + + dPhase2 = dPhase2 + (period2 - dPhase2) / portamento; + modulator2 = (fmAmount2 * fmOctaves2 * (*osc2modSource_ptr))>>10; + modulator2 = (modulator2 * (*osc2modShape_ptr))>>16; + modulator2 = (modulator2 * int64_t(dPhase2))>>16; + modulator2 = (modulator2>>((modulator2>>31)&zeroFM)); + accumulator2 = accumulator2 + dPhase2 + modulator2; + index2 = accumulator2 >> 24; + oscil2 = waveTable[index2 + waveForm2]; + oscil2 -= 128; + oscil2 <<= 8; + sample += (oscil2 * gain2); + + dPhase3 = dPhase3 + (period3 - dPhase3) / portamento; + modulator3 = (fmAmount3 * fmOctaves3 * (*osc3modSource_ptr))>>10; + modulator3 = (modulator3 * (*osc3modShape_ptr))>>16; + modulator3 = (modulator3 * int64_t(dPhase3))>>16; + modulator3 = (modulator3>>((modulator3>>31)&zeroFM)); + accumulator3 = accumulator3 + dPhase3 + modulator3; + index3 = accumulator3 >> 24; + oscil3 = waveTable[index3 + waveForm3]; + oscil3 -= 128; + oscil3 <<= 8; + sample += (oscil3 * gain3); + + sample >>= 18; + +} + + + + + +///////////////////////////////////////////////////////// +// +// 12 BIT OSCILLATOR - SINETABLE +// +///////////////////////////////////////////////////////// + + +void MMusic::synthInterrupt12bitSineFM() +{ + + dPhase1 = dPhase1 + (period1 - dPhase1) / portamento; + modulator1 = (fmAmount1 * fmOctaves1 * (*osc1modSource_ptr))>>10; + modulator1 = (modulator1 * (*osc1modShape_ptr))>>16; + modulator1 = (modulator1 * int64_t(dPhase1))>>16; + modulator1 = (modulator1>>((modulator1>>31)&zeroFM)); + accumulator1 = accumulator1 + dPhase1 + modulator1; + index1 = accumulator1 >> 20; + oscil1 = sineTable[index1]; + index1 = accumulator1 >> 20; + oscil1 -= 32768; + sample = (oscil1 * gain1); + + dPhase2 = dPhase2 + (period2 - dPhase2) / portamento; + modulator2 = (fmAmount2 * fmOctaves2 * (*osc2modSource_ptr))>>10; + modulator2 = (modulator2 * (*osc2modShape_ptr))>>16; + modulator2 = (modulator2 * int64_t(dPhase2))>>16; + modulator2 = (modulator2>>((modulator2>>31)&zeroFM)); + accumulator2 = accumulator2 + dPhase2+ modulator2; + index2 = accumulator2 >> 20; + oscil2 = sineTable[index2]; + oscil2 -= 32768; + sample += (oscil2 * gain2); + + dPhase3 = dPhase3 + (period3 - dPhase3) / portamento; + modulator3 = (fmAmount3 * fmOctaves3 * (*osc3modSource_ptr))>>10; + modulator3 = (modulator3 * (*osc3modShape_ptr))>>16; + modulator3 = (modulator3 * int64_t(dPhase3))>>16; + modulator3 = (modulator3>>((modulator3>>31)&zeroFM)); + accumulator3 = accumulator3 + dPhase3 + modulator3; + index3 = accumulator3 >> 20; + oscil3 = sineTable[index3]; + oscil3 -= 32768; + sample += (oscil3 * gain3); + + sample >>= 18; + +} + + +void MMusic::synthInterrupt12bitSawFM() +{ + + dPhase1 = dPhase1 + (period1 - dPhase1) / portamento; + modulator1 = (fmAmount1 * fmOctaves1 * (*osc1modSource_ptr))>>10; + modulator1 = (modulator1 * (*osc1modShape_ptr))>>16; + modulator1 = (modulator1 * int64_t(dPhase1))>>16; + modulator1 = (modulator1>>((modulator1>>31)&zeroFM)); + accumulator1 = accumulator1 + dPhase1 + modulator1; + // index1 = accumulator1 >> 20; + // oscil1 = sineTable[index1]; + oscil1 = accumulator1 >> 16; + oscil1 -= 32768; + sample = (oscil1 * gain1); + + dPhase2 = dPhase2 + (period2 - dPhase2) / portamento; + modulator2 = (fmAmount2 * fmOctaves2 * (*osc2modSource_ptr))>>10; + modulator2 = (modulator2 * (*osc2modShape_ptr))>>16; + modulator2 = (modulator2 * int64_t(dPhase2))>>16; + modulator2 = (modulator2>>((modulator2>>31)&zeroFM)); + accumulator2 = accumulator2 + dPhase2+ modulator2; + // index2 = accumulator2 >> 20; + // oscil2 = sineTable[index2]; + oscil2 = accumulator2 >> 16; + oscil2 -= 32768; + sample += (oscil2 * gain2); + + dPhase3 = dPhase3 + (period3 - dPhase3) / portamento; + modulator3 = (fmAmount3 * fmOctaves3 * (*osc3modSource_ptr))>>10; + modulator3 = (modulator3 * (*osc3modShape_ptr))>>16; + modulator3 = (modulator3 * int64_t(dPhase3))>>16; + modulator3 = (modulator3>>((modulator3>>31)&zeroFM)); + accumulator3 = accumulator3 + dPhase3 + modulator3; + // index3 = accumulator3 >> 20; + // oscil3 = sineTable[index3]; + oscil3 = accumulator3 >> 16; + oscil3 -= 32768; + sample += (oscil3 * gain3); + + sample >>= 18; + +} + + + +///////////////////////////////////////////////////////// +// +// ENVELOPES +// +///////////////////////////////////////////////////////// + + +void MMusic::envelope1() { + + if(envelopeOn1) { + + // Attack + if(env1Stage == 1) { + env1 += 1; // to make sure the envelope increases when (MAX_ENV_GAIN-env1) is smaller than attack1 + env1 += (MAX_ENV_GAIN - env1)/attack1; + if(velPeak1 < env1) { + env1 = velPeak1; + env1Stage = 2; + } + } + // Decay + else if(env1Stage == 2) { + env1 += -1; // to make sure the envelope decreases when (velSustain1-env1) is smaller than decay1 + env1 += (velSustain1-env1)/decay1; + if(env1 < velSustain1 || MAX_ENV_GAIN < env1) { + env1 = velSustain1; + env1Stage = 3; + } + } + // Sustain + else if (env1Stage == 3) { + env1 = velSustain1; + } + + // Release + else if (env1Stage == 4) { + env1 += -1; // to make sure the envelope decreases when (0-env1) is smaller than release1 + env1 += (0 - env1) / release1; + if(env1 < 0 || MAX_ENV_GAIN < env1) { + env1 = 0; + env1Stage = 0; + } + } + + // No gain + else if (env1Stage == 0) { + env1 = 0; + } + + } else { + env1 = 65535; + } + +} + + + +void MMusic::envelope2() { + + if(envelopeOn2) { + + // Attack + if(env2Stage == 1) { + env2 += 1; // to make sure the envelope increases when (MAX_ENV_GAIN-env2) is smaller than attack1 + env2 += (MAX_ENV_GAIN-env2)/attack2; + if(velPeak2 < env2) { + env2 = velPeak2; + env2Stage = 2; + } + } + // Decay + else if(env2Stage == 2) { + env2 += -1; // to make sure the envelope decreases when (velSustain2-env2) is smaller than decay2 + env2 += (velSustain2-env2)/decay2; + if(env2 < velSustain2 || MAX_ENV_GAIN < env2) { + env2 = velSustain2; + env2Stage = 3; + } + } + // Sustain + else if (env2Stage == 3) { + env2 = velSustain2; + } + + // Release + else if (env2Stage == 4) { + env2 += -1; // to make sure the envelope decreases when (0-env2) is smaller than release2 + env2 += (0 - env2) / release2; + if(env2 < 0 || MAX_ENV_GAIN < env2) { + env2 = 0; + env2Stage = 0; + } + } + + // No gain + else if (env2Stage == 0) { + env2 = 0; + //accumulator1 = 0; + //accumulator2 = 0; + //accumulator3 = 0; + } + + } else { + env2 = 65535; + } + +} + + +void MMusic::amplifier() { + + sample = (env1 * sample) >> 16; + +} + + +///////////////////////////////////////////////////////// +// +// SEND SAMPLE TO DAC ON TEENSY 3.1 PIN A14 +// +///////////////////////////////////////////////////////// + + +void MMusic::output2T3DAC() { + sample += 32768; + analogWrite(A14, sample>>4); +} + +void MMusic::output2DAC() { + sample += 32768; + dacSPIA0 = sample >> 8; + dacSPIA0 >>= 4; + dacSPIA0 |= dacSetA; + dacSPIA1 = sample >> 4; + + digitalWriteFast(DAC_CS, LOW); + spi4teensy3::send(dacSPIA0); + spi4teensy3::send(dacSPIA1); + + // while(SPI.transfer(dacSPIB0)); + // while(SPI.transfer(dacSPIB1)); + digitalWriteFast(DAC_CS, HIGH); +} + + + + +///////////////////////////////////// +// +// INITIALIZING FUNCTION +// +///////////////////////////////////// + + +void MMusic::spi_setup() +{ + spi4teensy3::init(0,0,0); + pinMode(DAC_CS, OUTPUT); + Serial.println("SPI set up"); +} + + +void MMusic::getPreset(uint8_t p) +{ +// cli(); + if(p < MAX_PRESETS) { +// Serial.print("GETTING PRESET NUMBER : "); +// Serial.println(p); + for(uint8_t i=2; i<128; i++) { + instrument[i] = userPresets[p][i]; + Midi.controller(Midi.midiChannel, i, instrument[i]); +// Serial.println(userPresets[p][i]); + } + } else { + for(uint8_t i=2; i<128; i++) { + instrument[i] = programPresets[(p-MAX_PRESETS)*PRESET_SIZE + i]; + Midi.controller(Midi.midiChannel, i, instrument[i]); + // Serial.println(userPresets[p][i]); + } + + } + +// sei(); +} + +void MMusic::getRandomizedPreset(uint8_t p, uint8_t r) +{ + + Serial.print("randomize preset "); + Serial.print(p); + Serial.print(" by "); + Serial.print(r); + Serial.println("%"); + + // cli(); + + // load preset values + + if(p < MAX_PRESETS) { + for(uint8_t i=2; i<128; i++) { + instrument[i] = userPresets[p][i]; + } + } else { + for(uint8_t i=2; i<128; i++) { + instrument[i]=programPresets[(p-MAX_PRESETS)*PRESET_SIZE+i]; + } + + } + + // apply randomization + + for(uint8_t i=2; i<128; i++) { + + uint8_t presetValue = instrument[i]; + + int ran = 0; + + // randomization only affects the following settings. + // randomizing all paramaters will make a lot of unusable sounds. + + // 4: cutoff, 70: cutoff mod, 6: fm oct, 8: portamento + if (i==4||i==70||i==6||i==8) { + ran = random(float(r)/100*-127,float(r)/100*127); + } + + // 10: LFO1, 12: detune1, 13: gain1, 15: FM1 + // 20: LFO2, 22: detune2, 23: gain2, 25: FM2 + // 30: LFO3, 32: detune3, 33: gain3, 35: FM3 + if (i==10||i==12||i==13||i==15||i==20||i==22||i==23||i==25||i==30||i==32||i==33||i==35) { + ran = random(float(r)/100*-127,float(r)/100*127); + } + + // 114: attack1, 115: decay1, 116: sustain1, 117: release1 + // 124: attack2, 125: decay2, 126: sustain2, 127: release2 + if (i==114||i==115||i==116||i==117||i==124||i==125||i==126||i==127) { + ran = random(float(r)/100*-127,float(r)/100*127); + } + + uint8_t newVal = constrain(presetValue+ran,0,127); + + if (ran != 0) + { + /* + Serial.print(i); + Serial.print(": preset value "); + Serial.print(presetValue); + Serial.print(" randomized by "); + Serial.print(ran); + Serial.print(" yielding "); + Serial.println(newVal); + */ + } + + instrument[i] = newVal; + + Midi.controller(Midi.midiChannel, i, instrument[i]); + } + + // sei(); + +} + + +#if defined(USB_MIDI) + +void MMusic::sendInstrument() +{ +// Serial.print("SENDING PRESET NUMBER : "); +// Serial.print(p); +// Serial.println(" OVER MIDI"); + cli(); + for(uint8_t i=2; i<128; i++) { + usbMIDI.sendControlChange(i, instrument[i], Midi.midiChannel+1); + } + sei(); +} + +#else + +void MMusic::sendInstrument(){;} + +#endif + + +void MMusic::savePreset(uint8_t p) +{ + if(p < MAX_PRESETS) { + Serial.print("SAVING PRESET NUMBER : "); + Serial.println(p); + for(uint8_t i=0; i<128; i++) { + //Serial.print(i); + //Serial.print(" : "); + userPresets[p][i] = instrument[i]; + //Serial.println(userPresets[p][i]); + //insert code for saving instrument sequence here + cli(); + EEPROM.write(p * PRESET_SIZE + i, instrument[i]); + sei(); + } + } + else { + Serial.println("CAN NOT SAVE PRESET TO EEPROM - COPY/PASTE BELOW TO FILE"); + for(uint8_t i=0; i<128; i++) { + Serial.print(instrument[i]); + Serial.print(", "); + } + } + +} + + +void MMusic::loadAllPresets() +{ + for(uint8_t i=2; i<128; i++) { + for(uint8_t p=0; p>8); + +} + + +void MMusic::setResonance(uint32_t res) +{ + resonance = res; + k = res; +} + + +void MMusic::setCutoffModAmount(int32_t amount) { + if(amount >= 65536) cutoffModAmount = 65535; + else if(amount < -65536) cutoffModAmount = -65536; + else cutoffModAmount = amount; +// cutoffModAmount = amount; +} + +void MMusic::setCutoffModDirection(int32_t direction) { + if(direction >= 0) cutoffModDirection = 1; + else cutoffModDirection = -1; +} + + +void MMusic::filterLP6dB() { + + int64_t mod = (int64_t(cutoffModAmount) * (int64_t(*cutoffModSource_ptr)))>>16; + int64_t c = (mod + int64_t(cutoff)); + if(c > 65535) c = 65535; + else if(c < 0) c = 0; +// c = ((((c * 32768) >> 15) + 65536) >> 1); + + b1 = filterCoefficient[c>>8]; + a0 = BIT_32 - b1; + + sample = (a0 * sample + b1 * lastSampleOutLP) >> 32; + lastSampleOutLP = sample; + +} + + +void MMusic::filterLP24dB() { + + + int64_t mod = (int64_t(cutoffModAmount) * (int64_t(*cutoffModSource_ptr)))>>16; + int64_t c = (mod + int64_t(cutoff)); + if(c > 65535) c = 65535; + else if(c < 0) c = 0; + // c = ((((c * 32768) >> 15) + 65536) >> 1); + + int fc = c>>8; + // if(fc > 220) fc = 220; + + b1 = filterCoefficient[fc]; + a0 = BIT_32 - b1; + + // int64_t res = resonance - (c >> 1); + // k = resonance >> 12; + // x0 = sample + feedbackSample * k; + // x0 = sample + ((feedbackSample * resonance) >> 12); + // feedbackSample = + x0 = (sample << 12) + (feedbackSample * resonance); + x0 >>= 12; + // x0 += 32768; + if(x0 > 30735) { + x0 = (((x0 - 30735) * 4098) >> 16) + 30735; + } + else if(x0 < -30735) { + x0 = (((x0 + 30735) * 4098) >> 16) - 30735; + } + // x0 -= 32768; + // x0 = x0 / (4096 + resonance); + if(x0 > MAX_SAMPLE) x0 = MAX_SAMPLE; + else if(x0 < MIN_SAMPLE) x0 = MIN_SAMPLE; + + y1 = filterSamplesLP24dB[0]; + y2 = filterSamplesLP24dB[1]; + y3 = filterSamplesLP24dB[2]; + y4 = filterSamplesLP24dB[3]; + + y1 = (a0 * x0 + b1 * y1) >> 32; + y2 = (a0 * y1 + b1 * y2) >> 32; + y3 = (a0 * y2 + b1 * y3) >> 32; + y4 = (a0 * y3 + b1 * y4) >> 32; + + filterSamplesLP24dB[0] = y1; + filterSamplesLP24dB[1] = y2; + filterSamplesLP24dB[2] = y3; + filterSamplesLP24dB[3] = y4; + + sample = y4; + + // Feedback of LP output through HP + + a0 = (BIT_32 + b1) >> 1; + a1 = -a0; + + xNew = sample; + xOld = filterSamplesHP24dB[0]; + yOld = filterSamplesHP24dB[4]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x1 = xNew; + y1 = yNew; + + xNew = y1; + xOld = filterSamplesHP24dB[1]; + yOld = filterSamplesHP24dB[5]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x2 = xNew; + y2 = yNew; + + xNew = y2; + xOld = filterSamplesHP24dB[2]; + yOld = filterSamplesHP24dB[6]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x3 = xNew; + y3 = yNew; + + xNew = y3; + xOld = filterSamplesHP24dB[3]; + yOld = filterSamplesHP24dB[7]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x4 = xNew; + y4 = yNew; + + filterSamplesHP24dB[0] = x1; + filterSamplesHP24dB[1] = x2; + filterSamplesHP24dB[2] = x3; + filterSamplesHP24dB[3] = x4; + + filterSamplesHP24dB[4] = y1; + filterSamplesHP24dB[5] = y2; + filterSamplesHP24dB[6] = y3; + filterSamplesHP24dB[7] = y4; + + feedbackSample = y4; +} + + + +void MMusic::filterHP24dB() { + + int64_t mod = (int64_t(cutoffModAmount) * (int64_t(*cutoffModSource_ptr)))>>16; + int64_t c = (mod + int64_t(cutoff)); + if(c > 65535) c = 65535; + else if(c < 0) c = 0; + // c = ((((c * 32768) >> 15) + 65536) >> 1); + + + b1 = filterCoefficient[c>>8]; + a0 = (BIT_32 + b1) >> 1; + a1 = -a0; + + xNew = sample; + xOld = filterSamplesHP24dB[0]; + yOld = filterSamplesHP24dB[4]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x1 = xNew; + y1 = yNew; + + xNew = y1; + xOld = filterSamplesHP24dB[1]; + yOld = filterSamplesHP24dB[5]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x2 = xNew; + y2 = yNew; + + xNew = y2; + xOld = filterSamplesHP24dB[2]; + yOld = filterSamplesHP24dB[6]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x3 = xNew; + y3 = yNew; + + xNew = y3; + xOld = filterSamplesHP24dB[3]; + yOld = filterSamplesHP24dB[7]; + yNew = (a0 * xNew + a1 * xOld + b1 * yOld) >> 32; + x4 = xNew; + y4 = yNew; + + filterSamplesHP24dB[0] = x1; + filterSamplesHP24dB[1] = x2; + filterSamplesHP24dB[2] = x3; + filterSamplesHP24dB[3] = x4; + + filterSamplesHP24dB[4] = y1; + filterSamplesHP24dB[5] = y2; + filterSamplesHP24dB[6] = y3; + filterSamplesHP24dB[7] = y4; + + sample = y4; + +} + + +void MMusic::filterMoogLadder() { + + int64_t mod = (int64_t(cutoffModAmount) * (int64_t(*cutoffModSource_ptr)))>>16; + int64_t c = (mod + int64_t(cutoff)); + if(c > 65535) c = 65535; + else if(c < 0) c = 0; + + int fc = c>>8; + if(fc > 234) fc = 234; + x0 = sample; + u = x0; +// g = filterCoefficientsMoogLadder[fc]; +// gg = filterCoefficientsMoogLadder[256 + fc]; +// ggg = filterCoefficientsMoogLadder[512 + fc]; +// G = filterCoefficientsMoogLadder[768 + fc]; + Gstage = filterCoefficientsMoogLadder[1024 + fc]; + +// // u = (x0 - k * S) / (1 + k * G); // THIS IS THE ORIGINAL EQUATION + +// S = (ggg * z1) >> 16; +// S += (gg * z2) >> 16; +// S += (g * z3) >> 16; +// S += z4 >> 16; +// +// int64_t div = (281474976710656 + (k * G)); // 48bit +// int64_t sub = (k * S); +// u = x0 << 48; +// u = u - sub; +// u = (u / div); + +// S = (ggg * z1) >> 32; +// S += (gg * z2) >> 32; +// S += (g * z3) >> 32; +// S += z4 >> 32; +// +// int64_t div = (BIT_32 + ((k * G) >> 16)); // 32bit +// div = div >> 16; // 16bit +// int64_t sub = (k * S); // 32bit +// u = x0 << 16;// 32bit +// u = u - sub; +// u = (u / div); + +// g = filterCoefficientsMoogLadderFloat[2][fc]; +// gg = filterCoefficientsMoogLadderFloat[3][fc]; +// ggg = filterCoefficientsMoogLadderFloat[4][fc]; +// G = filterCoefficientsMoogLadderFloat[5][fc]; +// Gstage = filterCoefficientsMoogLadderFloat[6][fc]; +// float kfloat = 0.0f; +// float div = (1 + (kfloat * G)); +// u = int64_t(float(u) / div); // FIX // k << 16 + + v1 = ((u - z1) * Gstage) >> 32; + y1 = (v1 + z1); + z1 = y1 + v1; + + v2 = ((y1 - z2) * Gstage) >> 32; + y2 = (v2 + z2); + z2 = y2 + v2; + + v3 = ((y2 - z3) * Gstage) >> 32; + y3 = (v3 + z3); + z3 = y3 + v3; + + v4 = ((y3 - z4) * Gstage) >> 32; + y4 = (v4 + z4); + z4 = y4 + v4; + +// filterSamplesMoogLadder[0] = y1; +// filterSamplesMoogLadder[1] = y2; +// filterSamplesMoogLadder[2] = y3; +// filterSamplesMoogLadder[3] = y4; + + sample = y4; + + +} + +void MMusic::filterHP6dB() { + + sampleInHP = sample; + + int64_t mod = (int64_t(cutoffModAmount) * (int64_t(*cutoffModSource_ptr)))>>16; + int64_t c = (mod + int64_t(cutoff)); + if(c > 65535) c = 65535; + else if(c < 0) c = 0; + // c = ((((c * 32768) >> 15) + 65536) >> 1); + + b1 = filterCoefficient[c>>8]; + a0 = (BIT_32 + b1) >> 1; + a1 = -a0; + + sampleOutHP = (a0 * sampleInHP + a1 * lastSampleInHP + b1 * lastSampleOutHP) >> 32; + + lastSampleInHP = sampleInHP; + lastSampleOutHP = sampleOutHP; + sample = sampleOutHP; + +} + + + +void MMusic::setFilterType(uint8_t type) { + + switch (type) { + case LP6: + lowpass = true; + highpass = false; + lowpass24dB = false; + highpass24dB = false; + moogLadder = false; + break; + case HP6: + lowpass = false; + highpass = true; + lowpass24dB = false; + highpass24dB = false; + moogLadder = false; + break; + case BP6: + lowpass = true; + highpass = true; + lowpass24dB = false; + highpass24dB = false; + moogLadder = false; + break; + case THRU: + lowpass = false; + highpass = false; + lowpass24dB = false; + highpass24dB = false; + moogLadder = false; + break; + case LP24: + lowpass = false; + highpass = false; + lowpass24dB = true; + highpass24dB = false; + moogLadder = false; + break; + case HP24: + lowpass = false; + highpass = false; + lowpass24dB = false; + highpass24dB = true; + moogLadder = false; + break; + case BP24: + lowpass = false; + highpass = false; + lowpass24dB = true; + highpass24dB = true; + moogLadder = false; + break; + case MOOG: + lowpass = false; + highpass = false; + lowpass24dB = false; + highpass24dB = false; + moogLadder = true; + break; + default: + break; + } +} + + +void MMusic::setCutoffModShape(uint8_t shape) { + switch(shape) { + case 0: + cutoffModShape_ptr = &fullSignal; + break; + case 1: + cutoffModShape_ptr = &env1; + break; + case 2: + cutoffModShape_ptr = &env2; + break; + case 3: + cutoffModShape_ptr = &oscil1; + break; + case 4: + cutoffModShape_ptr = &oscil2; + break; + case 5: + cutoffModShape_ptr = &oscil3; + break; + default: + cutoffModShape_ptr = &fullSignal; + break; + } +} + + +void MMusic::setCutoffModSource(uint8_t source) { + switch(source) { + case 0: + cutoffModSource_ptr = &fullSignal; + break; + case 1: + cutoffModSource_ptr = &env1; + break; + case 2: + cutoffModSource_ptr = &env2; + break; + case 3: + cutoffModSource_ptr = &oscil1; + break; + case 4: + cutoffModSource_ptr = &oscil2; + break; + case 5: + cutoffModSource_ptr = &oscil3; + break; + default: + cutoffModSource_ptr = &fullSignal; + break; + } +} + + +void MMusic::setResonanceModShape(uint8_t shape) { + switch(shape) { + case 0: + resonanceModShape_ptr = &fullSignal; + break; + case 1: + resonanceModShape_ptr = &env1; + break; + case 2: + resonanceModShape_ptr = &env2; + break; + case 3: + resonanceModShape_ptr = &oscil1; + break; + case 4: + resonanceModShape_ptr = &oscil2; + break; + case 5: + resonanceModShape_ptr = &oscil3; + break; + default: + resonanceModShape_ptr = &fullSignal; + break; + } +} + + +void MMusic::setResonanceModSource(uint8_t source) { + switch(source) { + case 0: + resonanceModSource_ptr = &fullSignal; + break; + case 1: + resonanceModSource_ptr = &env1; + break; + case 2: + resonanceModSource_ptr = &env2; + break; + case 3: + resonanceModSource_ptr = &oscil1; + break; + case 4: + resonanceModSource_ptr = &oscil2; + break; + case 5: + resonanceModSource_ptr = &oscil3; + break; + default: + resonanceModSource_ptr = &fullSignal; + break; + } +} + + + + +///////////////////////////////////// +// +// FREQUENCY AND DETUNE FUNCTIONS +// +///////////////////////////////////// + +void MMusic::setFrequency(float freq) +{ + frequency = freq; + if(!osc1LFO) setFrequency1(freq); + if(!osc2LFO) setFrequency2(freq); + if(!osc3LFO) setFrequency3(freq); + // period1 = int32_t(((freq * semi1 * (1 + detune1 + bend)) * PERIOD_MAX) / SAMPLE_RATE); + // period2 = int32_t(((freq * semi2 * (1 + detune2 + bend)) * PERIOD_MAX) / SAMPLE_RATE); + // period3 = int32_t(((freq * semi3 * (1 + detune3 + bend)) * PERIOD_MAX) / SAMPLE_RATE); + // frequency1 = freq; + // frequency2 = freq; + // frequency3 = freq; +} + + +void inline MMusic::setFrequency1(float freq) +{ + frequency1 = freq; + period1 = int32_t(((frequency1 * semi1 * (1 + detune1 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void inline MMusic::setFrequency2(float freq) +{ + frequency2 = freq; + period2 = int32_t(((frequency2 * semi2 * (1 + detune2 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void inline MMusic::setFrequency3(float freq) +{ + frequency3 = freq; + period3 = int32_t(((frequency3 * semi3 * (1 + detune3 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setSemitone1(int8_t semi) +{ + if(-25 < semi && semi < 25){ + semi1 = semitoneTable[semi+24]; + } else if (semi < -24) { + semi1 = semitoneTable[0]; + } else { + semi1 = semitoneTable[48]; + } + setFrequency1(frequency1); + // period1 = int32_t(((frequency1 * semi1 * (1 + detune1 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setSemitone2(int8_t semi) +{ + if(-25 < semi && semi < 25){ + semi2 = semitoneTable[semi+24]; + } else if (semi < -24) { + semi2 = semitoneTable[0]; + } else { + semi2 = semitoneTable[48]; + } + setFrequency2(frequency2); +// period2 = int32_t(((frequency2 * semi2 * (1 + detune2 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setSemitone3(int8_t semi) +{ + if(-25 < semi && semi < 25){ + semi3 = semitoneTable[semi+24]; + } else if (semi < -24) { + semi3 = semitoneTable[0]; + } else { + semi3 = semitoneTable[48]; + } + setFrequency3(frequency3); +// period3 = int32_t(((frequency3 * semi3 * (1 + detune3 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setDetune(float detune) +{ + detune1 = 0.0; + detune2 = detune*0.123456789; + detune3 = -detune; + setFrequency2(frequency2); + setFrequency3(frequency3); +// period2 = int32_t(((frequency2 * semi2 * (1 + detune2 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +// period3 = int32_t(((frequency3 * semi3 * (1 + detune3 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setDetune1(float detune) +{ + detune1 = detune; + setFrequency1(frequency1); +// period1 = int32_t(((frequency1 * semi1 * (1 + detune1 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setDetune2(float detune) +{ + detune2 = detune; + setFrequency2(frequency2); +// period2 = int32_t(((frequency2 * semi2 * (1 + detune2 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setDetune3(float detune) +{ + detune3 = detune; + setFrequency3(frequency3); +// period3 = int32_t(((frequency3 * semi3 * (1 + detune3 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::pitchBend(float b) +{ + bend = b; + setFrequency1(frequency1); + setFrequency2(frequency2); + setFrequency3(frequency3); +// period1 = int32_t(((frequency1 * semi1 * (1 + detune1 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +// period2 = int32_t(((frequency2 * semi2 * (1 + detune2 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +// period3 = int32_t(((frequency3 * semi3 * (1 + detune3 + bend)) * PERIOD_MAX) / SAMPLE_RATE); +} + + +void MMusic::setOsc1LFO(bool lfo) { + osc1LFO = lfo; +} + + +void MMusic::setOsc2LFO(bool lfo) { + osc2LFO = lfo; +} + + +void MMusic::setOsc3LFO(bool lfo) { + osc3LFO = lfo; +} + + +void MMusic::setFM1(uint8_t fm) { + fmAmount1 = fm; +} + + +void MMusic::setFM2(uint8_t fm) { + fmAmount2 = fm; +// fmAmount2 = (fm * fmOctaves2); +} + + +void MMusic::setFM3(uint8_t fm) { + fmAmount3 = fm; +// fmAmount3 = (fm * fmOctaves3); +} + + +void MMusic::setFMoctaves(uint8_t octs) { +// fmAmount1 = (fmAmount1 * octs); +// fmAmount2 = (fmAmount2 * octs); +// fmAmount3 = (fmAmount3 * octs); + fmOctaves1 = octs; + fmOctaves2 = octs; + fmOctaves3 = octs; +} + + +void MMusic::setFM1octaves(uint8_t octs) { + if(octs < 1) octs = 1; + fmOctaves1 = octs; +} + + +void MMusic::setFM2octaves(uint8_t octs) { + if(octs < 1) octs = 1; + fmOctaves2 = octs; +} + + +void MMusic::setFM3octaves(uint8_t octs) { + if(octs < 1) octs = 1; + fmOctaves3 = octs; +} + + +void MMusic::setFM1Source(uint8_t source) { + switch(source) { + case 0: + osc1modSource_ptr = &fullSignal; + break; + case 1: + osc1modSource_ptr = &oscil1; + break; + case 2: + osc1modSource_ptr = &oscil2; + break; + case 3: + osc1modSource_ptr = &oscil3; + break; + default: + osc1modSource_ptr = &fullSignal; + break; + } +} + + +void MMusic::setFM2Source(uint8_t source) { + switch(source) { + case 0: + osc2modSource_ptr = &fullSignal; + break; + case 1: + osc2modSource_ptr = &oscil1; + break; + case 2: + osc2modSource_ptr = &oscil2; + break; + case 3: + osc2modSource_ptr = &oscil3; + break; + default: + osc1modSource_ptr = &fullSignal; + break; + } +} + + +void MMusic::setFM3Source(uint8_t source) { + switch(source) { + case 0: + osc3modSource_ptr = &fullSignal; + break; + case 1: + osc3modSource_ptr = &oscil1; + break; + case 2: + osc3modSource_ptr = &oscil2; + break; + case 3: + osc3modSource_ptr = &oscil3; + break; + default: + osc1modSource_ptr = &fullSignal; + break; + } +} + + +void MMusic::setFM1Shape(uint8_t shape) { + switch(shape) { + case 0: + osc1modShape_ptr = &fullSignal; + break; + case 1: + osc1modShape_ptr = &env1; + break; + case 2: + osc1modShape_ptr = &env2; + break; + case 3: + osc1modShape_ptr = &oscil1; + break; + case 4: + osc1modShape_ptr = &oscil2; + break; + case 5: + osc1modShape_ptr = &oscil3; + break; + default: + osc1modShape_ptr = &fullSignal; + break; + } +} + + +void MMusic::setFM2Shape(uint8_t shape) { + switch(shape) { + case 0: + osc2modShape_ptr = &fullSignal; + break; + case 1: + osc2modShape_ptr = &env1; + break; + case 2: + osc2modShape_ptr = &env2; + break; + case 3: + osc2modShape_ptr = &oscil1; + break; + case 4: + osc2modShape_ptr = &oscil2; + break; + case 5: + osc2modShape_ptr = &oscil3; + break; + default: + osc2modShape_ptr = &fullSignal; + break; + } +} + + +void MMusic::setFM3Shape(uint8_t shape) { + switch(shape) { + case 0: + osc3modShape_ptr = &fullSignal; + break; + case 1: + osc3modShape_ptr = &env1; + break; + case 2: + osc3modShape_ptr = &env2; + break; + case 3: + osc3modShape_ptr = &oscil1; + break; + case 4: + osc3modShape_ptr = &oscil2; + break; + case 5: + osc3modShape_ptr = &oscil3; + break; + default: + osc3modShape_ptr = &fullSignal; + break; + } +} + + +void MMusic::fmToZeroHertz(bool zero) { + if(!zero) zeroFM = 1; + else zeroFM = 0; +} + +void MMusic::setPortamento(int32_t port) { + if(port == 0) port = 1; + portamento = port; +// portamento = envTimeTable[uint8_t(port)]; +} + + + +///////////////////////////////////// +// +// WAVEFORM FUNCTIONS +// +///////////////////////////////////// + + +void MMusic::setWaveform(uint16_t waveForm) +{ + waveForm1 = waveForm * 256; + waveForm2 = waveForm * 256; + waveForm3 = waveForm * 256; +} + + +void MMusic::setWaveform1(uint16_t waveForm) +{ + waveForm1 = waveForm * 256; +} + + +void MMusic::setWaveform2(uint16_t waveForm) +{ + waveForm2 = waveForm * 256; +} + + +void MMusic::setWaveform3(uint16_t waveForm) +{ + waveForm3 = waveForm * 256; +} + + + + +///////////////////////////////////// +// +// GAIN FUNCTIONS +// +///////////////////////////////////// + + +void MMusic::setGain(float value) +{ + gain = uint16_t(value * 65535); + gain1 = gain; + gain2 = gain; + gain3 = gain; +} + + +void MMusic::setGain1(float value) +{ + gain1 = uint16_t(value * 65535); +} + + +void MMusic::setGain2(float value) +{ + gain2 = uint16_t(value * 65535); +} + + +void MMusic::setGain3(float value) +{ + gain3 = uint16_t(value * 65535); +} + + +float MMusic::getGain() +{ + return float(gain)/65535.0; +} + + +float MMusic::getGain1() +{ + return float(gain1)/65535.0; +} + + +float MMusic::getGain2() +{ + return float(gain2)/65535.0; +} + + +float MMusic::getGain3() +{ + return float(gain3)/65535.0; +} + + + + +///////////////////////////////////// +// +// NOTE_ON/OFF FUNCTIONS +// +///////////////////////////////////// + + +void MMusic::noteOn(uint8_t note, uint8_t vel) +{ + env1Stage = 1; + env2Stage = 1; + setEnv1VelSustain(vel); + setEnv2VelSustain(vel); + setEnv1VelPeak(vel); + setEnv2VelPeak(vel); + notePlayed = note; + velocityPlayed = vel; + frequency16bit = hertzTable[notePlayed]; + setFrequency(frequency16bit); + //setFrequency1(frequency16bit); + //setFrequency2(frequency16bit); + //setFrequency3(frequency16bit); +} + + +void MMusic::noteOn(uint8_t note) +{ + int vel = 127; + env1Stage = 1; + env2Stage = 1; + setEnv1VelSustain(vel); + setEnv2VelSustain(vel); + setEnv1VelPeak(vel); + setEnv2VelPeak(vel); + notePlayed = note; + velocityPlayed = vel; + frequency16bit = hertzTable[notePlayed]; + setFrequency(frequency16bit); + //setFrequency1(frequency16bit); + //setFrequency2(frequency16bit); + //setFrequency3(frequency16bit); +} + + +void MMusic::noteOff(uint8_t note) +{ + if(notePlayed = note) { + env1Stage = 4; + env2Stage = 4; + } +} + + +void MMusic::noteOff() +{ + env1Stage = 4; + env2Stage = 4; +} + + +float MMusic::getNoteFrequency(uint8_t note) +{ + return hertzTable[note]; +} + + + + +///////////////////////////////////// +// +// ENVELOPE FUNCTIONS +// +///////////////////////////////////// + + +// ENVELOPE 1 + +void MMusic::enableEnvelope1() +{ + envelopeOn1 = true; +} + + +void MMusic::disableEnvelope1() +{ + envelopeOn1 = false; +} + + +void MMusic::setEnv1Stage(uint8_t stage) +{ + env1Stage = stage; +} + + +void MMusic::setEnv1Attack(uint8_t att) +{ + if(att>127) att = 127; + attack1 = envTimeTable[att]; +} + + +void MMusic::setEnv1Decay(uint8_t dec) +{ + if(dec>127) dec = 127; + decay1 = envTimeTable[dec]; +} + + +void MMusic::setEnv1Sustain(uint8_t sus) +{ + sustain1 = ((sus * MAX_ENV_GAIN)/128); +} + + +void MMusic::setEnv1Release(uint8_t rel) +{ + if(rel>127) rel = 127; + release1 = envTimeTable[rel]; +} + + +void MMusic::setEnv1VelSustain(uint8_t vel) +{ + velSustain1 = vel * (sustain1 / 128); +} + + +void MMusic::setEnv1VelPeak(uint8_t vel) +{ + velPeak1 = vel * (MAX_ENV_GAIN / 128); +} + + +// ENVELOPE 2 + +void MMusic::enableEnvelope2() +{ + envelopeOn2 = true; +} + + +void MMusic::disableEnvelope2() +{ + envelopeOn2 = false; +} + + +void MMusic::setEnv2Stage(uint8_t stage) +{ + env2Stage = stage; +} + + +void MMusic::setEnv2Attack(uint8_t att) +{ + if(att>127) att = 127; + attack2 = envTimeTable[att]; +} + + +void MMusic::setEnv2Decay(uint8_t dec) +{ + if(dec>127) dec = 127; + decay2 = envTimeTable[dec]; +} + + +void MMusic::setEnv2Sustain(uint8_t sus) +{ + sustain2 = ((sus * MAX_ENV_GAIN)/128); +} + + +void MMusic::setEnv2Release(uint8_t rel) +{ + if(rel>127) rel = 127; + release2 = envTimeTable[rel]; +} + + +void MMusic::setEnv2VelSustain(uint8_t vel) +{ + velSustain2 = vel * (sustain2 / 128); +} + + +void MMusic::setEnv2VelPeak(uint8_t vel) +{ + velPeak2 = vel * (MAX_ENV_GAIN / 128); +} + + +void MMusic::setCommandFlag(uint8_t flag) +{ + commandFlags[flag] = 1; +// switch(flag) { +// case SEQ_STEP_FORWARD: +// commandFlags[SEQ_STEP_FORWARD] = 1; +// break; +// default: +// break; +// +// } +} + + +void MMusic::clearCommandFlag(uint8_t flag) +{ + commandFlags[flag] = 0; +// switch(flag) { +// case SEQ_STEP_FORWARD: +// commandFlags[SEQ_STEP_FORWARD] = 0; +// break; +// default: +// break; +// +// } +} + + +bool MMusic::checkCommandFlag(uint8_t flag) +{ + return commandFlags[flag]; +// switch(flag) { +// case SEQ_STEP_FORWARD: +// return commandFlags[SEQ_STEP_FORWARD]; +// break; +// default: +// break; +// +// } +} + + + +///////////////////////////////////// +// +// MIDI specific functions +// +///////////////////////////////////// + +bool midiRead = false; + +void MMidi::init() +{ + pinMode(0, INPUT); + Serial.begin(9600); + MIDI_SERIAL.begin(31250); + + midiBufferIndex = 0; + midiChannel = 1; + Serial.println("MIDI intialised on channel 1. Use Midi.setChannel(channel) to set to other channel"); +} + +void MMidi::setChannel(uint8_t channel) +{ + if(channel < 1 || channel > 16) { + Serial.println("MIDI channel must be set to a number between 1 and 16"); + } + else midiChannel = channel - 1; +} + + +void MMidi::checkSerialMidi() +{ + //while(Serial.available() > 32) Serial.read(); +// while(MIDI_SERIAL.available() > 0) { + while(MIDI_SERIAL.available()) { + + data = MIDI_SERIAL.read(); + + if(data & 0x80 && (data & 0x0F) == midiChannel) { // bitmask with 10000000 to see if byte is over 127 (data&0x80) + midiBufferIndex = 0; // and check if the midi channel corresponds to the midiChannel + midiRead = true; // the device is set to listen to. + } else if(data & 0x80) { // Else if the byte is over 127 (but not on the device's + midiRead = false; // midiChannel, don't read this or any following bytes. + } + + if(midiRead) { + midiBuffer[midiBufferIndex] = data; + midiBufferIndex++; + if (midiBufferIndex > 2) { + midiRead = false; + midiHandler(); + Serial.println("MIDI RECEIVED"); + Serial.println(midiBuffer[0], HEX); + Serial.println(midiBuffer[1], HEX); + Serial.println(midiBuffer[2], HEX); + } + } + } +} + + +void MMidi::sendNoteOff(uint8_t note) { + + MIDI_SERIAL.write(0x80 | midiChannel); + MIDI_SERIAL.write(byte(note)); + MIDI_SERIAL.write(0x00); + +} + + +void MMidi::sendNoteOn(uint8_t note, uint8_t vel) { + + MIDI_SERIAL.write(0x90 | midiChannel); + MIDI_SERIAL.write(byte(note)); + MIDI_SERIAL.write(byte(vel)); + +} + +void MMidi::sendController(uint8_t number, uint8_t value) { + + MIDI_SERIAL.write(0xB0 | midiChannel); + MIDI_SERIAL.write(byte(number)); + MIDI_SERIAL.write(byte(value)); + +} + +void MMidi::sendStep() { + MIDI_SERIAL.write(0xB0 | midiChannel); + MIDI_SERIAL.write(byte(CFO_COMMAND)); + MIDI_SERIAL.write(byte(SEQ_STEP_FORWARD)); + +} + + +void MMidi::midiHandler() { + + if(MIDI_THROUGH) { + MIDI_SERIAL.write(midiBuffer[0]); + MIDI_SERIAL.write(midiBuffer[1]); + MIDI_SERIAL.write(midiBuffer[2]); + } +// uint8_t midiChannel = (midiBuffer[0] & 0x0F); + + if((midiBuffer[0] & 0x0F) == midiChannel) { + switch(midiBuffer[0] & 0xF0) { // bit mask with &0xF0 ? + case 0x80: + noteOff (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F, // note value 0-127 + midiBuffer[2] & 0x7F); // note velocity 0-127 + break; + + case 0x90: + noteOn (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F, // note value 0-127 + midiBuffer[2] & 0x7F); // note velocity 0-127 + break; + + case 0xA0: + aftertouch (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F, // note value 0-127 + midiBuffer[2] & 0x7F);// note velocity 0-127 + break; + + case 0xB0: + controller (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F, // controller number 0-127 + midiBuffer[2] & 0x7F);// controller value 0-127 + break; + + case 0xC0: + programChange (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F); // program number 0-127 + break; + + case 0xD0: + channelPressure (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F); // pressure amount 0-127 + break; + + case 0xE0: + pitchWheel (midiBuffer[0] & 0x0F, // midi channel 0-15 + midiBuffer[1] & 0x7F, // higher bits 0-6 + midiBuffer[2] & 0x7F);// lower bits 7-13 + break; + + default: + break; + } + } + else Serial.println("Skipped MIDI message on other channel"); +} + + +void MMidi::noteOff(uint8_t channel, uint8_t note, uint8_t vel) { +// Serial.print("NoteOff received on channel: "); +// Serial.println(channel, HEX); + + Music.noteOff(note); +} + + +void MMidi::noteOn(uint8_t channel, uint8_t note, uint8_t vel) { +// Serial.print("NoteOn received on channel: "); +// Serial.println(channel, HEX); + Music.noteOn(note, vel); +} + + +void MMidi::aftertouch(uint8_t channel, uint8_t note, uint8_t pressure) { + // Write code here for Aftertouch +} + + +void MMidi::controller(uint8_t channel, uint8_t number, uint8_t value) { + + if(value >= 128) value = 127; + instrument[number] = value; +// Serial.print(number); +// Serial.print(" : "); +// Serial.println(instrument[number]); + + switch(number) { + case IS_12_BIT: + if(value) Music.set12bit(true); + else Music.set12bit(false); +// Music.set12bit(value/64); + break; + case PORTAMENTO: + Music.setPortamento(portamentoTimeTable[value]); + break; + case CUTOFF: + Music.setCutoff(value * 512); + break; + case RESONANCE: + Music.setResonance(value * 512); + break; + case FILTER_TYPE: + Music.setFilterType(value); + break; + case CUTOFF_MOD_AMOUNT: + Music.setCutoffModAmount((value-64) * 1024); + // if(value > 63) Music.setCutoffModAmount((value-64) * 512); + // if(value < 64) Music.setCutoffModAmount(() * 512); + break; + // case CUTOFF_MOD_DIRECTION: + // Music.setCutoffModDirection(value); + // break; + case CUTOFF_SOURCE: + Music.setCutoffModSource(value); + break; + case CUTOFF_SHAPE: + Music.setCutoffModShape(value); + break; + case ZERO_HZ_FM: + if(value) Music.fmToZeroHertz(true); + else Music.fmToZeroHertz(false); + break; + case FM_OCTAVES: + Music.setFMoctaves(value+1); + break; + case LFO1: + if(value) { + Music.setOsc1LFO(true); + Music.setFrequency1(Music.getNoteFrequency(value)/1024.0); + } else { + Music.setOsc1LFO(false); + } +// if(Music.osc1LFO) Music.setFrequency1(Music.getNoteFrequency(value)/1024.0); +// else Music.setFrequency1(Music.getNoteFrequency(value)); + break; + case LFO2: + if(value) { + Music.setOsc2LFO(true); + Music.setFrequency2(Music.getNoteFrequency(value)/1024.0); + } else { + Music.setOsc2LFO(false); + } + // if(Music.osc2LFO) Music.setFrequency2(Music.getNoteFrequency(value)/1024.0); +// else Music.setFrequency2(Music.getNoteFrequency(value)); + break; + case LFO3: + if(value) { + Music.setOsc3LFO(true); + Music.setFrequency3(Music.getNoteFrequency(value)/1024.0); + } else { + Music.setOsc3LFO(false); + } + // if(Music.osc3LFO) Music.setFrequency3(Music.getNoteFrequency(value)/1024.0); +// else Music.setFrequency3(Music.getNoteFrequency(value)); + break; + case DETUNE1: + Music.setDetune1(map(value,0,127,-100,100)*0.0005946); + break; + case DETUNE2: + Music.setDetune2(map(value,0,127,-100,100)*0.0005946); + //Music.setDetune2((value-64.0)*0.0005946); + //Music.setDetune2(value/5120.0); + break; + case DETUNE3: + Music.setDetune3(map(value,0,127,-100,100)*0.0005946); + //Music.setDetune3((value-64.0)*0.0005946); + //Music.setDetune3(value/5120.0); + break; + case SEMITONE1: +// if(15 < value && value < 113) { +// int8_t val = (((value-16)/2)-24); +// Music.setSemitone1(val); +// } else if (value < 16) { +// Music.setSemitone1(-24); +// } else { +// Music.setSemitone1(24); +// } + if(40 <= value && value <= 88) { + Music.setSemitone1(value-64); + } else if (value < 40) { + Music.setSemitone1(-24); + } else { + Music.setSemitone1(24); + } + break; + case SEMITONE2: +// if(15 < value && value < 113) { +// int8_t val = (((value-16)/2)-24); +// Music.setSemitone2(val); +// } else if (value < 16) { +// Music.setSemitone2(-24); +// } else { +// Music.setSemitone2(24); +// } + if(40 <= value && value <= 88) { + Music.setSemitone2(value-64); + } else if (value < 40) { + Music.setSemitone2(-24); + } else { + Music.setSemitone2(24); + } + break; + case SEMITONE3: +// if(15 < value && value < 113) { +// int8_t val = (((value-16)/2)-24); +// Music.setSemitone3(val); +// } else if (value < 16) { +// Music.setSemitone3(-24); +// } else { +// Music.setSemitone3(24); +// } + if(40 <= value && value <= 88) { + Music.setSemitone3(value-64); + } else if (value < 40) { + Music.setSemitone3(-24); + } else { + Music.setSemitone3(24); + } + break; + case GAIN1: + Music.setGain1(value / 127.0); + break; + case GAIN2: + Music.setGain2(value / 127.0); + break; + case GAIN3: + Music.setGain3(value / 127.0); + break; + case WAVEFORM1: + Music.setWaveform1(value); + break; + case WAVEFORM2: + Music.setWaveform2(value); + break; + case WAVEFORM3: + Music.setWaveform3(value); + break; + case FM1: + Music.setFM1(value); + break; + case FM2: + Music.setFM2(value); + break; + case FM3: + Music.setFM3(value); + break; +// case FM1_OCTAVES: +// Music.setFM1octaves(value+1); +// break; +// case FM2_OCTAVES: +// Music.setFM2octaves(value+1); +// break; +// case FM3_OCTAVES: +// Music.setFM3octaves(value+1); +// break; + case FM1_SOURCE: + Music.setFM1Source(value); + break; + case FM2_SOURCE: + Music.setFM2Source(value); + break; + case FM3_SOURCE: + Music.setFM3Source(value); + break; + case FM1_SHAPE: + Music.setFM1Shape(value); + break; + case FM2_SHAPE: + Music.setFM2Shape(value); + break; + case FM3_SHAPE: + Music.setFM3Shape(value); + break; + case ENV1_ENABLE: + if(value) Music.enableEnvelope1(); + else Music.disableEnvelope1(); + break; + case ENV1_ATTACK: + Music.setEnv1Attack(value); + break; + case ENV1_DECAY: + Music.setEnv1Decay(value); + break; + case ENV1_SUSTAIN: + Music.setEnv1Sustain(value); + break; + case ENV1_RELEASE: + Music.setEnv1Release(value); + break; + case ENV2_ENABLE: + if(value) Music.enableEnvelope2(); + else Music.disableEnvelope2(); + break; + case ENV2_ATTACK: + Music.setEnv2Attack(value); + break; + case ENV2_DECAY: + Music.setEnv2Decay(value); + break; + case ENV2_SUSTAIN: + Music.setEnv2Sustain(value); + break; + case ENV2_RELEASE: + Music.setEnv2Release(value); + break; + case PRESET_SAVE: + Music.savePreset(value); + break; + case PRESET_RECALL: + Music.getPreset(value); + Music.sendInstrument(); + break; + case CFO_COMMAND: + Music.setCommandFlag(value); + break; + default: + break; + } +} + + +void MMidi::programChange(uint8_t channel, uint8_t number) { + Music.getPreset(number); +} + + +void MMidi::channelPressure(uint8_t channel, uint8_t pressure) { + // Write code here for Channel Pressure +} + + +void MMidi::pitchWheel(uint8_t channel, uint8_t highBits, uint8_t lowBits) { + // Write code here for Pitch Wheel +} + diff --git a/uSynth.h b/uSynth.h new file mode 100644 index 0000000..4cfd9a9 --- /dev/null +++ b/uSynth.h @@ -0,0 +1,683 @@ +/* + Synth.h - Friction Music library + Copyright (c) 2013 Science Friction. + All right reserved. + + This library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your optionosc1modShape_ptr) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser Public License for more details. + + You should have received a copy of the GNU Lesser Public License + along with Foobar. If not, see . + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + author: Jakob Bak + + contact: j.bak@ciid.dk + */ + + +#include +#include +#include "MCP4251.h" +#include +#include + +#ifndef Synth_h // include guard +#define Synth_h + +// Useful bit constants +#define BIT_8 256 +#define BIT_12 4096 +#define BIT_16 65536 +#define BIT_20 1048576 +#define BIT_24 16777216 +#define BIT_28 268435456 +#define BIT_32 4294967296 +#define MAX_SAMPLE 32767 +#define MIN_SAMPLE -32768 + +// Constants for bitvalues within the TCTRL1 register +#define TIE 2 +#define TEN 1 +#define TIF 1 + +// Constants for bitvalues for DAC output A and B +#define DAC_A 0 +#define DAC_B 1 +// Constants for positions for control bits in dacSettings +#define DAC_AB 7 +#define DAC_BUF 6 +#define DAC_GA 5 +#define DAC_SHDN 4 + +// Output pin for cutoff filter on Monotron +#define CUTOFF_PIN 3 + +// Multiplexer Pins (CD4052) +#define MUX_A 8 +#define MUX_B 7 + + +#if defined __MK20DX128__ +#define LP6 0 +#define HP6 1 +#define BP6 2 +#define LP24 4 +#define HP24 5 +#define BP24 6 +#define MOOG 3 +#define THRU 7 + +#else +#define LP6 4 +#define HP6 5 +#define BP6 2 +#define LP24 0 +#define HP24 1 +#define BP24 6 +#define MOOG 3 +#define THRU 7 +#endif + +// SPI pins +#define MCP4251_CS 9 // Digital 9 +#define DAC_CS 10 // Digital 10 + +#define SAMPLE_RATE 48000 +#define CPU_FREQ 96 // in MHz +#define PERIOD_MAX BIT_32 + +// Specify highest and lowest pitch in Hz +#define LOW_PITCH 55 +#define HIGH_PITCH 1000 + +// Shortnames for waveforms +#define SINE 0 +#define SQUARE 1 +#define PULSE 2 +#define TRIANGLE 3 +#define SAW 4 +#define FUZZ 5 +#define DIGI1 6 +#define DIGI2 7 +#define DIGI3 8 +#define DIGI4 9 +#define NOISE 10 +#define DIGI6 11 +#define TAN1 12 +#define TAN2 13 +#define TAN3 14 +#define TAN4 15 + +#define WAVEFORM_TRIANGLE 0 +#define WAVEFORM_SAW 1 +#define WAVEFORM_SQUARE 2 +#define WAVEFORM_ALTERNATE 3 + +// Maximum possible value for amplification envelope in audio code +#define MAX_ENV_GAIN 65535 +#define MIN_ENV_GAIN -65535 + +// MIDI specific constants + +#define MIDI_SERIAL Serial1 +#define MIDI_THROUGH true + +#ifndef MIDI_CHANNEL + #define MIDI_CHANNEL 1 +#elif (MIDI_CHANNEL > 0)&&(MIDI_CHANNEL < 17) +#else + #error MIDI_CHANNEL should be between 1 - 16 +#endif + +// parameters for modulation +#define MOD_FULL 0 +#define MOD_ENV1 1 +#define MOD_ENV2 2 +//#define MOD_ENV0 9 +#define MOD_OSC1 3 +#define MOD_OSC2 4 +#define MOD_OSC3 5 + +// parameters for presets || the two parameters below should multiply to 2048. +#define MAX_PRESETS 16 +#define PRESET_SIZE 128 + +#define BANK_U 0 +#define BANK_A 16 +#define BANK_B 32 +#define BANK_C 48 + +//synth functions and parameters as MIDI controller numbers +#define PRESET_SAVE 0 +#define PRESET_RECALL 1 + +#define IS_12_BIT 3 +#define CUTOFF 4 +#define ZERO_HZ_FM 5 +#define FM_OCTAVES 6 +#define RESONANCE 7 +#define PORTAMENTO 8 +#define FILTER_TYPE 9 + +#define LFO1 10 +#define SEMITONE1 11 +#define DETUNE1 12 +#define GAIN1 13 +#define WAVEFORM1 14 +#define FM1 15 +#define FM1_OCTAVES 16 +#define FM1_SOURCE 17 +#define FM1_SHAPE 18 +#define FREQUENCY1 19 + +#define LFO2 20 +#define SEMITONE2 21 +#define DETUNE2 22 +#define GAIN2 23 +#define WAVEFORM2 24 +#define FM2 25 +#define FM2_OCTAVES 26 +#define FM2_SOURCE 27 +#define FM2_SHAPE 28 +#define FREQUENCY2 29 + +#define LFO3 30 +#define SEMITONE3 31 +#define DETUNE3 32 +#define GAIN3 33 +#define WAVEFORM3 34 +#define FM3 35 +#define FM3_OCTAVES 36 +#define FM3_SOURCE 37 +#define FM3_SHAPE 38 +#define FREQUENCY3 39 + +#define CUTOFF_MOD_AMOUNT 70 +#define CUTOFF_MOD_DIRECTION 71 +#define CUTOFF_SOURCE 72 +#define CUTOFF_SHAPE 73 +#define RESONANCE_MOD_AMOUNT 74 +#define RESONANCE_MOD_DIRECTION 75 +#define RESONANCE_SOURCE 76 +#define RESONANCE_SHAPE 77 + +#define SEQ_WRITE_POSITION 80 +#define SEQ_WRITE_VALUE 81 +#define SEQ_START 82 +#define SEQ_STOP 83 +#define SEQ_PAUSE 84 +#define SEQ_JUMP_POSITION 85 +#define SEQ_BPM 86 +#define SEQ_SYNC 87 +#define SEQ_ON 88 + +#define CFO_COMMAND 90 +#define SEQ_STEP_FORWARD 91 + + +#define ENV0_VELOCITY 102 +#define ENV0_ENABLE 103 +#define ENV0_ATTACK 104 +#define ENV0_DECAY 105 +#define ENV0_SUSTAIN 106 +#define ENV0_RELEASE 107 + +#define ENV1_VELOCITY 112 +#define ENV1_ENABLE 113 +#define ENV1_ATTACK 114 +#define ENV1_DECAY 115 +#define ENV1_SUSTAIN 116 +#define ENV1_RELEASE 117 + +#define ENV2_VELOCITY 122 +#define ENV2_ENABLE 123 +#define ENV2_ATTACK 124 +#define ENV2_DECAY 125 +#define ENV2_SUSTAIN 126 +#define ENV2_RELEASE 127 + + +//int iSeq0,iSeq1; +// +//int iSeq_indx0 = 0; +//int iSeq_indx1 = 0; +//#define ISEQ_NBR_STEPS 32 +//const int iSeq_nbr_notes = 32; +//const int iSeq_nbr_steps = 32; +// +//int iSeq_notes[ISEQ_NBR_STEPS]; +//int iSeq_velocity[ISEQ_NBR_STEPS]; +//int iSeq_midi_numbers[ISEQ_NBR_STEPS]; +//int iSeq_midi_values[ISEQ_NBR_STEPS]; + + +// MMusic class for handling sound engine + +class MMusic { +public: + + // INITIALIZER + void init(); + void spi_setup(); + void set12bit(bool b); + bool is12bit; + + // PRESETS + void getPreset(uint8_t p); + void getRandomizedPreset(uint8_t p, uint8_t r); + void savePreset(uint8_t p); + void sendInstrument(); + void loadAllPresets(); + + // AUDIO INTERRUPT SERVICE ROUTINE + void synthInterrupt8bit(); + void synthInterrupt8bitFM(); + void synthInterrupt12bitSine(); + void synthInterrupt12bitSineFM(); + void synthInterrupt12bitSawFM(); + void phaseDistortionOscillator(); + + void envelope1(); + void envelope2(); + void envelopeRC(); + void amplifier(); + void sendToDAC(); // sending both sound and cutoff + void output2DAC(); // sending only sound + void output2T3DAC(); // sending sample to Teensy3.1 DAC on pin 14 + + // FILTER FUNCTIONS + void filter(); + void filterLP6dB(); + void filterHP6dB(); + void filterLP24dB(); + void filterHP24dB(); + void filterMoogLadder(); + void setCutoff(uint16_t c); +// void setResonance(uint8_t res); + void setResonance(uint32_t res); + void setFilterType(uint8_t type); + void setCutoffModAmount(int32_t amount); + void setCutoffModDirection(int32_t direction); + void setCutoffModSource(uint8_t source); + void setResonanceModSource(uint8_t source); + void setCutoffModShape(uint8_t shape); + void setResonanceModShape(uint8_t shape); + + void generateFilterCoefficientsMoogLadder(); + + bool lowpass; + bool highpass; + bool lowpass24dB; + bool highpass24dB; + bool moogLadder; + + + + // FREQUENCY AND DETUNE FUNCTIONS + void setFrequency(float frequency); + void setFrequency1(float frequency1); + void setFrequency2(float frequency2); + void setFrequency3(float frequency3); + void setSemitone1(int8_t semi); + void setSemitone2(int8_t semi); + void setSemitone3(int8_t semi); + void setDetune(float detune); + void setDetune1(float detune); + void setDetune2(float detune); + void setDetune3(float detune); + void setOsc1LFO(bool lfo); + void setOsc2LFO(bool lfo); + void setOsc3LFO(bool lfo); + void setFM1(uint8_t fm); + void setFM2(uint8_t fm); + void setFM3(uint8_t fm); + void setFMoctaves(uint8_t octs); // THIS SHOULD PROBABLY BE CALLED SOMETHING ELSE + void setFM1octaves(uint8_t octs); + void setFM2octaves(uint8_t octs); + void setFM3octaves(uint8_t octs); + void setFM1Source(uint8_t source); + void setFM2Source(uint8_t source); + void setFM3Source(uint8_t source); + void setFM1Shape(uint8_t shape); + void setFM2Shape(uint8_t shape); + void setFM3Shape(uint8_t shape); + void fmToZeroHertz(bool); // THIS SHOULD PROBABLY BE CALLED SOMETHING ELSE + void pitchBend(float b); // NOT IMPLEMENTED + void setPortamento(int32_t port); + + // WAVEFORM FUNCTIONS + void setWaveform(uint16_t waveForm); // JUST FOR 8bit WAVEFORMS + void setWaveform1(uint16_t waveForm); // + void setWaveform2(uint16_t waveForm); // + void setWaveform3(uint16_t waveForm); // + void setPhaseDistortion(uint16_t pd); + void setPhaseDistortion1(uint16_t pd); + void setPhaseDistortion2(uint16_t pd); + void setPhaseDistortion3(uint16_t pd); + void setWaveformPosition(uint32_t wp); + void setWaveformPosition1(uint32_t wp); + void setWaveformPosition2(uint32_t wp); + void setWaveformPosition3(uint32_t wp); + + int64_t vectorOscillator(int64_t phase, uint32_t wp, uint16_t pd); + + // GAIN FUNCTIONS + void setGain(float value); // 0.0 - 1.0 + void setGain1(float value); // 0.0 - 1.0 + void setGain2(float value); // 0.0 - 1.0 + void setGain3(float value); // 0.0 - 1.0 + float getGain(); // 0.0 - 1.0 + float getGain1(); // 0.0 - 1.0 + float getGain2(); // 0.0 - 1.0 + float getGain3(); // 0.0 - 1.0 + + // NOTE FUNCTIONS + void noteOn(uint8_t note, uint8_t vel); // 0 - 127 + void noteOn(uint8_t note); // 0 - 127 + void noteOff(uint8_t note); // 0 - 127 + void noteOff(); + float getNoteFrequency(uint8_t note); // 0 - 127 + + // ENVELOPE FUNCTIONS + void enableEnvelope1(); + void disableEnvelope1(); + void setEnv1Stage(uint8_t stage1); // 0 - 4 + void setEnv1Attack(uint8_t att); // 0 - 127 + void setEnv1Decay(uint8_t dec); // 0 - 127 + void setEnv1Sustain(uint8_t sus); // 0 - 127 + void setEnv1Release(uint8_t rel); // 0 - 127 + void setEnv1VelSustain(uint8_t vel); // 0 - 127 + void setEnv1VelPeak(uint8_t vel); // 0 - 127 + + void enableEnvelope2(); + void disableEnvelope2(); + void setEnv2Stage(uint8_t stage); // 0 - 4 + void setEnv2Attack(uint8_t att); // 0 - 127 + void setEnv2Decay(uint8_t dec); // 0 - 127 + void setEnv2Sustain(uint8_t sus); // 0 - 127 + void setEnv2Release(uint8_t rel); // 0 - 127 + void setEnv2VelSustain(uint8_t vel); // 0 - 127 + void setEnv2VelPeak(uint8_t vel); // 0 - 127 + + + void setCommandFlag(uint8_t flag); + void clearCommandFlag(uint8_t flag); + bool checkCommandFlag(uint8_t flag); + + bool osc1LFO; + bool osc2LFO; + bool osc3LFO; + + int32_t oscil1; + int32_t oscil2; + int32_t oscil3; + int32_t lastOscil1; + int32_t lastOscil2; + int32_t lastOscil3; + int64_t integralOfOscil1; + int64_t integralOfOscil2; + int64_t integralOfOscil3; + int64_t derivativeOfOscil1; + int64_t derivativeOfOscil2; + int64_t derivativeOfOscil3; + + // NOTE VARIABLE + uint8_t notePlayed; + uint8_t velocityPlayed; + + + +private: + // TIMER VARIABLES + uint32_t sampleRate; + + // WAVEFORM VARIABLES + uint16_t waveForm1; + uint16_t waveForm2; + uint16_t waveForm3; + uint16_t waveForm; + uint16_t waveform; + int64_t waveformVector[5]; + uint16_t phaseDistortion1; + uint16_t phaseDistortion2; + uint16_t phaseDistortion3; + uint32_t waveformPosition1; + uint32_t waveformPosition2; + uint32_t waveformPosition3; +// int16_t waveformVector[8]; + bool sine; + bool saw; + bool square; + + + + // FREQUENCY VARIABLES + uint16_t frequency16bit; + float frequency; + float frequency1; + float frequency2; + float frequency3; + float semi1; + float semi2; + float semi3; + float detune1; + float detune2; + float detune3; + float bend; + + // OSCILLATOR VARIABLES + int32_t period1; + int32_t period2; + int32_t period3; + int32_t portamento; + volatile int32_t dPhase1; + volatile int32_t dPhase2; + volatile int32_t dPhase3; + uint32_t accumulator1; + uint32_t accumulator2; + uint32_t accumulator3; + int32_t vectorAccumulator1; + int32_t vectorAccumulator2; + int32_t vectorAccumulator3; + int32_t index1; + int32_t index2; + int32_t index3; + int32_t fraction1; + int32_t fraction2; + int32_t fraction3; + int64_t modulator1; + int64_t modulator2; + int64_t modulator3; + int32_t fullSignal; + int32_t invertSignal; + int32_t noSignal; + int32_t *osc1modSource_ptr; + int32_t *osc2modSource_ptr; + int32_t *osc3modSource_ptr; + int32_t *amp_modSource_ptr; + int32_t *osc1modShape_ptr; + int32_t *osc2modShape_ptr; + int32_t *osc3modShape_ptr; + int32_t *amp_modShape_ptr; + int32_t zeroFM; + int32_t fmAmount1; + int32_t fmAmount2; + int32_t fmAmount3; + int32_t fmOctaves1; + int32_t fmOctaves2; + int32_t fmOctaves3; + + + int32_t gain; + int32_t gain1; + int32_t gain2; + int32_t gain3; + + // FILTER VARIABLES + + int64_t a0; + int64_t a1; + int64_t a2; + int64_t a3; + int64_t a4; + + int64_t b0; + int64_t b1; + int64_t b2; + int64_t b3; + int64_t b4; + + int64_t x0; + int64_t x1; + int64_t x2; + int64_t x3; + int64_t x4; + + int64_t y0; + int64_t y1; + int64_t y2; + int64_t y3; + int64_t y4; + + int64_t xNew; + int64_t xOld; + int64_t yNew; + int64_t yOld; + int64_t feedbackSample; + + volatile int64_t u; + int64_t g; + int64_t gg; + int64_t ggg; + int64_t G; + int64_t Gstage; + volatile int64_t S; + + volatile int64_t k; + int64_t v1; + int64_t v2; + int64_t v3; + int64_t v4; + int64_t z1; + int64_t z2; + int64_t z3; + int64_t z4; + + uint16_t cutoff; + uint32_t resonance; + + int32_t cutoffModAmount; + int32_t cutoffModDirection; + int32_t *cutoffModSource_ptr; + int32_t *resonanceModSource_ptr; + int32_t *cutoffModShape_ptr; + int32_t *resonanceModShape_ptr; + + + int64_t lastSampleOutLP; + int64_t lastSampleInLP; + int64_t sampleOutLP; + int64_t sampleInLP; + int64_t lastSampleOutHP; + int64_t lastSampleInHP; + int64_t sampleOutHP; + int64_t sampleInHP; + + + // ENVELOPE VARIABLES + bool envelopeOn1; + int32_t env1; + int32_t env1Stage; + int32_t attack1; + int32_t decay1; + int32_t sustain1; + int32_t release1; + int32_t velSustain1; + int32_t velPeak1; + int32_t envTarget; + + bool envelopeOn2; + int32_t env2; + int32_t env2Stage; + int32_t attack2; + int32_t decay2; + int32_t sustain2; + int32_t release2; + int32_t velSustain2; + int32_t velPeak2; + + + + // final sample that goes to the DAC + volatile int64_t sample; + + + // the two bytes that go to the DAC over SPI for VCF and VCA + volatile uint8_t dacSPIA0; + volatile uint8_t dacSPIA1; + volatile uint8_t dacSPIB0; + volatile uint8_t dacSPIB1; + volatile uint8_t dacSetA; + volatile uint8_t dacSetB; + +}; + + +extern MMusic Music; + + +// MMidi class for handling MIDI implementation + +class MMidi { +public: + void init(); + void checkSerialMidi(); + void setChannel(uint8_t channel); + + void midiHandler(); + void noteOff(uint8_t channel, uint8_t note, uint8_t vel); + void noteOn(uint8_t channel, uint8_t note, uint8_t vel); + void aftertouch(uint8_t channel, uint8_t note, uint8_t pressure); + void controller(uint8_t channel, uint8_t number, uint8_t value); + void programChange(uint8_t channel, uint8_t number); + void channelPressure(uint8_t channel, uint8_t pressure); + void pitchWheel(uint8_t channel, uint8_t highBits, uint8_t lowBits); + void pitchChange(uint8_t channel, int pitch); // extra pitchWheel function for USB MIDI interfacing + + void sendNoteOff(uint8_t note); + void sendNoteOn(uint8_t note, uint8_t vel); + void sendController(uint8_t number, uint8_t value); + + void sendStep(); + + void iSeqNote(); + void iSeqController(); + + uint8_t midiChannel; + uint16_t frequency; + uint8_t notePlayed; + uint8_t velocityPlayed; + +private: + + // MIDI + uint8_t data; + uint8_t midiBuffer[3]; + + int midiBufferIndex; +}; + + +extern MMidi Midi; + + +#endif // Close guard Synth_h + +