From 5d6bc5465350efd1fd33a3c0a328d00d23ba65b7 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 25 Nov 2020 21:38:29 -0700 Subject: [PATCH] Working now! --- main-play.h | 22 ++++++++++++---------- main-setup.h | 2 +- uilleann.ino | 7 +++---- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/main-play.h b/main-play.h index 8a957f2..fd2b7b9 100644 --- a/main-play.h +++ b/main-play.h @@ -9,26 +9,29 @@ void playDrones() { } } -void doPlay(Pipe pipe, Adafruit_SSD1306 display, bool forceDisplayUpdate) { +void doPlay(bool forceDisplayUpdate) { static Note last_note = NOTE_ZERO; bool updateDisplay = forceDisplayUpdate; - diag("silent?"); + if (updateDisplay) { + display.clearDisplay(); + display.fillRect(0, 0, 2, 2, SSD1306_WHITE); + display.display(); + } + if (pipe.silent) { Chanter.NoteOff(); } else { // Calculate pitch, and glissando pitch - uint16_t pitch = tuning.GetPitch(pipe.note); - uint16_t glissandoPitch = tuning.GetPitch(pipe.glissandoNote); + float pitch = tuning.GetPitch(pipe.note); + float glissandoPitch = tuning.GetPitch(pipe.glissandoNote); - diag("bend"); // Bend pitch if fewer than 3 half steps away if (abs(pipe.glissandoNote - pipe.note) < 3) { float diff = glissandoPitch - pitch; pitch += diff * pipe.glissandoOpenness; } - diag("shelf"); // Apply a low shelf filter if this is the alternate fingering if (pipe.altFingering) { biquad1.setLowShelf(0, 2000, 0.2, 1); @@ -44,12 +47,11 @@ void doPlay(Pipe pipe, Adafruit_SSD1306 display, bool forceDisplayUpdate) { } } - diag("check last note"); if (pipe.note != last_note) { updateDisplay = true; } - diag("update display"); +#if 0 if (updateDisplay) { // Look up the note name const char *note_name = NoteName(pipe.note); @@ -65,7 +67,7 @@ void doPlay(Pipe pipe, Adafruit_SSD1306 display, bool forceDisplayUpdate) { display.print(note_name); display.display(); - //last_note = pipe.note; + last_note = pipe.note; } - diag("play done"); +#endif } diff --git a/main-setup.h b/main-setup.h index 62f0e5c..1e77f86 100644 --- a/main-setup.h +++ b/main-setup.h @@ -140,7 +140,7 @@ void setupInfo() { display.setFont(); display.setTextSize(1); display.setCursor(0, 16); - display.print("build"); + display.print("FC-1"); display.setCursor(0, 24); display.print(buildDate); } diff --git a/uilleann.ino b/uilleann.ino index 2dceacc..b03e1c5 100644 --- a/uilleann.ino +++ b/uilleann.ino @@ -194,6 +194,7 @@ void setup() { playDrones(); diag("Done!"); + display.dim(true); } void loadPatch(uint8_t where) { @@ -220,7 +221,7 @@ void loadPatch(uint8_t where) { void loop() { - static bool upSetting = false; // GET IT? + static bool upSetting = true; // GET IT? pipe.Update(); @@ -242,8 +243,6 @@ void loop() { } } - diag("Play!"); - doPlay(pipe, display, upSetting); + doPlay(upSetting); upSetting = false; - diag("Done!"); }