[Csnd] serial opcodes w/ arduino demo
Date | 2011-09-06 20:39 |
From | matt ingalls |
Subject | [Csnd] serial opcodes w/ arduino demo |
here's code and video of a little demo i made with these new serial bus opcodes: ( note the arduino code is even simpler than the csound code!! ) VIDEO: http://gallery.me.com/mattingalls#100119 ========================================== ARDUINO CODE: void setup() { // enable serial communication Serial.begin(9600); // declare pin 9 to be an output: pinMode(9, OUTPUT); } void loop() { // only do something if we received something (this should be at csound's k-rate) if (Serial.available()) { // set the brightness of LED (connected to pin 9) to our input value int brightness = Serial.read(); analogWrite(9, brightness); // while we are here, get our knob value and send it to csound int sensorValue = analogRead(A0); Serial.write(sensorValue/4); // scale to 1-byte range (0-255) } } ====================================================== CSOUND CODE: run with a commandline something like: csound --opcode-lib=serialOpcodes.dylib serialdemo.csd -odac -iadc |
Date | 2011-09-07 07:34 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] serial opcodes w/ arduino demo |
Thanks a lot Matt, for the opcodes and for a nice example. Oeyvind 2011/9/6 matt ingalls <matt@sonomatics.com> here's code and video of a little demo i made with these new serial bus opcodes: |
Date | 2011-09-07 09:09 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] serial opcodes w/ arduino demo |
These new opcodes are awesome! Thanks so much for writing them and adding them to Csound. Can't wait to try them on my machine. My Arduinos should arrive tomorrow. Looking forward to more of your video demos and code that will serve to inspire all of us to Take full advantage of all the new possibilities that this capability brings to Csound. Thanks so much Matt. Rick. Sent from my iPad. On Sep 6, 2011, at 3:39 PM, matt ingalls |