Merge branch 'dev' of dirkenstein/MicroDexed into dev

pull/8/head
Holger Wirtz 5 years ago committed by Gitea
commit d1577d4ef1
  1. 1
      MicroDexed.ino
  2. 1
      config.h
  3. 14
      source_microdexed.h

@ -961,7 +961,6 @@ void handleSystemReset(void)
/****************************************************************************** /******************************************************************************
MIDI HELPER MIDI HELPER
******************************************************************************/ ******************************************************************************/
bool checkMidiChannel(byte inChannel) bool checkMidiChannel(byte inChannel)
{ {
// check for MIDI channel // check for MIDI channel

@ -219,7 +219,6 @@
#endif #endif
#if defined(__IMXRT1062__) //Teensy-4.0 #if defined(__IMXRT1062__) //Teensy-4.0
#undef MIDI_DEVICE_USB_HOST
#undef MIDI_DEVICE_USB #undef MIDI_DEVICE_USB
#define MAX_NOTES 16 #define MAX_NOTES 16
#endif #endif

@ -12,10 +12,20 @@ class AudioSourceMicroDexed : public AudioStream, public Dexed {
AudioSourceMicroDexed(int sample_rate) : AudioStream(0, NULL), Dexed(sample_rate) { AudioSourceMicroDexed(int sample_rate) : AudioStream(0, NULL), Dexed(sample_rate) {
}; };
void update(void) { void update(void) {
if (in_update) {
xrun++;
return;
}
else in_update = true;
elapsedMicros render_time; elapsedMicros render_time;
audio_block_t *lblock; audio_block_t *lblock;
lblock = allocate(); lblock = allocate();
if (!lblock) return; if (!lblock) {
in_update = false;
return;
}
getSamples(AUDIO_BLOCK_SAMPLES, lblock->data); getSamples(AUDIO_BLOCK_SAMPLES, lblock->data);
if (render_time > audio_block_time_us) // everything greater 2.9ms is a buffer underrun! if (render_time > audio_block_time_us) // everything greater 2.9ms is a buffer underrun!
xrun++; xrun++;
@ -24,6 +34,8 @@ class AudioSourceMicroDexed : public AudioStream, public Dexed {
transmit(lblock, 0); transmit(lblock, 0);
release(lblock); release(lblock);
in_update = false;
}; };
private: private:
volatile bool in_update = false;
}; };

Loading…
Cancel
Save