ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2009-03-01T23:11:04+02:00 https://brainmodular.org/forums/app.php/feed/topic/689 2009-03-01T23:11:04+02:00 2009-03-01T23:11:04+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7695#p7695 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 01 Mar 2009, 22:11


]]>
2009-03-01T12:48:03+02:00 2009-03-01T12:48:03+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7690#p7690 <![CDATA[Inputting serial data]]>
I finally found the solution for low cost of cpu with S2MIDI.
i have to use a very slow baud.

it seems that arduino vs usine are interesting a lot of people ...1296 views.

Statistics: Posted by headphoner — 01 Mar 2009, 11:48


]]>
2009-03-01T02:04:53+02:00 2009-03-01T02:04:53+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7687#p7687 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 01 Mar 2009, 01:04


]]>
2009-02-28T10:51:23+02:00 2009-02-28T10:51:23+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7678#p7678 <![CDATA[Inputting serial data]]> I'll watch it's future developments.

Statistics: Posted by senso — 28 Feb 2009, 09:51


]]>
2009-02-28T07:15:22+02:00 2009-02-28T07:15:22+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7674#p7674 <![CDATA[Inputting serial data]]> ! when you get around to it remember my offer to lend you an arduino board for testing may still stand, i don't have any immediate plans for it. also, i'd be happy if only the firmata protocol (http://www.arduino.cc/playground/Interfacing/Firmata) got implemented as this would at least allow the bords I/O to be available for use in Usine.

Statistics: Posted by Clearscreen — 28 Feb 2009, 06:15


]]>
2009-02-27T01:18:19+02:00 2009-02-27T01:18:19+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7669#p7669 <![CDATA[Inputting serial data]]> I should sleep a little more....
sorry for the bad file.
Forget the test.

Statistics: Posted by senso — 27 Feb 2009, 00:18


]]>
2009-02-27T01:05:55+02:00 2009-02-27T01:05:55+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7667#p7667 <![CDATA[Inputting serial data]]>
yes but I forgot to clarify that after this message the program quits. So apparently it doesn't want to run without Delphi or C++Builder IDE?

a
just to confirm, same trouble here senso...

Statistics: Posted by Clearscreen — 27 Feb 2009, 00:05


]]>
2009-02-26T21:53:34+02:00 2009-02-26T21:53:34+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7666#p7666 <![CDATA[Inputting serial data]]>
a

Statistics: Posted by antwan — 26 Feb 2009, 20:53


]]>
2009-02-26T21:41:05+02:00 2009-02-26T21:41:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7665#p7665 <![CDATA[Inputting serial data]]> Statistics: Posted by senso — 26 Feb 2009, 20:41


]]>
2009-02-26T21:04:12+02:00 2009-02-26T21:04:12+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7664#p7664 <![CDATA[Inputting serial data]]>
I tried the test program but there was one little problem :) When I selected the COM port and clicked Open the software gives an alert box that states:
"Demo version runs only with Delphi or C++Builder IDE"

antwan

Statistics: Posted by antwan — 26 Feb 2009, 20:04


]]>
2009-02-26T12:57:32+02:00 2009-02-26T12:57:32+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7663#p7663 <![CDATA[Inputting serial data]]> http://www.sensomusic.com/forums/upload ... alPort.zip

Statistics: Posted by senso — 26 Feb 2009, 11:57


]]>
2009-02-26T12:09:59+02:00 2009-02-26T12:09:59+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7662#p7662 <![CDATA[Inputting serial data]]>
I have uploaded a test program http://sensomusic.com/forums/uploaded/T ... alPort.zip
unfortunately the download is coming up '403 Forbidden'? looking forward to trying it! :)

Statistics: Posted by Clearscreen — 26 Feb 2009, 11:09


]]>
2009-02-26T10:13:36+02:00 2009-02-26T10:13:36+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7661#p7661 <![CDATA[Inputting serial data]]> I have uploaded a test program http://sensomusic.com/forums/uploaded/T ... alPort.zip.
Tel me if it works (you can see incoming data's) and what is the speed of the communication. It's a first step. If it works it means that it's easy to implement.

I concentrate my work on the global ergonomic of Usine and this kind of module is a perfect candidate for a User module (SDK)?

Statistics: Posted by senso — 26 Feb 2009, 09:13


]]>
2009-02-26T02:10:27+02:00 2009-02-26T02:10:27+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7660#p7660 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 26 Feb 2009, 01:10


]]>
2009-02-09T22:45:15+02:00 2009-02-09T22:45:15+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7469#p7469 <![CDATA[Inputting serial data]]>
No I'm still stuck using S2MIDI. I'd love to be running only one software though (=Usine!)...

