From 5e340bb2d81a56b2973b32d6ff770089289cf4ee Mon Sep 17 00:00:00 2001 From: David Huss <dh@atoav.com> Date: Thu, 18 Jan 2024 19:16:28 +0100 Subject: [PATCH] Fix import error, fix solder instructions A better order has emerged during the course. --- .gitignore | 1 + code/daisy-looper/daisy-looper.ino | 15 +++++++++++---- code/daisy-looper/looper.h | 8 ++++---- code/daisy-looper/luts.h | 2 +- code/daisy-looper/ui.h | 6 +++--- solder_instructions.md | 15 ++++++++------- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 4b35e7c..1773368 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.~lock* *.ipynb_checkpoints* *.jupyter* +.directory diff --git a/code/daisy-looper/daisy-looper.ino b/code/daisy-looper/daisy-looper.ino index ab07cfa..a527033 100644 --- a/code/daisy-looper/daisy-looper.ino +++ b/code/daisy-looper/daisy-looper.ino @@ -108,16 +108,19 @@ void AudioCallback(float **in, float **out, size_t size) { noise_value * 5.0f, sample_and_hold.MODE_SAMPLE_HOLD )); + if (ui.rec_source == REC_SOURCE_NOISE) { - ui.activeLooper()->Record(noise_value * 0.7f); + ui.activeLooper()->Record(noise_value * 0.5f); } // When the metro ticks, trigger the envelope to start. - float random_amount = (lfo_amount -0.5f) * 2.0; + float random_amount = lfo_amount * 2.0; if (trig) { // Random LFO if (lfo_kind == 1) { - ui.activeLooper()->addToPlayhead(rand * random_amount * 48000.0f); - ui.activeLooper()->setPlaybackSpeed(pitch_val + midi_pitch_offset); + // Chance + if (random(0.0f, 1.0f) < lfo_amount) { + ui.activeLooper()->addToPlayhead(rand * random_amount * 48000.0f); + } } } @@ -183,6 +186,9 @@ void AudioCallback(float **in, float **out, size_t size) { // Process reverb reverb.Process(output, output, &out1, &out2); + // Short decays are silent, so increase level here + out1 = out1 * map(reverb_decay, 0.0f, 1.0f, 2.0f, 1.0f); + // Mix reverb with the dry signal depending on the amount dialed output = output * (1.0f - reverbmix) + out1 * reverbmix; @@ -376,6 +382,7 @@ void loop() { break; case FX_MODE_REVERB: if (!isnan(p5)) { reverb_tone = 50.0f + p5 * 20000.0f; } + // TODO: Short Reverb Decay times are too silent? if (!isnan(p6)) { reverb_decay = 0.05f + p6 * 0.94f; } if (!isnan(p7)) { reverbmix = p7; } break; diff --git a/code/daisy-looper/looper.h b/code/daisy-looper/looper.h index 9524360..5cb2016 100644 --- a/code/daisy-looper/looper.h +++ b/code/daisy-looper/looper.h @@ -59,7 +59,7 @@ class Head { }; Head::Head() { - variation = random(); + variation = random(-0.1f, 0.1f); } void Head::activate() { this->active = true; @@ -80,7 +80,7 @@ void Head::incrementBy(float value) { this->position += value; } void Head::update() { - this->position += this->increment + (variation * variation_amount); + this->position += (this->increment + (variation * variation_amount)); } float Head::read() { return this->position; @@ -121,8 +121,8 @@ class Looper { void addToPlayhead(float value); float loop_start_f = 0.0f; float loop_length_f = 1.0f; - uint8_t grain_count = 9; - float grain_spread = 1.0f; + uint8_t grain_count = 8; + float grain_spread = 2.0f; float grain_variation = 0.0f; RecPitchMode rec_pitch_mode = REC_PITCH_MODE_NORMAL; RecStartMode rec_start_mode = REC_START_MODE_BUFFER; diff --git a/code/daisy-looper/luts.h b/code/daisy-looper/luts.h index a1d2684..7974c6d 100644 --- a/code/daisy-looper/luts.h +++ b/code/daisy-looper/luts.h @@ -1,7 +1,7 @@ #ifndef LUTs_h #define LUTs_h -#include "MultiMap.h" +#include <MultiMap.h> // Lookup Table for Bipolar Curve with deadband float bip_lookup[] = {0.0, 0.08060869565217388, 0.1597391304347826, 0.23886956521739133, 0.318, 0.3971304347826087, 0.47626086956521746, 0.5, 0.5, 0.5237391304347826, 0.6028695652173913, 0.6819999999999999, 0.7611304347826088, 0.8402608695652175, 0.9193913043478261, 1.0}; diff --git a/code/daisy-looper/ui.h b/code/daisy-looper/ui.h index b389749..0421807 100644 --- a/code/daisy-looper/ui.h +++ b/code/daisy-looper/ui.h @@ -425,7 +425,7 @@ class Ui { fx_mode = FX_MODE_ALL; pot_5.setDisplayMode("LFO", 100.0f, POT_DISPLAY_MODE_PERCENT); pot_5.setLinear(); - pot_6.setDisplayMode("Delay", 100.0f, POT_DISPLAY_MODE_PERCENT); + pot_6.setDisplayMode("Volume", 400.0f, POT_DISPLAY_MODE_PERCENT); pot_7.setDisplayMode("Reverb", 100.0f, POT_DISPLAY_MODE_PERCENT); }); @@ -455,7 +455,7 @@ class Ui { pot_5.setDisplayMode("Grain Num", 100.0f, POT_DISPLAY_MODE_SWITCH_NUMBERS); pot_5.setSwitch(); pot_5.switch_positions = 8; - pot_6.setDisplayMode("Grain Spread", 100.0f, POT_DISPLAY_MODE_PERCENT); + pot_6.setDisplayMode("Grn. Spread", 100.0f, POT_DISPLAY_MODE_PERCENT); pot_7.setDisplayMode("Grain Var.", 100.0f, POT_DISPLAY_MODE_PERCENT); }); @@ -608,7 +608,7 @@ class Ui { float* playheads = activeLooper()->GetPlayheads(); uint8_t count = activeLooper()->GetPlayheadCount(); int x_playhead = 0; - for (size_t i=0; i<count; i++) { + for (size_t i=0; i<count-1; i++) { x_playhead = int(playheads[i] * display.width()) + x_start_loop; int h = 6 + i*3; display.drawFastVLine(x_playhead, h, 3, SH110X_WHITE); diff --git a/solder_instructions.md b/solder_instructions.md index 5eb31e1..fbbcda1 100644 --- a/solder_instructions.md +++ b/solder_instructions.md @@ -79,25 +79,26 @@ What is... - [ ] Reheat the solder joints to carefully move the switches so the keycaps look like a nice grid - [ ] Do this till you are happy with the position - [ ] Now solder the other pins of the switches -- [ ] Solder the potentiometers +- [ ] Solder all potentiometers except the one that has 6 pins (`GAIN`) - [ ] ⚠️ It is easy to solder them in weirdly. Solder only the central pin first and re-align the part by reheating that pin and pushing the part with your finger at the same time. The goal is to make all four bottom metallic parts touch the PCB. See red circles: <img src="images/solder-pot.jpg"> - [ ] Once you feel like the potentiometer doesn't look like the leaning tower of Pisa, solder the rest of its connections (make sure the part keeps its position, when you do this – reheating all the pins at once is not possible) -- [ ] Solder the big black connection jacks +- [ ] Solder all big black connection jacks (except `INPUT_R`) - [ ] ⚠️ the inlet is pointing to the right direction (edge of the PCB) - [ ] ⚠️ Make sure they are flush with the PCB, otherwise they won't fit with the holes in the case - [ ] ⚠️ Some of the pins are now <u>underneath</u> the potentiometers. This is harder to solder, but not impossible. Avoid burning other parts by *thinking* about the direction from which you move in with the soldering iron. -- [ ] Solder the OLED Display - - [ ] Screw the plastic standoffs into the two holes of the Display (on the side without pins) - - [ ] Place the panel onto the PCB and screw the standoffs in from the other side - - [ ] Solder one pin of the panel and make sure it is aligned and level (re-heat and move if it is not) - - [ ] Solder the rest of the pins - [ ] Solder the RGB-LED `D2` – Read below before proceeding: - [ ] ⚠️⚠️⚠️ The silkscreen is on the WRONG side of the PCB! The part should be on the side without) - [ ] ⚠️⚠️ There is no space for soldering *and* cutting the pins on the other side. This part has to be soldered from the top. - [ ] ⚠️ orientation: one of the through holes has a square pad. This is where the longest pin of the LED should go. Shorten the other pins before putting in (if in doubt: ask) - [ ] The LED is <u>not</u> meant to be soldered flush with the PCB. It should stick out of the panel. Check David's board for reference - [ ] The 4 pins are <u>not</u> allowed to connect to each other with solder bridges. If there is too much solder, remove it using solder wick. +- [ ] Solder the remaining Potentiometer and Audio Connector +- [ ] Solder the OLED Display + - [ ] Screw the plastic standoffs into the two holes of the Display (on the side without pins) + - [ ] Place the panel onto the PCB and screw the standoffs in from the other side + - [ ] Solder one pin of the panel and make sure it is aligned and level (re-heat and move if it is not) + - [ ] Solder the rest of the pins - [ ] Put everything into the case - [ ] Solder two wires to the DIN-MIDI-connector (look at the schematic for a connection diagram) and place the midi socket in and solder the cables to the board (⚠️ it matters which is soldered where!) - [ ] Before connecting it to any USB-source, visually inspect the board for any obvious problems, solder bridges, missing pins etc. -- GitLab