View Single Post
Old 08-30-2018, 09:42 AM   #14
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 57
Default

Quote:
Originally Posted by mschnell View Post
Did this help ?

-Michael
Thank you for trying to help but alas, this didn't provide a solution.

Here are two examples that demonstrate the issue:

In the case of the Pultec EQ plugin everything is fine.
Screenshot of the parameter view: PultecEQ.png
There are just a few parameters and they are all presented as dropdown lists.
When then plugin is selected, either in Reaper with the OSC controller, the following is sent by Reaper:
Code:
Receiving OSC Bundle...
/fx/name			String  = : Pultec HLF-3C
/fx/number/str			String  = : 1
/fx/preset			String  = : DI-Underwater
/fx/openui			Float   = : 1.00
/fxparam/1/name			String  = : Low Cut
/fxparam/1/value/str		String  = : Off
/fxparam/1/value		Float   = : 0.00
/fxparam/2/name			String  = : High Cut
/fxparam/2/value/str		String  = : 1.5 KCS
/fxparam/3/name			String  = : Enable
/fxparam/3/value/str		String  = : In
/fxparam/3/value		Float   = : 1.00
/fxparam/4/name			String  = : Bypass
/fxparam/4/value/str		String  = : normal
/fxparam/4/value		Float   = : 0.00
/fxparam/5/name			String  = : Wet
/fxparam/5/value/str		String  = : 100
/fxparam/5/value		Float   = : 1.00
Perfect! All I need to know about the plugin and the settings. BTW. the name is the alias name I entered for this plugin, excellent.

The EP-34 tape delay contains sliders in the parameter view: EP-34.png
The value displayed next to the slider is the normalised value. This should be the formatted string value which includes the unit.
On selection the following is sent:
Code:
Receiving OSC Bundle...
/fx/name			String  = : EP-34 Tape Echo
/fx/number/str			String  = : 2
/fx/preset			String  = : Setzer Slapback
/fx/openui			Float   = : 0.00
/fxparam/1/name			String  = : Delay
/fxparam/1/value/str		String  = : 0.5000
/fxparam/1/value		Float   = : 0.50
/fxparam/2/name			String  = : Repeats
/fxparam/2/value/str		String  = : 0.0000
/fxparam/3/name			String  = : Echo Vol
/fxparam/3/value/str		String  = : 0.6156
/fxparam/3/value		Float   = : 0.62
/fxparam/4/name			String  = : Rec Vol
/fxparam/4/value/str		String  = : 0.0816
/fxparam/4/value		Float   = : 0.08
/fxparam/5/name			String  = : Treble
/fxparam/5/value/str		String  = : 0.5000
/fxparam/5/value		Float   = : 0.50
/fxparam/6/name			String  = : Bass
/fxparam/6/value/str		String  = : 0.5000
/fxparam/6/value		Float   = : 0.50
/fxparam/7/name			String  = : Pan
/fxparam/7/value/str		String  = : 0.9250
/fxparam/7/value		Float   = : 0.92
/fxparam/8/name			String  = : Input
/fxparam/8/value/str		String  = : HI
/fxparam/8/value		Float   = : 1.00
Receiving OSC Bundle...
/fxparam/9/name			String  = : Tension
/fxparam/9/value/str		String  = : LO
/fxparam/10/name		String  = : Send
/fxparam/10/value/str		String  = : ON
/fxparam/10/value		Float   = : 1.00
/fxparam/11/name		String  = : TempSync
/fxparam/11/value/str		String  = : ON
/fxparam/11/value		Float   = : 1.00
/fxparam/12/name		String  = : WetSolo
/fxparam/12/value/str		String  = : OFF
/fxparam/13/name		String  = : Power
/fxparam/13/value/str		String  = : ON
/fxparam/13/value		Float   = : 1.00
/fxparam/14/name		String  = : Bypass
/fxparam/14/value/str		String  = : normal
/fxparam/15/name		String  = : Wet
/fxparam/15/value/str		String  = : 100
/fxparam/15/value		Float   = : 1.00
In all cases where the parameter is displayed as a slider in the parameter view the OSC string value contains the normalised value in stead of the formatted string representation. All parameters that are displayed as dropdown lists in the parameter view correctly contain the formatted string in the OSC string.
It would be great if someone from the Reaper developer team could comment on this. It seems to me that the required change is relatively simple and it would make OSC perfect for creating advanced (extensive feedback) plugin controllers.

Here's a link to the thread about my OSC test setup on the PJRC Teensy forum: OSC digital audio workstation controller (Reaper)

The sketch has changed somewhat, here's the version I used for these examples:
Code:
// OSC  test code

#include <Bounce.h>
#include <Encoder.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <OSCBundle.h>

// ***** BUTTONS *****
#define BUTTON_ONE_PIN 20
#define BUTTON_TWO_PIN 21

int             debounceTime=5;
Bounce          buttonOne = Bounce(BUTTON_ONE_PIN,debounceTime);
Bounce          buttonTwo = Bounce(BUTTON_TWO_PIN,debounceTime);
elapsedMicros   sinceButtonCheck;                                   // timer for button check
unsigned int    buttonCheckInterval=1000;                           // interval in microseconds for checking buttons
// ***** END BUTTONS *****

// ***** ENCODERS *****
Encoder encoderOne(18,19);
Encoder encoderTwo(22,23);
long    currentEncoderOneValue=0;
long    currentEncoderTwoValue=0;
// ***** END  ENCODERS *****