antwan

Statistics: Posted by antwan — 09 Feb 2009, 21:45


]]>
2009-02-09T20:34:03+02:00 2009-02-09T20:34:03+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7468#p7468 <![CDATA[Inputting serial data]]>
I just begin with arduino, so i want to know your experiences with arduino and usine.

I tried S2MIDI but it cost a lot of cpu on my computer...anybody improved other solution to receive serial data from the arduino to usine?

Statistics: Posted by headphoner — 09 Feb 2009, 19:34


]]>
2007-12-22T00:08:35+02:00 2007-12-22T00:08:35+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3503#p3503 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 21 Dec 2007, 23:08


]]>
2007-12-21T10:15:33+02:00 2007-12-21T10:15:33+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3502#p3502 <![CDATA[Inputting serial data]]> you could get an arduino, one simple switch and some connecting wire and you're basically ready to go. maybe one led to test the data the other way...

if you like, you could also check the source code of this simple opensource application called S2MIDI, which basically receives data from a serial port and sends it forward along a virtual midi port.
http://www.memeteam.net/2007/s2midi/
and the code is available at:
http://code.google.com/p/s2midi/source/

I have used this succesfully with Arduino. It works only one way though.

best regards,

antwan

Statistics: Posted by antwan — 21 Dec 2007, 09:15


]]>
2007-12-21T09:58:51+02:00 2007-12-21T09:58:51+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3501#p3501 <![CDATA[Inputting serial data]]> I know by (small) experience that creating low level hardware interfaces is not so easy...especially if you don't have the hardware itself!
The first thing is to buy one!

Statistics: Posted by senso — 21 Dec 2007, 08:58


]]>
2007-12-20T23:53:20+02:00 2007-12-20T23:53:20+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3500#p3500 <![CDATA[Inputting serial data]]> http://www.arduino.cc/playground/Interfacing/Firmata that may help. it appears that the guys over there are pretty happy to help write code to allow the board to interface with any software so it might be worth getting in touch with them if you need any assistance?
regards
C.

Statistics: Posted by Clearscreen — 20 Dec 2007, 22:53


]]>
2007-12-20T14:54:27+02:00 2007-12-20T14:54:27+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3499#p3499 <![CDATA[Inputting serial data]]> 1) What the Arduino sends along the USB cable is coded into the Arduino microchip
2) For reading what is sent through the port, Usine should have the tools.

So let's say that the Arduino code sends a package sized three bytes, each containing one number (like a simple midi command would be). Usine should have the tools to open/close a certain COM-port. Then receive packages of varying sizes (if this is trouble, one could start with, say, 1-5 bytes in size) and the user should be able to treat those bytes separately. To me it seems to be quite like the way in which you've setup the OSC system. Here's another Arduino code, demonstrating input from a switch (=digital input of Arduino) turned into a "midi command" i.e. a 3 byte serial package:

CODE:

int buttonA = 2;  // Pin button is connected to// Key de-bouncing stuffint lastKey = 0;long time = 0;int debounce = 100;// minimum allowed time between button pressesvoid setup&#40;&#41;                    // run once, when the sketch starts&#123;  pinMode&#40;buttonA, INPUT&#41;;      // sets the digital pin as input  digitalWrite&#40;buttonA, HIGH&#41;;  // Pull high  Serial.begin&#40;9600&#41;;           // Start serial output&#125;void loop&#40;&#41;                     // run over and over again&#123;  if &#40;&#40;digitalRead&#40;buttonA&#41; == LOW&#41; && &#40;millis&#40;&#41; - time > debounce&#41; && lastKey != 1&#41; &#123;    noteOn&#40;9,56,120&#41;;  // channel 9 - maps to MIDI channel 10 AKA percussion&#41;                       // note 56 - Cow Bell!           // velocity 120 &#40;127 = max&#41;    time = millis&#40;&#41;;// Reset debounce clock    lastKey = 1;     // Store last button state  &#125;  else if &#40;&#40;digitalRead&#40;buttonA&#41; == HIGH&#41; && lastKey == 1&#41;    lastKey = 0;&#125;// Send a MIDI note-on messagevoid noteOn&#40;byte channel, byte note, byte velocity&#41; &#123;  midiMsg&#40;channel+0x90, note, velocity&#41;;&#125;// Send a MIDI control changevoid controlChange&#40;byte channel, byte controller, byte value&#41; &#123;   midiMsg&#40;channel+0xB0, controller, value&#41;;&#125;// Send a general MIDI messagevoid midiMsg&#40;byte cmd, byte data1, byte data2&#41; &#123;  Serial.print&#40;cmd, BYTE&#41;;  Serial.print&#40;data1, BYTE&#41;;  Serial.print&#40;data2, BYTE&#41;;&#125;
Also, I can of course point you to some examples of how this has been implemented in PureData, Processing or Max, etc.

