From bbeefbd9fd7b1e42247767ffd1bb650a71d59a99 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 May 2019 09:51:23 -0500 Subject: [PATCH] updates --- .../ipch/2e3e3b3b9c6760e8/mmap_address.bin | Bin 0 -> 8 bytes M0_Simple_Synth_05/M0_Simple_Synth_05.ino | 4 +-- M0_Simple_Synth_05/README.md | 21 ++++++++++++++- M0_Simple_Synth_08/M0_Simple_Synth_08.ino | 25 +++++++++++------- M0_Simple_Synth_09/M0_Simple_Synth_09.ino | 12 ++++++--- 5 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 .vscode/ipch/2e3e3b3b9c6760e8/mmap_address.bin diff --git a/.vscode/ipch/2e3e3b3b9c6760e8/mmap_address.bin b/.vscode/ipch/2e3e3b3b9c6760e8/mmap_address.bin new file mode 100644 index 0000000000000000000000000000000000000000..862b8428b9e068428b1a4e8a38f94019008d8940 GIT binary patch literal 8 NcmZQzU~Ksh1ON<}1cCqn literal 0 HcmV?d00001 diff --git a/M0_Simple_Synth_05/M0_Simple_Synth_05.ino b/M0_Simple_Synth_05/M0_Simple_Synth_05.ino index 4a1939d..53a838e 100644 --- a/M0_Simple_Synth_05/M0_Simple_Synth_05.ino +++ b/M0_Simple_Synth_05/M0_Simple_Synth_05.ino @@ -16,7 +16,8 @@ // The code is just doing the squarewaves at the moment with very simple counters. // In the interrupt, we just count the number of ticks here until flipping the bit. -// LFO Counters. minLFO is actually a high number because its a larger tick to +// LFO Counter Bounds. The higher the number, the longer it takes to count to it, so +// a high frequency is really indicated with a smaller number. # define maxLFO 40 # define minLFO 500 @@ -43,7 +44,6 @@ Adafruit_DotStar strip = Adafruit_DotStar( uint8_t CC1 = 7; uint8_t CC2 = 114; - volatile uint16_t counter = 0; volatile uint8_t state = 0; // LFO Bit On/Off volatile uint16_t counterCompare = 100; diff --git a/M0_Simple_Synth_05/README.md b/M0_Simple_Synth_05/README.md index a800ced..db2742c 100644 --- a/M0_Simple_Synth_05/README.md +++ b/M0_Simple_Synth_05/README.md @@ -7,4 +7,23 @@ So this is an approximation of the following circuit ![Capture1](https://github.com/robstave/trinketM0Synth/blob/master/M0_Simple_Synth_05/images/circuit.PNG) -![Capture1](https://github.com/robstave/trinketM0Synth/blob/master/M0_Simple_Synth_05/images/oneMinusLogPNG.PNG) \ No newline at end of file +![Capture1](https://github.com/robstave/trinketM0Synth/blob/master/M0_Simple_Synth_05/images/oneMinusLogPNG.PNG) + +The code is really not as complicated as it seems. We are just really manipulating two counters and applying boolean logic to the results of the timers. The result is sent to a pin to make sound. + +This approach has the flaws that were mentioned earlier that the resolution is not inear as we go up the scale. + +For example: +If a particular note is generated by a counter counting up to 100, then when we reduce the counter to 50, we actually get a note that is an octave higher. + +If you divide that counter amount by 2 again, you get another octave. Works great, but notice the resolution gets worse too. + +100 to 50 have 50 values +50 to 25 has 25 +25 to 12.5 has 12 (rounded) + +Also, with Midi, you only really get 128 values to send. Technically, this is kinda a problem in the analog version too in that you often see a "corse" and "fine" knob. + +Still, its a fun start and very 8-bity. + +![YouTube Example](https://www.youtube.com/watch?v=3eiYu0klEis) diff --git a/M0_Simple_Synth_08/M0_Simple_Synth_08.ino b/M0_Simple_Synth_08/M0_Simple_Synth_08.ino index f2200d2..00c2b61 100644 --- a/M0_Simple_Synth_08/M0_Simple_Synth_08.ino +++ b/M0_Simple_Synth_08/M0_Simple_Synth_08.ino @@ -7,17 +7,24 @@ M0 Trinket Synth - Exercise 08 Previously: - make a squarewave sound (2 Cores) with 3 CCs each + Two Squarewave oscillator(2 Cores) with 3 CCs each HfCC - CC to control pitch LfoCC - CC to control LFO Frequency - - - Added: LfoOnCC - CC to turn core on/off/LFO so its always on, always off or squarewave LFO - Also another CC for the mixer - Toggle Mixer to be sum/nand/xor + + Also another CC for the mixer - Toggle Mixer to be sum/nand/xor + + So we are up to 7 knobs. + + At this point, all the values were getting unmanagable, so lets + make a struct per core. + Added, rebase + Also, did map the LFO control a bit to have an off/lfo/on mode + + + Technically, nothing new here. Just a rebase. */ @@ -27,7 +34,7 @@ // The code is just doing the squarewaves at the moment with very simple counters. // In the interrupt, we just count the number of ticks here until flipping the bit. -// LFO Counters. minLFO is actually a high number because its a larger tick to +// LFO Counter bounds. A small number means it will take less time to reset the timer (and flip the bit) # define maxLFO 40 # define minLFO 500 @@ -71,11 +78,11 @@ CoreState coreArray[] = { { - // HF CC = 10; + // LFO CC = 10; // initialize at 90 10, 0, 90, 0, 91, - // LFO CC = 74; + // HF CC = 74; 74, 0, 90, 0, 91, // LFO ON CC = 71; diff --git a/M0_Simple_Synth_09/M0_Simple_Synth_09.ino b/M0_Simple_Synth_09/M0_Simple_Synth_09.ino index 8851e87..1b7bec4 100644 --- a/M0_Simple_Synth_09/M0_Simple_Synth_09.ino +++ b/M0_Simple_Synth_09/M0_Simple_Synth_09.ino @@ -7,13 +7,18 @@ M0 Trinket Synth - Exercise 09 Previously: - make a squarewave sound (2 Cores) with 3 CCs each + Two Squarewave oscillator(2 Cores) with 3 CCs each HfCC - CC to control pitch LfoCC - CC to control LFO Frequency LfoOnCC - CC to turn core on/off/LFO so its always on, always off or squarewave LFO + + Also another CC for the mixer - Toggle Mixer to be sum/nand/xor - Also another CC for the mixer - Toggle Mixer to be sum/nand/xor + So we are up to 7 knobs. + + At this point, all the values were getting unmanagable, so lets + make a struct per core. + Added: a Vibrato effect @@ -157,6 +162,7 @@ void TC4_Handler() // Interrupt Service coreArray[CORE1].lfoState++; if (coreArray[CORE1].lfoState % 2 == 0) { coreArray[CORE1].color = 0x00; + // coreArray[CORE1].hfTrill = 0; // sync trill } else { coreArray[CORE1].color = 0xFF; }