Thread: OSC & wetdry
View Single Post
Old 07-18-2019, 10:57 AM   #11
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 85
Default

Quote:
Originally Posted by netphreak View Post
At this point I'm tempted to use MySQL as a "man in the middle", and use websockets to feed/update my displays, since OSC seems to have a few weaknesses on the response side... Storing data in a database gives me another feature - storing "presets", for easy switching on device side. Increased graphical update time on device is the obvious cost, but maybe just barely.
I don't see why you'd want to add this amount of complexity.
Storing the state of 32 channels(excluding the FX parameters but including FX name, bypass and wet/dry), the selected channel and 48 FX parameters for the selected plugin in a structure of structs takes up less than 40% of the memory of a Teensy 3.6. Here're the struct definitions for the the tracks :
Code:
// struct for fx plugin
struct trackInsert{
  char  name[NAME_LENGTH+1];                          // plugin long name
  int   number;                                       // plugin number
  bool  bypass;                                       // bypass status
  char  mixStr[VALUE_LENGTH];                         // mix string    
  float mix;                                          // normalised mix
};
typedef struct trackInsert TrackInsert;

// track send parameters
struct trackSend{
  char  name[NAME_LENGTH+1];                          // send long name
  int   number;                                       // send number
  char  volumeStr[VALUE_LENGTH];                      // volume string    
  float volume;                                       // normalised volume
  char  panStr[VALUE_LENGTH];                         // panning string    
  float pan;                                          // normalised panning
};
typedef struct trackSend TrackSend;

// struct containing Reaper track info & data
struct track{
  char        name[NAME_LENGTH+1];                    // track name
  int         number;                                 // track number
  char        volumeStr[VALUE_LENGTH];                // volume string    
  float       volume;                                 // normalised volume
  char        panStr[VALUE_LENGTH];                   // panning string    
  float       pan;                                    // normalised panning
  bool        rec;                                    // record arm
  bool        mute;                                   // track mute
  bool        solo;                                   // track solo
  bool        monitor;                                // track monitor
  TrackSend   send[NUM_OF_SENDS];                     // track sends
  TrackInsert insert[NUM_OF_INSERTS];                 // track effects/instrument plugins
  char        receiveName[NAME_LENGTH+1];             // first receive name, used to determine if track is a bus track
};
typedef struct track Track;
The 40% memory usage is with NAME_LENGTH=18, VALUE_LENGTH=16, NUM_OF_SENDS=6 and NUM_OF_INSERTS=8.
It doesn't take much code to save this to SD card on the build in card reader, the required libraries are all included in the Teensyduino installation. My controller also doubles as a MIDI controller for hardware synths and it can receive complete program dumps from synths and store them on SD card for retrieval.
Gerrit is offline   Reply With Quote