Thanks,

antwan

Statistics: Posted by antwan — 20 Dec 2007, 13:54


]]>
2007-12-18T21:23:05+02:00 2007-12-18T21:23:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3483#p3483 <![CDATA[Inputting serial data]]> I will help.
But the I can't do anything without a real arduino!

Statistics: Posted by senso — 18 Dec 2007, 20:23


]]>
2007-12-18T09:32:54+02:00 2007-12-18T09:32:54+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3481#p3481 <![CDATA[Inputting serial data]]>
great. Well the arduino microcontroller is programmed with c++ (or c ?)... anyways. i think it's rather straightforward and simple. one should be able to select the serial port (COM #).
here's a simple code loaded to the arduino for reading the digital and analog input pins and sending them for MAX/MSP to read over serial. maybe this gives an idea:

CODE:

 /*   *  Arduino2Max *  Send pin values from Arduino to MAX/MSP *   *  Arduino2Max.pde *  ------------   *  This version&#58; .4, October 2007 *  ------------ *  Copyleft&#58; use as you like *  by Daniel Jolliffe *  Based on a sketch and patch by Thomas Ouellet Fredericks  tof.danslchamp.org *   */int x = 0;                              // a place to hold pin valuesint ledpin = 13;void setup&#40;&#41;&#123;  Serial.begin&#40;115200&#41;;               // 115200 is the default Arduino Bluetooth speed  digitalWrite&#40;13,HIGH&#41;;              ///startup blink  delay&#40;600&#41;;  digitalWrite&#40;13,LOW&#41;;  pinMode&#40;13,INPUT&#41;;&#125;void loop&#40;&#41;&#123; if &#40;Serial.available&#40;&#41; > 0&#41;&#123;         // Check serial buffer for characters            if &#40;Serial.read&#40;&#41; == 'r'&#41; &#123;       // If an 'r' is received then read the pins    for &#40;int pin= 0; pin<=5; pin++&#41;&#123;      // Read and send analog pins 0-5    x = analogRead&#40;pin&#41;;    sendValue &#40;x&#41;;    &#125;for &#40;int pin= 2; pin<=13; pin++&#41;&#123;     // Read and send digital pins 2-13    x = digitalRead&#40;pin&#41;;    sendValue &#40;x&#41;;    &#125;      Serial.println&#40;&#41;;                 // Send a carriage returnt to mark end of pin data.     delay &#40;5&#41;;                        // add a delay to prevent crashing/overloading of the serial port    &#125; &#125;&#125;void sendValue &#40;int x&#41;&#123;              // function to send the pin value followed by a "space".  Serial.print&#40;x&#41;; Serial.print&#40;32, BYTE&#41;; &#125;
let me know if this helps at all. i can dig plenty more of material if needed....

antwan

Statistics: Posted by antwan — 18 Dec 2007, 08:32


]]>
2007-12-16T20:39:26+02:00 2007-12-16T20:39:26+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3474#p3474 <![CDATA[Inputting serial data]]> Statistics: Posted by senso — 16 Dec 2007, 19:39


]]>
2007-12-13T16:54:27+02:00 2007-12-13T16:54:27+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3464#p3464 <![CDATA[Inputting serial data]]>
I wonder if you would have interest in implementing inputting of raw serial data for use with interfacing boards like Arduino / Wiring? This would cancel the need of using programs like Pure Data or Max/MSP in between, inputting the serial data from the USB port and converting it to OSC.

What do you think?

Antwan

