EPiano audio object for Teensy

Status
Not open for further replies.

C0d3man

Well-known member
Hi,

i used the free VST EPiano from MDA some time ago and ported it to the Teensy(-3.6) (see MicroMDAEPiano). Now I have converted the engine into a Teensy audio object, so that you can include this relatively easily in your own projects:

Code:
#include <Audio.h>
#include "synth_epiano.h"
AudioSynthEPiano         ep(16);
AudioOutputI2S           i2s1;
AudioControlSGTL5000     sgtl5000_1;
AudioConnection          patchCord1(ep, 0, i2s1, 0);
AudioConnection          patchCord2(ep, 0, i2s1, 1);

void setup()
{
  AudioMemory(32);

  sgtl5000_1.enable();
  sgtl5000_1.lineOutLevel(29);
  sgtl5000_1.dacVolumeRamp();
  sgtl5000_1.dacVolume(1.0);
  sgtl5000_1.unmuteHeadphone();
  sgtl5000_1.unmuteLineout();
  sgtl5000_1.volume(0.8, 0.8); // Headphone volume
}

void loop()
{
  uint8_t x=random(11);
  int8_t d=random(60)-30;
  uint8_t p=random(7);

  ep.setProgram(p);
  
  Serial.println("Key-Down");
  
  ep.noteOn(48+x, 90+d);
  delay(100);
  ep.noteOn(52+x, 90+d);
  delay(100);
  ep.noteOn(55+x, 90+d);
  delay(100);
  ep.noteOn(60+x, 90+d);
  delay(2000);

  Serial.println("Key-Up");
  ep.noteOff(48+x);
  ep.noteOff(52+x);
  ep.noteOff(55+x);
  ep.noteOff(60+x);
  delay(2000);
}

The object has the sample data in PROGMEM, so it actually only runs on a Teensy >= 3.6. The sound is based on a Fender-Rhodes and there are a few effects directly built in (tremolo, distortion, ...). Of course, Teensy effects can also be added (possibly my modulated delay as a chorus effect).

I use the EP in our (hobby) band and I am pretty happy with the sound. Maybe someone also like it and might use it. Have fun!

P.S.: Synth_MDA_EPiano will later be used as another engine in my other project MicroDexed.
 
Status
Not open for further replies.
Back
Top