Disabled CPU_OVERLOAD_THROTTLE.

Small fixes.
pull/32/head
Holger Wirtz 5 years ago
parent 5e1f304abd
commit 5ed8f5ee23
  1. 23
      MicroDexed.ino
  2. 6
      config.h
  3. 2
      dexed.cpp
  4. 2
      dexed_sysex.cpp

@ -258,7 +258,7 @@ void setup()
pinMode(U8X8_CS_PIN, OUTPUT);
#endif
delay(320); // necessary, because before this time no serial output is done :(
delay(320); // necessary, because before no serial output is done :(
#ifdef ENABLE_LCD_UI
setup_ui();
@ -271,6 +271,9 @@ void setup()
Serial.println(F("https://codeberg.org/dcoredump/MicroDexed"));
Serial.print(F("Version: "));
Serial.println(VERSION);
Serial.print(F("CPU-Speed: "));
Serial.print(F_CPU / 1000000.0, 1);
Serial.println(F(" MHz"));
Serial.println(F("<setup start>"));
Serial.flush();
@ -296,8 +299,9 @@ void setup()
}
}
/*
// Init EEPROM if both buttons are pressed at startup
/* if (digitalRead(BUT_R_PIN) == LOW)
if (digitalRead(BUT_R_PIN) == HIGH && digitalRead(BUT_L_PIN) == HIGH)
{
Serial.println(F("Init EEPROM"));
lcd.clear();
@ -306,9 +310,10 @@ void setup()
lcd.setCursor(0, 1);
lcd.print(F("EEPROM"));
initial_values_from_eeprom(true);
delay(2000);
}
else
initial_values_from_eeprom(false); */
*/
initial_values_from_eeprom(false);
#if defined(TEENSY_AUDIO_BOARD)
@ -650,7 +655,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
{
if (checkMidiChannel(inChannel, instance_id))
{
if (inNumber >= configuration.dexed[instance_id].note_start && inNumber <= configuration.dexed[instance_id].note_end)
if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note)
MicroDexed[instance_id]->keydown(inNumber, inVelocity);
}
}
@ -662,6 +667,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity)
{
if (checkMidiChannel(inChannel, instance_id))
{
if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note)
MicroDexed[instance_id]->keyup(inNumber);
}
}
@ -1408,8 +1414,8 @@ void init_configuration(void)
configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL;
configuration.dexed[instance_id].bank = SYSEXBANK_DEFAULT;
configuration.dexed[instance_id].voice = SYSEXSOUND_DEFAULT;
configuration.dexed[instance_id].note_start = INSTANCE_NOTE_START_DEFAULT;
configuration.dexed[instance_id].note_end = INSTANCE_NOTE_END_DEFAULT;
configuration.dexed[instance_id].lowest_note = INSTANCE_LOWEST_NOTE_MIN;
configuration.dexed[instance_id].highest_note = INSTANCE_HIGHEST_NOTE_MAX;
configuration.dexed[instance_id].reverb_send = REVERB_SEND_DEFAULT;
configuration.dexed[instance_id].chorus_send = CHORUS_SEND_DEFAULT;
configuration.dexed[instance_id].delay_send = DELAY_SEND_DEFAULT;
@ -1625,12 +1631,14 @@ void show_configuration(void)
Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.dexed[instance_id].midi_channel, DEC);
Serial.print(F(" Bank ")); Serial.println(configuration.dexed[instance_id].bank, DEC);
Serial.print(F(" Voice ")); Serial.println(configuration.dexed[instance_id].voice, DEC);
Serial.print(F(" Lowest Note ")); Serial.println(configuration.dexed[instance_id].lowest_note, DEC);
Serial.print(F(" Highest Note ")); Serial.println(configuration.dexed[instance_id].highest_note, DEC);
Serial.print(F(" Reverb Send ")); Serial.println(configuration.dexed[instance_id].reverb_send, DEC);
Serial.print(F(" Chorus Send ")); Serial.println(configuration.dexed[instance_id].chorus_send, DEC);
Serial.print(F(" Delay Send ")); Serial.println(configuration.dexed[instance_id].delay_send, DEC);
Serial.print(F(" Filter Cutoff ")); Serial.println(configuration.dexed[instance_id].filter_cutoff, DEC);
Serial.print(F(" Filter Resonance ")); Serial.println(configuration.dexed[instance_id].filter_resonance, DEC);
Serial.print(F(" Loudness ")); Serial.println(configuration.dexed[instance_id].sound_intensity, DEC);
Serial.print(F(" Sound Intensity ")); Serial.println(configuration.dexed[instance_id].sound_intensity, DEC);
Serial.print(F(" Panorama ")); Serial.println(configuration.dexed[instance_id].pan, DEC);
Serial.print(F(" Transpose ")); Serial.println(configuration.dexed[instance_id].transpose, DEC);
Serial.print(F(" Tune ")); Serial.println(configuration.dexed[instance_id].tune, DEC);
@ -1646,6 +1654,7 @@ void show_configuration(void)
Serial.print(F(" BreathCtrl Range ")); Serial.println(configuration.dexed[instance_id].bc_range, DEC);
Serial.print(F(" Breathctrl Assign ")); Serial.println(configuration.dexed[instance_id].bc_assign, DEC);
Serial.print(F(" Aftertouch Range ")); Serial.println(configuration.dexed[instance_id].at_range, DEC);
Serial.print(F(" Aftertouch Assign ")); Serial.println(configuration.dexed[instance_id].at_range, DEC);
Serial.print(F(" Portamento Mode ")); Serial.println(configuration.dexed[instance_id].portamento_mode, DEC);
Serial.print(F(" Portamento Glissando ")); Serial.println(configuration.dexed[instance_id].portamento_glissando, DEC);
Serial.print(F(" Portamento Time ")); Serial.println(configuration.dexed[instance_id].portamento_time, DEC);