Statistics: Posted by antwan — 13 Dec 2007, 15:54


]]>
BrainModular BrainModular Users Forum 2009-03-01T23:11:04+02:00 https://brainmodular.org/forums/app.php/feed/topic/689 2009-03-01T23:11:04+02:00 2009-03-01T23:11:04+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7695#p7695 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 01 Mar 2009, 22:11


]]>
2009-03-01T12:48:03+02:00 2009-03-01T12:48:03+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7690#p7690 <![CDATA[Inputting serial data]]>
I finally found the solution for low cost of cpu with S2MIDI.
i have to use a very slow baud.

it seems that arduino vs usine are interesting a lot of people ...1296 views.

Statistics: Posted by headphoner — 01 Mar 2009, 11:48


]]>
2009-03-01T02:04:53+02:00 2009-03-01T02:04:53+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7687#p7687 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 01 Mar 2009, 01:04


]]>
2009-02-28T10:51:23+02:00 2009-02-28T10:51:23+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7678#p7678 <![CDATA[Inputting serial data]]> I'll watch it's future developments.

Statistics: Posted by senso — 28 Feb 2009, 09:51


]]>
2009-02-28T07:15:22+02:00 2009-02-28T07:15:22+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7674#p7674 <![CDATA[Inputting serial data]]> ! when you get around to it remember my offer to lend you an arduino board for testing may still stand, i don't have any immediate plans for it. also, i'd be happy if only the firmata protocol (http://www.arduino.cc/playground/Interfacing/Firmata) got implemented as this would at least allow the bords I/O to be available for use in Usine.

Statistics: Posted by Clearscreen — 28 Feb 2009, 06:15


]]>
2009-02-27T01:18:19+02:00 2009-02-27T01:18:19+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7669#p7669 <![CDATA[Inputting serial data]]> I should sleep a little more....
sorry for the bad file.
Forget the test.

Statistics: Posted by senso — 27 Feb 2009, 00:18


]]>
2009-02-27T01:05:55+02:00 2009-02-27T01:05:55+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7667#p7667 <![CDATA[Inputting serial data]]>
yes but I forgot to clarify that after this message the program quits. So apparently it doesn't want to run without Delphi or C++Builder IDE?

a
just to confirm, same trouble here senso...

Statistics: Posted by Clearscreen — 27 Feb 2009, 00:05


]]>
2009-02-26T21:53:34+02:00 2009-02-26T21:53:34+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7666#p7666 <![CDATA[Inputting serial data]]>
a

Statistics: Posted by antwan — 26 Feb 2009, 20:53


]]>
2009-02-26T21:41:05+02:00 2009-02-26T21:41:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7665#p7665 <![CDATA[Inputting serial data]]> Statistics: Posted by senso — 26 Feb 2009, 20:41


]]>
2009-02-26T21:04:12+02:00 2009-02-26T21:04:12+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7664#p7664 <![CDATA[Inputting serial data]]>
I tried the test program but there was one little problem :) When I selected the COM port and clicked Open the software gives an alert box that states:
"Demo version runs only with Delphi or C++Builder IDE"

antwan

Statistics: Posted by antwan — 26 Feb 2009, 20:04


]]>
2009-02-26T12:57:32+02:00 2009-02-26T12:57:32+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7663#p7663 <![CDATA[Inputting serial data]]> http://www.sensomusic.com/forums/upload ... alPort.zip

Statistics: Posted by senso — 26 Feb 2009, 11:57


]]>
2009-02-26T12:09:59+02:00 2009-02-26T12:09:59+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7662#p7662 <![CDATA[Inputting serial data]]>
I have uploaded a test program http://sensomusic.com/forums/uploaded/T ... alPort.zip
unfortunately the download is coming up '403 Forbidden'? looking forward to trying it! :)

Statistics: Posted by Clearscreen — 26 Feb 2009, 11:09


]]>
2009-02-26T10:13:36+02:00 2009-02-26T10:13:36+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7661#p7661 <![CDATA[Inputting serial data]]> I have uploaded a test program http://sensomusic.com/forums/uploaded/T ... alPort.zip.
Tel me if it works (you can see incoming data's) and what is the speed of the communication. It's a first step. If it works it means that it's easy to implement.

I concentrate my work on the global ergonomic of Usine and this kind of module is a perfect candidate for a User module (SDK)?

Statistics: Posted by senso — 26 Feb 2009, 09:13


]]>
2009-02-26T02:10:27+02:00 2009-02-26T02:10:27+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7660#p7660 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 26 Feb 2009, 01:10


]]>
2009-02-09T22:45:15+02:00 2009-02-09T22:45:15+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7469#p7469 <![CDATA[Inputting serial data]]>
No I'm still stuck using S2MIDI. I'd love to be running only one software though (=Usine!)...