#define NUM_OF_PARAMETERS 16    // number of effect/instrument parameters in parameter bank

// you can find this written on the board of some Arduino Ethernets or shields; I couldn't find it but it does not matter :-)
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; 

//ports
const unsigned int serverPort  = 8000;     // Reaper Out port
const unsigned int destPort    = 9000;     // Reaper IN port

//Create UDP message object
EthernetUDP Udp;

//the Teensy's IP
IPAddress ip(192, 168, 178, 177);
//destination IP
IPAddress outIp(192,168,178,38);

void setup(){
  Serial.begin(115200); 
  Serial.println("OSC test");

  pinMode(BUTTON_ONE_PIN, INPUT_PULLUP);
  pinMode(BUTTON_TWO_PIN, INPUT_PULLUP);
  //setup ethernet part
  Ethernet.begin(mac,ip);
  Udp.begin(serverPort);
}

void loop(){
  //process received messages
  //OSCMsgReceive();
  //OSCBundleReceive();
  OSCReceive();
  // check elapsedMicros and millis timers
  if (sinceButtonCheck >=buttonCheckInterval) {
    sinceButtonCheck = sinceButtonCheck - buttonCheckInterval;
    handleButtons();
    handleEncoders();
  }  
}

void OSCReceive(){
  int size;
  if( (size = Udp.parsePacket())>0) {
    byte udpData[size];
    for (int i=0;i<size;i++) udpData[i]=Udp.read();
    // if data begins with # it is a bundle
    if (udpData[0]==35){
      OSCBundle   bundleIN;
      bundleIN.fill(udpData,size);
      if(!bundleIN.hasError()) {
        Serial.println("Receiving OSC Bundle...");
        bundleIN.route("/track", showMessage);
        bundleIN.route("/fx", showMessage);
        bundleIN.route("/fxparam", showMessage);
        bundleIN.route("/fxeq", showMessage);
        bundleIN.route("/fxinstparam", showMessage);
      }
    }
    // if data begins with / it is a message
    else if (udpData[0]==47){
      OSCMessage  msgIN;
      msgIN.fill(udpData,size);
      if(!msgIN.hasError()){
        Serial.println("Receiving OSC Message...");
        msgIN.route("/track",showMessage);
        msgIN.route("/fx",showMessage);
        msgIN.route("/fxparam",showMessage);
        msgIN.route("/fxeq",showMessage);
        msgIN.route("/fxinstparam",showMessage);
        //msgIN.route("/beat",showMessage);
      }
    }
  }
}

void showMessage(OSCMessage &msg, int addrOffset){
  char adresStr[48];    
  msg.getAddress(adresStr);
  Serial.print(adresStr);
  Serial.print("\t\t");
  if (msg.isInt(0)){        
    Serial.print("Int     = : ");
    Serial.println(msg.getInt(0));
  } 
  else if(msg.isFloat(0)){       
    Serial.print("Float   = : ");
    Serial.println(msg.getFloat(0));
  } 
  else if(msg.isBoolean(0)){       
    Serial.print("Boolean = : ");
    Serial.println(msg.isBoolean(0));
  }
  else if(msg.isString(0)){   
    char str[48]    ;
    msg.getString(0,str,48);
    Serial.print("String  = : ");
    Serial.println(str);
  }
}

void displayFxParameter(OSCMessage &msg, int addrOffset ){
  //iterate through all the analog pins
  for(int i = 0; i < NUM_OF_PARAMETERS; i++){
    //match against the index number strings
    int indexMatched = msg.match(numToOSCAddress(i), addrOffset);
    if (indexMatched){
      
    }
  }
}

//converts (parameter, track) index to an osc address
char * numToOSCAddress( int index){
    static char s[10];
    int i = 9;
  
    s[i--]= '\0';
  do
    {
    s[i] = "0123456789"[index % 10];
                --i;
                index /= 10;
    }
    while(index && i);
    s[i] = '/';
    return &s[i];
}

void handleButtons(){
  if (buttonOne.update()) {
    if (buttonOne.fallingEdge()) {
     Serial.println("Button One pushed");
       
     OSCMessage msgOUT("/device/fx/-");
     msgOUT.add(1.0);
    Udp.beginPacket(outIp, destPort);
    msgOUT.send(Udp); // send the bytes
    Udp.endPacket(); // mark the end of the OSC Packet
    msgOUT.empty(); // free space occupied by message
    }
  }
  if (buttonTwo.update()) {
    if (buttonTwo.fallingEdge()) {
     Serial.println("Button Two pushed");
     OSCMessage msgOUT("/device/fx/+");
     msgOUT.add(1.0);
    Udp.beginPacket(outIp, destPort);
    msgOUT.send(Udp); // send the bytes
    Udp.endPacket(); // mark the end of the OSC Packet
    msgOUT.empty(); // free space occupied by message
    }
  }
}

void handleEncoders(){
  // long for new encoder value
  long newEncoderValue = 0;
  // Encoder One
  newEncoderValue=encoderOne.read();
  if (newEncoderValue!=currentEncoderOneValue){
    currentEncoderOneValue=newEncoderValue;
    Serial.println(currentEncoderOneValue);
  }
  // Encoder Two
  newEncoderValue=encoderTwo.read();
  if (newEncoderValue!=currentEncoderTwoValue){
    currentEncoderTwoValue=newEncoderValue;
    Serial.println(currentEncoderTwoValue);
  }
}
Gerrit is online now   Reply With Quote