@ -37,6 +37,7 @@
// 2. Build the firmware with "MIDI_DEVICE_USB" enabled in config.h.
// 3. Afterconnecting to a Linux system there should be a MIDI an audio device available that is called "MicroMDexed", so you can start the following:
// $ aplaymidi -p 20:0 <MIDI-File> # e.g. test.mid
// $ vkeybd --addr 20:0
// $ arecord -f cd -Dhw:1,0 /tmp/<AUDIO_FILE_NAME>.wav
//
@ -167,7 +168,7 @@
//#define SDCARD_SCK_PIN 14
#ifndef TEENSY4
// Teensy 3.5 & 3.6 SD card
#define SDCARD_CS_PIN 4 //BUILTIN_SDCARD
#define SDCARD_CS_PIN BUILTIN_SDCARD
#define SDCARD_MOSI_PIN 11
#define SDCARD_SCK_PIN 13
#else
@ -212,7 +213,7 @@
#define NUM_DEXED 1
#define MAX_DEXED 2
#define NORMALIZE_DX_VELOCITY 1
#define CPU_OVERLOAD_THROTTLE 95.0 // Level (in percent) when throttling should start
//#define CPU_OVERLOAD_THROTTLE 95.0 // Level (in percent) when throttling should start
#define CPU_OVERLOAD_THROTTLE_TIMER 100 // timer (in ms) when next throttling is possible
enum { DEXED, CHORUS, DELAY, REVERB};
@ -446,7 +447,6 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define INSTANCE_NOTE_START_MAX MIDI_B7
#define INSTANCE_NOTE_START_DEFAULT INSTANCE_NOTE_START_MIN
=======
#define INSTANCE_NOTE_END_MIN MIDI_AIS0
#define INSTANCE_NOTE_END_MAX MIDI_B7
#define INSTANCE_NOTE_END_DEFAULT INSTANCE_NOTE_END_MAX

@ -190,7 +190,7 @@ void Dexed::keydown(int16_t pitch, uint8_t velo) {
pitch += data[144] - TRANSPOSE_FIX;
#if defined(NORMALIZE_DX_VELOCITY)
velo = ((float)velo) * 0.7874015; // 100/127
velo = (((float)velo) * 0.7874015 + 0.5); // 100/127
#endif
int previousKeyDown = lastKeyDown;

@ -531,7 +531,7 @@ bool save_sysex_setup(uint8_t b, uint8_t v, config_t configuration)
create_sysex_filename(b, sysex_file_name, v);
sysex = SD.create(sysex_file_name);
sysex = SD.open(sysex_file_name);
if (!sysex)
{
#ifdef DEBUG

Loading…
Cancel
Save