antwan

Statistics: Posted by antwan — 09 Feb 2009, 21:45


]]>
2009-02-09T20:34:03+02:00 2009-02-09T20:34:03+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=7468#p7468 <![CDATA[Inputting serial data]]>
I just begin with arduino, so i want to know your experiences with arduino and usine.

I tried S2MIDI but it cost a lot of cpu on my computer...anybody improved other solution to receive serial data from the arduino to usine?

Statistics: Posted by headphoner — 09 Feb 2009, 19:34


]]>
2007-12-22T00:08:35+02:00 2007-12-22T00:08:35+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3503#p3503 <![CDATA[Inputting serial data]]> Statistics: Posted by Clearscreen — 21 Dec 2007, 23:08


]]>
2007-12-21T10:15:33+02:00 2007-12-21T10:15:33+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3502#p3502 <![CDATA[Inputting serial data]]> you could get an arduino, one simple switch and some connecting wire and you're basically ready to go. maybe one led to test the data the other way...

if you like, you could also check the source code of this simple opensource application called S2MIDI, which basically receives data from a serial port and sends it forward along a virtual midi port.
http://www.memeteam.net/2007/s2midi/
and the code is available at:
http://code.google.com/p/s2midi/source/

I have used this succesfully with Arduino. It works only one way though.

best regards,

antwan

Statistics: Posted by antwan — 21 Dec 2007, 09:15


]]>
2007-12-21T09:58:51+02:00 2007-12-21T09:58:51+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3501#p3501 <![CDATA[Inputting serial data]]> I know by (small) experience that creating low level hardware interfaces is not so easy...especially if you don't have the hardware itself!
The first thing is to buy one!

Statistics: Posted by senso — 21 Dec 2007, 08:58


]]>
2007-12-20T23:53:20+02:00 2007-12-20T23:53:20+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3500#p3500 <![CDATA[Inputting serial data]]> http://www.arduino.cc/playground/Interfacing/Firmata that may help. it appears that the guys over there are pretty happy to help write code to allow the board to interface with any software so it might be worth getting in touch with them if you need any assistance?
regards
C.

Statistics: Posted by Clearscreen — 20 Dec 2007, 22:53


]]>
2007-12-20T14:54:27+02:00 2007-12-20T14:54:27+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3499#p3499 <![CDATA[Inputting serial data]]> 1) What the Arduino sends along the USB cable is coded into the Arduino microchip
2) For reading what is sent through the port, Usine should have the tools.

So let's say that the Arduino code sends a package sized three bytes, each containing one number (like a simple midi command would be). Usine should have the tools to open/close a certain COM-port. Then receive packages of varying sizes (if this is trouble, one could start with, say, 1-5 bytes in size) and the user should be able to treat those bytes separately. To me it seems to be quite like the way in which you've setup the OSC system. Here's another Arduino code, demonstrating input from a switch (=digital input of Arduino) turned into a "midi command" i.e. a 3 byte serial package:

CODE:

int buttonA = 2;  // Pin button is connected to// Key de-bouncing stuffint lastKey = 0;long time = 0;int debounce = 100;// minimum allowed time between button pressesvoid setup&#40;&#41;                    // run once, when the sketch starts&#123;  pinMode&#40;buttonA, INPUT&#41;;      // sets the digital pin as input  digitalWrite&#40;buttonA, HIGH&#41;;  // Pull high  Serial.begin&#40;9600&#41;;           // Start serial output&#125;void loop&#40;&#41;                     // run over and over again&#123;  if &#40;&#40;digitalRead&#40;buttonA&#41; == LOW&#41; && &#40;millis&#40;&#41; - time > debounce&#41; && lastKey != 1&#41; &#123;    noteOn&#40;9,56,120&#41;;  // channel 9 - maps to MIDI channel 10 AKA percussion&#41;                       // note 56 - Cow Bell!           // velocity 120 &#40;127 = max&#41;    time = millis&#40;&#41;;// Reset debounce clock    lastKey = 1;     // Store last button state  &#125;  else if &#40;&#40;digitalRead&#40;buttonA&#41; == HIGH&#41; && lastKey == 1&#41;    lastKey = 0;&#125;// Send a MIDI note-on messagevoid noteOn&#40;byte channel, byte note, byte velocity&#41; &#123;  midiMsg&#40;channel+0x90, note, velocity&#41;;&#125;// Send a MIDI control changevoid controlChange&#40;byte channel, byte controller, byte value&#41; &#123;   midiMsg&#40;channel+0xB0, controller, value&#41;;&#125;// Send a general MIDI messagevoid midiMsg&#40;byte cmd, byte data1, byte data2&#41; &#123;  Serial.print&#40;cmd, BYTE&#41;;  Serial.print&#40;data1, BYTE&#41;;  Serial.print&#40;data2, BYTE&#41;;&#125;
Also, I can of course point you to some examples of how this has been implemented in PureData, Processing or Max, etc.

