Changed to LiquidMenu library.

master
Holger Wirtz 6 years ago
parent d1eb19f8b6
commit 1605a486f0
  1. 55
      MicroMDAEPiano.ino

@ -34,10 +34,10 @@
#else #else
#include "mdaEPianoData.h" #include "mdaEPianoData.h"
#endif #endif
//#include <Bounce.h> #include <Bounce.h>
//#include "Encoder4.h" #include "Encoder4.h"
//#include "LiquidCrystalPlus_I2C.h" #include <LiquidCrystal_I2C.h>
//#include "UI.h" #include <LiquidMenu.h>
#include "midi_devices.hpp" #include "midi_devices.hpp"
//************************************************************************************************* //*************************************************************************************************
@ -87,6 +87,10 @@ AudioConnection patchCord13(volume_l, 0, pt8211_1, 0);
// Objects // Objects
mdaEPiano* ep; mdaEPiano* ep;
LiquidCrystal_I2C lcd(LCD_I2C_ADDRESS, LCD_CHARS, LCD_LINES);
Encoder4 enc[2] = {Encoder4(ENC_L_PIN_A, ENC_L_PIN_B), Encoder4(ENC_R_PIN_A, ENC_R_PIN_B)};
int32_t enc_val[2] = {INITIAL_ENC_L_VALUE, INITIAL_ENC_R_VALUE};
Bounce but[2] = {Bounce(BUT_L_PIN, BUT_DEBOUNCE_MS), Bounce(BUT_R_PIN, BUT_DEBOUNCE_MS)};
// Variables // Variables
uint8_t midi_channel = DEFAULT_MIDI_CHANNEL; uint8_t midi_channel = DEFAULT_MIDI_CHANNEL;
@ -105,6 +109,11 @@ elapsedMillis cpu_mem_millis;
enum MDA_EP_PARAM { DECAY, RELEASE, HARDNESS, TREBLE, PAN_TREM, LFO_RATE, VELOCITY_SENSE, STEREO, MAX_POLY, TUNE, DETUNE, OVERDRIVE }; enum MDA_EP_PARAM { DECAY, RELEASE, HARDNESS, TREBLE, PAN_TREM, LFO_RATE, VELOCITY_SENSE, STEREO, MAX_POLY, TUNE, DETUNE, OVERDRIVE };
LiquidLine welcome_line1(1, 0, "MicroMDAEPiano");
LiquidLine welcome_line2(0, 1, "(c)parasiTstudio");
LiquidScreen welcome_screen(welcome_line1, welcome_line2);
LiquidMenu menu(lcd);
//************************************************************************************************* //*************************************************************************************************
//* SETUP FUNCTION //* SETUP FUNCTION
//************************************************************************************************* //*************************************************************************************************
@ -115,26 +124,22 @@ void setup()
Serial.begin(SERIAL_SPEED); Serial.begin(SERIAL_SPEED);
delay(220); delay(220);
/* // LCD display setup
// LCD display setup lcd.init();
lcd.init(); lcd.blink_off();
lcd.blink_off(); lcd.cursor_off();
lcd.cursor_off(); lcd.backlight();
lcd.backlight(); lcd.noAutoscroll();
lcd.noAutoscroll();
lcd.clear(); menu.add_screen(welcome_screen);
lcd.display();
lcd.show(0, 0, 20, " MicroMDAEPiano"); // Encoder setup
lcd.show(1, 0, 16, "(c)parasiTstudio"); enc[0].write(INITIAL_ENC_L_VALUE);
enc_val[0] = enc[0].read();
// Encoder setup enc[1].write(INITIAL_ENC_R_VALUE);
enc[0].write(INITIAL_ENC_L_VALUE); enc_val[1] = enc[1].read();
enc_val[0] = enc[0].read(); but[0].update();
enc[1].write(INITIAL_ENC_R_VALUE); but[1].update();
enc_val[1] = enc[1].read();
but[0].update();
but[1].update();
*/
// Debug output // Debug output
Serial.println(F("MicroMDAEPiano based on https://sourceforge.net/projects/mda-vst")); Serial.println(F("MicroMDAEPiano based on https://sourceforge.net/projects/mda-vst"));
@ -208,6 +213,8 @@ void setup()
mixer_l.gain(1, 0.3); mixer_l.gain(1, 0.3);
AudioInterrupts(); AudioInterrupts();
menu.update();
Serial.println(F("<setup end>")); Serial.println(F("<setup end>"));
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) #if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC)

Loading…
Cancel
Save