Close

Fluxamasynth Software

A project log for Fluxamasynth Modules

The Fluxamasynth is a module that makes it easy to add high quality MIDI sound to any Arduino or Raspberry Pi project.

fluxlyFluxly 10/01/2018 at 21:281 Comment

There are two interfaces for communicating with the SAM2695; a simple serial line and a parallel interface. The Fluxamasynth uses the serial interface; all you have to do is send the chip the right MIDI commands in the right order. 

The SAM2695 datasheet has several tables of MIDI commands that the SAM2695 recognizes.

The first iteration of the library had all of the basics: noteOn, noteOff, reverb, chorus etc. The latest iteration added access to some of the extras and lower-level capabilities, like the 4 channel equalizer, envelope tweaking, and special percussion modes.

With the new hardware variations the library has to pick the correct communication pins based on the target hardware. These can be determined from the compiler flags passed to the library when the Arduino IDE compiles it in to your code. Here's how to set an environment variable in the library header based on the incoming flags:

IMAGE screenshot of arduino compiler flags

#define FLUXAMASYNTH_ESP32       1
#define FLUXAMASYNTH_SHIELD      2
#define FLUXAMASYNTH_FOR_FEATHER 3 
#if defined(ESP_PLATFORM)
    #define FS_PLATFORM FLUXAMASYNTH_ESP32
  #elif defined(ARDUINO_AVR_FEATHER32U4)
    #define FS_PLATFORM FLUXAMASYNTH_FOR_FEATHER
#elif defined(ARDUINO_SAMD_FEATHER_M0_EXPRESS) || 
      defined(ARDUINO_SAMD_FEATHER_M0)
    #define FS_PLATFORM FLUXAMASYNTH_FOR_FEATHER_M0
  #elif defined(ARDUINO)
    #define FS_PLATFORM FLUXAMASYNTH_SHIELD
#endif

#ifndef FS_PLATFORM
#define FS_PLATFORM FLUXAMASYNTH_SHIELD
#endif

The latest library is available on Github. It provides these functions:

A simple Fluxamasynth program using the Arduino IDE and library looks like this:

#include <Fluxamasynth.h>
 
Fluxamasynth synth;
 
void setup() {
  synth.setMasterVolume(255);   
}
 
void loop()
{
  for (int note=60; note<85; note++) {
    synth.noteOn(0, note, 100);  
    delay(200);
    synth.noteOn(0, note, 0);    
  }
}

Discussions

tedysuwarnadysoleh wrote 12/22/2018 at 03:47 point

please provide an example of the schematic midi button as well as the code change controller for Arduino

  Are you sure? yes | no