1

I am working on an arduino uno + supercollider 3 project.

Basicly: I have an arduino set up with potentiometers, a sensor and some buttons. I put the data of inputs in an array and send it to my computer trough serial.

Currently, my output in the Arduino serial monitor is as this: 271:189:75:0:0:0:1:0:0:0:0:0

If I open the serial connection in Supercollider, what arrives is this: 271

Only the first value in the array arrives correctly. (The same setup with just 1 Arduino input to Supercollider worked like a charm, by the way. I just can't get it working with an array of inputs from arduino to SC3.)

arduino code to send data at this moment:

teSturen = String(val_lichtPin) + ":" + String(val_Pot1Pin) + ":" + String(val_Pot2Pin) + ":" + String(val_Pot3Pin) + ":" + String(val_Pot4Pin) + ":" + String(val_Pot5Pin) + ":" + String(knop1Staat) + ":" + String(knop2Staat) + ":" + String(knop3Staat) + ":" + String(knop4Staat) + ":" + String(knop5Staat) + ":" + String(knop6Staat);

Serial.println(String(teSturen));

I put all the numbers together in one string with an : as seperator, then send this.

SC3 code to receive:

~ino = ArduinoSMS("/dev/ttyACM0",9600);

~ino.action = {
    arg msg;
    var amsg;
    //amsg = msg.split($:);
    msg.postln;
};

There is more code, but that is for appointing vars and args, defining synths, et cetera. I limited this to the bits where it doesn't work.

Any ideas on why SC3 only receives the first number? I have tried for example to recplace the seperator : by , or ;, to send it as multiple integers in stead of one string, ...

The goal of it for me, is to be able to control various synths in supercollider with fysical control potentiometers, because that's a lot more fun to play with than keyboard or mouse controlling synths...

I appreciate any help, thank you!

Nic
  • 11
  • 2
  • ArduinoSMS is a pretty old quark (last version of dating back to 2006 as far as I can tell) and not shipped with sc by default nowadays. Given its obscurity and apparent lack of maintenance it's probably best you email its author for any bugs you found... – Fizz Nov 11 '16 at 04:39

1 Answers1

0

Pretty late, but this still might help. I used the same setup some years ago. I used

p = ArduinoSMS("/dev/tty.usbmodem3d11", 115200);

while{state==0}{                                        
    p.action = { |... msg| m=[msg[0],msg[1]];
    do something with m[0] and m[1] ...
};

to parse the message stream. My setup only read arrays of two bytes (msg[0]and msg[1]), but this should be expandable.

The full source code is available on https://github.com/symbolrush/FridgeKiller and another project with the same setup on https://github.com/symbolrush/ColliDuino.

Hope this helps and good luck!

symbolrush
  • 7,123
  • 1
  • 39
  • 67