Hello everyone
I'm bulding a MIDI controller for an EQ plugin (I use Reaper as host, but could be any other). The hardware and MIDI parts work fine. Now I'm trying to add OSC functionality and I need a llitle help here.
I think I've managed to send some OSC messages throug the USB. Just attaching a pot to analog(0) and:
#include <OSCMessage.h>
int curVal;
int prevVal=0;
void setup() {
Serial.begin(9600);
}
void loop(){
OSCMessage msg("n/track/1/volume");
curVal=analogRead(0);
if (curVal != prevVal) {
msg.add(curVal);
msg.send(Serial);
prevVal=curVal;
}
delay(20);
}
I have two questions though. The results on the Teensy Monitor are weird. ASCII characters appear instead of the int type values expected. Any ideas?
Besides, the next step should be to somehow communicate this to Reaper. However Reaper OSC configuration window expects an IP/Port.
As long as I'm using the USB to transmit the OSC messages with no Wifi/Ethernet involved, what Teensy's IP/port should I use?
Thank you for your help!
Kaitain:
The results on the Teensy Monitor are weird. ASCII characters appear instead of the int type values expected. Any ideas?
That's normal, it's sent as binary, not as text.
Kaitain:
Besides, the next step should be to somehow communicate this to Reaper. However Reaper OSC configuration window expects an IP/Port.
As long as I'm using the USB to transmit the OSC messages with no Wifi/Ethernet involved, what Teensy's IP/port should I use?
IIRC, you need a SLIP driver.
Pieter
Thank you Pieterp.
I understand that I need SLIPSerial to send the original OSC network messages throug the USB, which is a serial protocol. Also, a driver is needed at the other ent (the computer) to reconvert them from a serial format to a network one. Am I right?
But my search about what a SLIP driver is or where can I get it came out with no results. Can you give me a hand here?
Alvaro
Kaitain:
I understand that I need SLIPSerial to send the original OSC network messages throug the USB, which is a serial protocol. Also, a driver is needed at the other ent (the computer) to reconvert them from a serial format to a network one. Am I right?
Correct.
Kaitain:
But my search about what a SLIP driver is or where can I get it came out with no results. Can you give me a hand here?
I've never tried it myself, so I'm afraid I can't help you with that.
The CNMAT OSC library has support for SLIP serial over USB including Arduino examples as well as computer examples using Processing, PD, and MaxMSP.
I use the library for OSC over WiFi using an ESP8266 but I have never used SLIP serial.
Hi again. Still stucked here.
I've managed to send OSC messages using SLIP serial library. The problem now is that these messages are coming into the computer through the USB port, and my sequencer (Reaper), when congigured to OSC, is waiting for packets from the network card, with their corresponding IP address and port.
So, it seems that now I need an intermediate program that takes the SLIP messages from the USB and "tricks" the SO, making it to think that these messages comes in fact from the network card.
So far haven't found anything like that. What I've found is a lot of apps useful to share your USB devices over an network, but what I need this hapenning inside my own computer. Any ideas?
Cheers
Alvaro
Searched for "processing osc slip" and found this.
Or try a Teensy 3.x Feather Adaptor with an Ethernet FeatherWing. Assuming the adafruit libraries work on Teensy 3.x, you might be able to replace OSC USB serial with OSC over UDP over Ethernet.
Thank you gdsports
The problem I find with this: A small test program which converts slip osc messages to normal udp messages. · GitHub
is that it doesn't solve the issue of making the SO to think that the messages come from the network card. Reaper still expects an IP/port. So even if the packets are converted to UDP format it still looks that an intermediate driver/software is needed.
I think that maybe I've the solution, though: OSCii-bot. This is an intermediate software that converts tfrom MIDI to OSC an from OSC to MIDI. So using this I don't have to transmit OSC messages from my controller, I just send the normal MIDI messages and OSCii-bot, in theory, converts them to OSC, so Reaper can catch them.
I'm doing some tests right now....
Cheers
I wrote a simple Node JS script that translates SLIP OSC to UDP OSC (bidirectional).
I'm currently adding some comments and cleaning it up, I'll post the result in a moment.
Here you go:
Node.js SLIP-to-UDP Bridge
Tested using Node.js v8.11.3 on Ubuntu 16.04, using a Teensy 3.2 and Reaper.
PieterP, this looks amazing! Can't wait to reach home and test it.
Sorry for the noob question, I'm not familiar with github (or JS). Can you guide me through the installing procedure?
Also, regarding this:
node main.js [local-port [remote-port [remote-address]]]
"remote address" is the one that is "artificially" asigned by your node to my hardware controller, right?
The online instructions on how to install Node.js and npm (the Node package manager) would be much clearer than my explanation. Then use npm to install the serialport library: npm install serialport
.
Finally, save the main.js and SLIP.js files from GitHub (you can either click 'raw' on each file and then CTRL+S to save them, or you can download the ZIP of the entire Projects repository by going to the tttapa/Projects home page and clicking the green button 'clone or download'.
Finally, open a terminal/console, and navigate to the folder where you saved the .js files (using the cd
command). Then run the script using node main.js [local-port [remote-port [remote-address]]]
(the square brackets indicate that some parts are optional, you don't actually type them).
For example:
node main.js 8888 9999 localhost
Will listen for incoming UDP packets on port 8888, and send UDP packets to port 9999 on localhost.
If you run the Node script on the same machine as Reaper, the remote address is always 'localhost'.
The corresponding Reaper settings would be port 9999 as the receiving port, 'localhost' as the send address, and 8888 as the port to send to.
Note that the Node script doesn't artificially assign an IP address to the Arduino. The script runs on your computer, so it uses the address of that computer. You can select the port number to use, however.