Small fixes and debug output.

pull/4/head
Holger Wirtz 6 years ago
parent 41ff645b3b
commit e3c42a1457
  1. 15
      MicroDexed.ino
  2. 1
      config.h
  3. 52
      dexed.cpp

@ -83,7 +83,7 @@ void setup()
AudioMemoryUsageMaxReset();
#endif
load_sysex("ROM1A.SYX", 10);
load_sysex("ROM1A.SYX", 17);
#ifdef DEBUG
show_patch();
#endif
@ -134,13 +134,13 @@ void loop()
{
Serial.println(F("audio_buffer allocation problems!"));
}
while (usbMIDI.read())
{
break_for_calculation = dexed->processMidiMessage(usbMIDI.getType(), usbMIDI.getData1(), usbMIDI.getData2());
if (break_for_calculation == true)
break;
}
if (!break_for_calculation)
{
while (MIDI.read())
@ -157,7 +157,10 @@ void loop()
#if defined(SHOW_DEXED_TIMING) || defined(SHOW_XRUN)
elapsedMicros t1;
#endif
Serial.println("1");
dexed->getSamples(AUDIO_BLOCK_SAMPLES, audio_buffer);
Serial.println("2");
#ifdef SHOW_XRUN
uint32_t t2 = t1;
if (t2 > 2900) // everything greater 2.9ms is a buffer underrun!
@ -216,6 +219,14 @@ void note_off(void)
bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2)
{
#ifdef SHOW_MIDI_EVENT
Serial.print("MIDI event type: ");
Serial.print(type, DEC);
Serial.print(" data1: ");
Serial.print(data1, DEC);
Serial.print(" data2: ");
Serial.println(data2, DEC);
#endif
return (dexed->processMidiMessage(type, data1, data2));
}

@ -16,6 +16,7 @@
#define SAMPLE_RATE 44100
#define DEXED_ENGINE DEXED_ENGINE_MODERN
//#define SHOW_DEXED_TIMING 1
#define SHOW_MIDI_EVENT 1
#define SHOW_XRUN 1
#define SHOW_CPU_LOAD_MSEC 5000
#define MAX_NOTES 16

@ -1,26 +1,26 @@
/*
* MicroDexed
*
* MicroDexed is a port of the Dexed sound engine
* (https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield
*
* (c)2018 H. Wirtz <wirtz@parasitstudio.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6 with audio shield
(c)2018 H. Wirtz <wirtz@parasitstudio.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "synth.h"
#include "dexed.h"
@ -155,6 +155,14 @@ void Dexed::getSamples(uint16_t n_samples, int16_t* buffer)
bool Dexed::processMidiMessage(uint8_t type, uint8_t data1, uint8_t data2)
{
#ifdef SHOW_MIDI_EVENT
Serial.print("MIDI event type: ");
Serial.print(type, DEC);
Serial.print(" data1: ");
Serial.print(data1, DEC);
Serial.print(" data2: ");
Serial.println(data2, DEC);
#endif
switch (type & 0xf0) {
case 0x80 :
keyup(data1);

Loading…
Cancel
Save