Thanks,

antwan

Statistics: Posted by antwan — 20 Dec 2007, 13:54


]]>
2007-12-18T21:23:05+02:00 2007-12-18T21:23:05+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3483#p3483 <![CDATA[Inputting serial data]]> I will help.
But the I can't do anything without a real arduino!

Statistics: Posted by senso — 18 Dec 2007, 20:23


]]>
2007-12-18T09:32:54+02:00 2007-12-18T09:32:54+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3481#p3481 <![CDATA[Inputting serial data]]>
great. Well the arduino microcontroller is programmed with c++ (or c ?)... anyways. i think it's rather straightforward and simple. one should be able to select the serial port (COM #).
here's a simple code loaded to the arduino for reading the digital and analog input pins and sending them for MAX/MSP to read over serial. maybe this gives an idea:

CODE:

 /*   *  Arduino2Max *  Send pin values from Arduino to MAX/MSP *   *  Arduino2Max.pde *  ------------   *  This version&#58; .4, October 2007 *  ------------ *  Copyleft&#58; use as you like *  by Daniel Jolliffe *  Based on a sketch and patch by Thomas Ouellet Fredericks  tof.danslchamp.org *   */int x = 0;                              // a place to hold pin valuesint ledpin = 13;void setup&#40;&#41;&#123;  Serial.begin&#40;115200&#41;;               // 115200 is the default Arduino Bluetooth speed  digitalWrite&#40;13,HIGH&#41;;              ///startup blink  delay&#40;600&#41;;  digitalWrite&#40;13,LOW&#41;;  pinMode&#40;13,INPUT&#41;;&#125;void loop&#40;&#41;&#123; if &#40;Serial.available&#40;&#41; > 0&#41;&#123;         // Check serial buffer for characters            if &#40;Serial.read&#40;&#41; == 'r'&#41; &#123;       // If an 'r' is received then read the pins    for &#40;int pin= 0; pin<=5; pin++&#41;&#123;      // Read and send analog pins 0-5    x = analogRead&#40;pin&#41;;    sendValue &#40;x&#41;;    &#125;for &#40;int pin= 2; pin<=13; pin++&#41;&#123;     // Read and send digital pins 2-13    x = digitalRead&#40;pin&#41;;    sendValue &#40;x&#41;;    &#125;      Serial.println&#40;&#41;;                 // Send a carriage returnt to mark end of pin data.     delay &#40;5&#41;;                        // add a delay to prevent crashing/overloading of the serial port    &#125; &#125;&#125;void sendValue &#40;int x&#41;&#123;              // function to send the pin value followed by a "space".  Serial.print&#40;x&#41;; Serial.print&#40;32, BYTE&#41;; &#125;
let me know if this helps at all. i can dig plenty more of material if needed....

antwan

Statistics: Posted by antwan — 18 Dec 2007, 08:32


]]>
2007-12-16T20:39:26+02:00 2007-12-16T20:39:26+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3474#p3474 <![CDATA[Inputting serial data]]> Statistics: Posted by senso — 16 Dec 2007, 19:39


]]>
2007-12-13T16:54:27+02:00 2007-12-13T16:54:27+02:00 https://brainmodular.org/forums/viewtopic.php?t=689&p=3464#p3464 <![CDATA[Inputting serial data]]>
I wonder if you would have interest in implementing inputting of raw serial data for use with interfacing boards like Arduino / Wiring? This would cancel the need of using programs like Pure Data or Max/MSP in between, inputting the serial data from the USB port and converting it to OSC.

What do you think?

Antwan

Statistics: Posted by antwan — 13 Dec 2007, 15:54


]]>