Added freeverbs.

Fixed panorama placement in stereo output.
pull/4/head
Holger Wirtz 6 years ago
parent 2e2bda1dbd
commit 54252dd92d
  1. 34
      MicroDexed.ino
  2. 4
      config.h
  3. 20
      dexed.cpp

@ -51,15 +51,19 @@ Bounce but1 = Bounce(BUT1_PIN, 10); // 10 ms debounce
#endif #endif
// GUItool: begin automatically generated code // GUItool: begin automatically generated code
AudioPlayQueue queue1; //xy=950,406 AudioPlayQueue queue1; //xy=637,396
AudioAmplifier amp2; //xy=1172,438 AudioEffectFreeverbStereo freeverbs1; //xy=815,506
AudioAmplifier amp1; //xy=1173,378 AudioMixer4 mixer2; //xy=1014,461
AudioOutputI2S i2s1; //xy=1321,403 AudioMixer4 mixer1; //xy=1016,376
AudioConnection patchCord1(queue1, amp1); AudioOutputI2S i2s1; //xy=1214,414
AudioConnection patchCord2(queue1, amp2); AudioConnection patchCord1(queue1, freeverbs1);
AudioConnection patchCord3(amp2, 0, i2s1, 1); AudioConnection patchCord2(queue1, 0, mixer1, 0);
AudioConnection patchCord4(amp1, 0, i2s1, 0); AudioConnection patchCord3(queue1, 0, mixer2, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=1323,459 AudioConnection patchCord4(freeverbs1, 0, mixer1, 1);
AudioConnection patchCord5(freeverbs1, 1, mixer2, 1);
AudioConnection patchCord6(mixer2, 0, i2s1, 1);
AudioConnection patchCord7(mixer1, 0, i2s1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=1214,469
// GUItool: end automatically generated code // GUItool: end automatically generated code
Dexed* dexed = new Dexed(SAMPLE_RATE); Dexed* dexed = new Dexed(SAMPLE_RATE);
@ -129,8 +133,16 @@ void setup()
AudioMemory(AUDIO_MEM); AudioMemory(AUDIO_MEM);
sgtl5000_1.enable(); sgtl5000_1.enable();
sgtl5000_1.volume(VOLUME); sgtl5000_1.volume(VOLUME);
amp1.gain(0.5);
amp2.gain(0.5); // configure mixer
mixer1.gain(0,1.0); // normal audio
mixer2.gain(0,0.2); // reverb audio
mixer1.gain(0,1.0); // normal audio
mixer2.gain(0,0.2); // reverb audio
// configure reverb
freeverbs1.roomsize(DEFAULT_REVERB_ROOMSIZE);
freeverbs1.damping(DEFAULT_REVERB_DAMPING);
// start SD card // start SD card
SPI.setMOSI(SDCARD_MOSI_PIN); SPI.setMOSI(SDCARD_MOSI_PIN);

@ -32,8 +32,10 @@
#define DEFAULT_MIDI_CHANNEL MIDI_CHANNEL_OMNI #define DEFAULT_MIDI_CHANNEL MIDI_CHANNEL_OMNI
#define DEFAULT_SYSEXBANK 0 #define DEFAULT_SYSEXBANK 0
#define DEFAULT_SYSEXSOUND 0 #define DEFAULT_SYSEXSOUND 0
#define DEFAULT_REVERB_ROOMSIZE 0.5
#define DEFAULT_REVERB_DAMPING 0.5
//#define DEXED_ENGINE DEXED_ENGINE_MODERN //#define DEXED_ENGINE DEXED_ENGINE_MODERN
#define AUDIO_MEM 4 #define AUDIO_MEM 32
#if !defined(__MK66FX1M0__) // check for Teensy-3.6 #if !defined(__MK66FX1M0__) // check for Teensy-3.6
#define MAX_NOTES 11 // No? #define MAX_NOTES 11 // No?

@ -44,6 +44,9 @@ extern bool load_sysex(uint8_t bank, uint8_t voice_number);
extern AudioControlSGTL5000 sgtl5000_1; extern AudioControlSGTL5000 sgtl5000_1;
extern AudioAmplifier amp1; extern AudioAmplifier amp1;
extern AudioAmplifier amp2; extern AudioAmplifier amp2;
extern AudioEffectFreeverbStereo freeverbs1;
extern AudioMixer4 mixer2;
extern AudioMixer4 mixer1;
Dexed::Dexed(int rate) Dexed::Dexed(int rate)
{ {
@ -235,8 +238,21 @@ bool Dexed::processMidiMessage(uint8_t type, uint8_t data1, uint8_t data2)
sgtl5000_1.volume(float(value) / 0x7f); sgtl5000_1.volume(float(value) / 0x7f);
break; break;
case 10: // Pan case 10: // Pan
amp1.gain(float(0x7f-value)/0x7f); if (value < 64)
amp2.gain(float(value) / 0x7f); {
mixer1.gain(0, 1.0);
mixer2.gain(0, float(value) / 0x40);
}
else if (value > 64)
{
mixer1.gain(0, float(0x7f - value) / 0x40);
mixer2.gain(0, 1.0);
}
else
{
mixer1.gain(0, 1.0);
mixer2.gain(0, 1.0);
}
break; break;
case 32: // BankSelect LSB case 32: // BankSelect LSB
bank = data2; bank = data2;

Loading…
Cancel
Save