Forums > MaxMSP

Pulse sensor amped + Max


May 15 2013 | 1:23 pm

Trying to get it working.

 

Has anyone had any luck?

 

/Hi

May 16 2013 | 3:28 am

I’d start by testing it with the processing software that comes with it. Did you get that running? That’ll let you know if the hardware hookup and arduino code is running.

If you do get that running, then it’s just a matter of listening on the right port from [serial].

May 16 2013 | 5:15 am

I’ve acctually got it working yesterday with the help of serial :) Was way to early here on Cycling.

 

Thanks anyway!

Nov 11 2013 | 7:29 am

In regards to this post,
Did you guys upload the ‘Pulse Sensor’ sketch in the Arduino IDE from http://pulsesensor.com/ first before using the pulse sensor in Max? Or, did you just use ‘Standard Firmata’ and then just take the totally raw data from the ‘Pulse Sensor’ in Max? My thinking is that if I upload that ‘Pulse Sensor’ sketch from Arduino IDE first, then my data from ‘A0’ of my pulse would be averaged out already.

Thanks for the help


Mike

Jan 02 2016 | 12:07 am

Hi, I’m a new user of Pulse Sensosr; have you fixed the problems to use this sensor with Max via Arduino?

Jan 02 2016 | 1:01 am

I’m using it. just getting the data into max through the serial obj.

Jan 02 2016 | 3:59 am

Yes, I’ve try to do it, but the sensor just send data as "On" if you touch it, and "Off" if you don’t touch it; to releve the pulse I’ve try to use the original arduino program PulseSensorAmped_Arduino_1dot1.ino, that work very well but don’y communcate to max via serial. I’m not a programmer, so I don’t know how modify the PulseSensorAmped_Arduino_1dot1.ino or mix PulseSensorAmped_Arduino_1dot1.ino with Maxuino or similar.

Jan 02 2016 | 5:06 pm

This was ages ago and I got it working! Just made another experiment with them actually. https://www.youtube.com/watch?v=DcKTf8BAOf4

All you need is the serial object!

In the default Pulse sensor sketch for Arduino you first need to make a change:

static boolean serialVisual = false;

to

static boolean serialVisual = true;

Ok? Just upload that and connect your sensor. Next up is the max part. Create the serial object with a rate of 115200, [serial a 115200]. I don’t know what port you should use so you can just go from a and see when you get it right. I rarely use max anymore but I think that should be it. You should be receiving the BPM through the serial object.

Jan 04 2016 | 12:09 am

Thanks. but… in the sketch there ar no static boolean serialVisual command, only 2 volatile boolean:
volatile boolean Pulse = false; // true when pulse wave is high, false when it’s low
volatile boolean QS = false; // becomes true when Arduoino finds a beat.

maybe you using a different sketch.

This is the up to date original sketch by Pulse Sensor Amped

// VARIABLES
int pulsePin = 0; // Pulse Sensor purple wire connected to analog pin 0
int blinkPin = 13; // pin to blink led at each beat
int fadePin = 5; // pin to do fancy classy fading blink at each beat
int fadeRate = 0; // used to fade LED on with PWM on fadePin

// these variables are volatile because they are used during the interrupt service routine!
volatile int BPM; // used to hold the pulse rate
volatile int Signal; // holds the incoming raw data
volatile int IBI = 600; // holds the time between beats, the Inter-Beat Interval
volatile boolean Pulse = false; // true when pulse wave is high, false when it’s low
volatile boolean QS = false; // becomes true when Arduoino finds a beat.

void setup(){
pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat!
pinMode(fadePin,OUTPUT); // pin that will fade to your heartbeat!
Serial.begin(115200); // we agree to talk fast!
interruptSetup(); // sets up to read Pulse Sensor signal every 2mS
// UN-COMMENT THE NEXT LINE IF YOU ARE POWERING The Pulse Sensor AT LOW VOLTAGE,
// AND APPLY THAT VOLTAGE TO THE A-REF PIN
//analogReference(EXTERNAL);
}

void loop(){
sendDataToProcessing(‘S’, Signal); // send Processing the raw Pulse Sensor data
if (QS == true){ // Quantified Self flag is true when arduino finds a heartbeat
fadeRate = 255; // Set ‘fadeRate’ Variable to 255 to fade LED with pulse
sendDataToProcessing(‘B’,BPM); // send heart rate with a ‘B’ prefix
sendDataToProcessing(‘Q’,IBI); // send time between beats with a ‘Q’ prefix
QS = false; // reset the Quantified Self flag for next time
}

ledFadeToBeat();

delay(20); // take a break
}

void ledFadeToBeat(){
fadeRate -= 15; // set LED fade value
fadeRate = constrain(fadeRate,0,255); // keep LED fade value from going into negative numbers!
analogWrite(fadePin,fadeRate); // fade LED
}

void sendDataToProcessing(char symbol, int data ){
Serial.print(symbol); // symbol prefix tells Processing what type of data is coming
Serial.println(data); // the data to send culminating in a carriage return
}


JMC
Jan 04 2016 | 5:18 am

Hello,
Just for info, I’ve used successfully the Pulse Sensor Amped with a phidgets interface (http://www.phidgets.com/products.php?category=0&product_id=1011_0 or http://www.phidgets.com/products.php?category=0&product_id=1018_2)

JM

Jan 06 2016 | 7:13 pm

/* Pulse Sensor Amped 1.4 by Joel Murphy and Yury Gitman http://www.pulsesensor.com

———————- Notes ———————- ———————-
This code:
1) Blinks an LED to User’s Live Heartbeat PIN 13
2) Fades an LED to User’s Live HeartBeat
3) Determines BPM
4) Prints All of the Above to Serial

Read Me:
https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/blob/master/README.md
———————- ———————- ———————-
*/

// Variables
int pulsePin = 0; // Pulse Sensor purple wire connected to analog pin 0
int blinkPin = 13; // pin to blink led at each beat
int fadePin = 5; // pin to do fancy classy fading blink at each beat
int fadeRate = 0; // used to fade LED on with PWM on fadePin

// Volatile Variables, used in the interrupt service routine!
volatile int BPM; // int that holds raw Analog in 0. updated every 2mS
volatile int Signal; // holds the incoming raw data
volatile int IBI = 600; // int that holds the time interval between beats! Must be seeded!
volatile boolean Pulse = false; // "True" when User’s live heartbeat is detected. "False" when not a "live beat".
volatile boolean QS = false; // becomes true when Arduoino finds a beat.

// Regards Serial OutPut — Set This Up to your needs
static boolean serialVisual = true; // Set to ‘false’ by Default. Re-set to ‘true’ to see Arduino Serial Monitor ASCII Visual Pulse

void setup(){
pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat!
pinMode(fadePin,OUTPUT); // pin that will fade to your heartbeat!
Serial.begin(115200); // we agree to talk fast!
interruptSetup(); // sets up to read Pulse Sensor signal every 2mS
// UN-COMMENT THE NEXT LINE IF YOU ARE POWERING The Pulse Sensor AT LOW VOLTAGE,
// AND APPLY THAT VOLTAGE TO THE A-REF PIN
// analogReference(EXTERNAL);
}

// Where the Magic Happens
void loop(){
serialOutput() ;

if (QS == true){ // A Heartbeat Was Found
// BPM and IBI have been Determined
// Quantified Self "QS" true when arduino finds a heartbeat
digitalWrite(blinkPin,HIGH); // Blink LED, we got a beat.
fadeRate = 255; // Makes the LED Fade Effect Happen
// Set ‘fadeRate’ Variable to 255 to fade LED with pulse
serialOutputWhenBeatHappens(); // A Beat Happened, Output that to serial.
QS = false; // reset the Quantified Self flag for next time
}
else {

digitalWrite(blinkPin,LOW); // There is not beat, turn off pin 13 LED
}

ledFadeToBeat(); // Makes the LED Fade Effect Happen
delay(20); // take a break
}

This is the one I use.

Jan 08 2016 | 4:57 am

Hi Max, I try your sketch, but they don¡t work because two errors:

PulseSensors_OK.ino:37:29: error: ‘serialOutputWhenBeatHappens’ was not declared in this scope
PulseSensors_OK.ino:45:15: error: ‘ledFadeToBeat’ was not declared in this scope

The original PulseSensor sketch is composed by 2 sketch:
PulseSensorAmped_Arduino_1dot1.ino + Interrupt.ino

Maybe your sketch is composed bay 2 sketch?

Jan 09 2016 | 12:25 pm

Hi Max, are you sure that it working?
I’m copy the sketch but I can’t compilate it because:

sketch_jan09a.ino: In function ‘void setup()’:
sketch_jan09a.ino:37:18: error: ‘interruptSetup’ was not declared in this scope
sketch_jan09a.ino: In function ‘void loop()’:
sketch_jan09a.ino:47:18: error: ‘serialOutput’ was not declared in this scope
sketch_jan09a.ino:55:37: error: ‘serialOutputWhenBeatHappens’ was not declared in this scope

Witch Arduino board are you using? I’ve two ArduinoUno (last version).

Jan 10 2016 | 3:21 am

It works

But you can’t just copy the main sketch, you need all of them. InterruptSetup is in the Interrupt.ino and the other two are in AllSerialHandling.ino.

Im using a chinese Mega

Jan 10 2016 | 6:29 am

Yas, thank.
I found all the sketch and now Arduino works.
Now the problem is that the serial don’t receive data; well is another think. I’m try using differents Max patch to read serial data, the most simple is this:

Jan 10 2016 | 6:33 am

{
"boxes" : [ {
"box" : {
"maxclass" : "button",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 425.0, 282.0, 24.0, 24.0 ],
"id" : "obj-7",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel 13",
"style" : "",
"numoutlets" : 2,
"fontface" : 0,
"fontsize" : 9.0,
"outlettype" : [ "bang", "" ],
"patching_rect" : [ 398.0, 218.0, 38.0, 19.0 ],
"id" : "obj-4",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "thershold",
"style" : "",
"numoutlets" : 0,
"patching_rect" : [ 448.0, 465.0, 65.0, 20.0 ],
"id" : "obj-30",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Usare con skecth\nPing_modificato5\n\ndigital pin 3 trig\ndigital pin 4 echo",
"linecount" : 5,
"style" : "",
"numoutlets" : 0,
"fontsize" : 16.0,
"patching_rect" : [ 560.0, 48.0, 196.0, 96.0 ],
"id" : "obj-21",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "_____________________",
"style" : "",
"numoutlets" : 0,
"patching_rect" : [ 254.0, 601.0, 159.0, 20.0 ],
"id" : "obj-15",
"numinlets" : 1,
"textcolor" : [ 0.784314, 0.145098, 0.023529, 1.0 ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 407.0, 594.5, 24.0, 24.0 ],
"id" : "obj-9",
"parameter_enable" : 0,
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "change",
"style" : "",
"numoutlets" : 3,
"outlettype" : [ "", "int", "int" ],
"patching_rect" : [ 254.0, 289.0, 50.0, 22.0 ],
"id" : "obj-6",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "< 50",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 407.0, 465.0, 34.0, 22.0 ],
"id" : "obj-3",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "$1 750",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 254.0, 359.0, 47.0, 22.0 ],
"id" : "obj-25",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "line",
"style" : "",
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 254.0, 388.0, 40.0, 22.0 ],
"id" : "obj-2",
"numinlets" : 3
}

}
, {
"box" : {
"maxclass" : "slider",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 254.0, 459.5, 89.0, 186.0 ],
"id" : "obj-22",
"size" : 500.0,
"parameter_enable" : 0,
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "number",
"style" : "",
"numoutlets" : 2,
"htricolor" : [ 0.87, 0.82, 0.24, 1.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "bang" ],
"triscale" : 0.9,
"bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ],
"patching_rect" : [ 254.0, 415.0, 37.0, 22.0 ],
"tricolor" : [ 0.75, 0.75, 0.75, 1.0 ],
"id" : "obj-20",
"fontname" : "Arial",
"parameter_enable" : 0,
"numinlets" : 1,
"textcolor" : [ 0.0, 0.0, 0.0, 1.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "speedlim 750",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 254.0, 328.0, 82.0, 22.0 ],
"id" : "obj-18",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "10",
"style" : "",
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ],
"patching_rect" : [ 110.0, 202.0, 106.0, 22.0 ],
"id" : "obj-1",
"fontname" : "Arial",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "p createMenu",
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "" ],
"patching_rect" : [ 427.0, 164.0, 72.0, 19.0 ],
"id" : "obj-16",
"fontname" : "Verdana",
"numinlets" : 1,
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 7,
"minor" : 0,
"revision" : 3,
"architecture" : "x86",
"modernui" : 1
}
,
"rect" : [ 519.0, 114.0, 213.0, 363.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Verdana",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 1,
"objectsnaponopen" : 1,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"lefttoolbarpinned" : 0,
"toptoolbarpinned" : 0,
"righttoolbarpinned" : 0,
"bottomtoolbarpinned" : 0,
"toolbars_unpinned_last_save" : 0,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"boxes" : [ {
"box" : {
"maxclass" : "button",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 114.0, 142.0, 15.0, 15.0 ],
"id" : "obj-1",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "clear",
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "" ],
"patching_rect" : [ 114.0, 168.0, 33.0, 15.0 ],
"id" : "obj-2",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend append",
"linecount" : 2,
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "" ],
"patching_rect" : [ 24.0, 167.0, 78.0, 28.0 ],
"id" : "obj-3",
"fontname" : "Verdana",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "zl iter 1",
"style" : "",
"numoutlets" : 2,
"fontsize" : 9.0,
"outlettype" : [ "", "" ],
"patching_rect" : [ 24.0, 116.0, 47.0, 17.0 ],
"id" : "obj-4",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route port",
"style" : "",
"numoutlets" : 2,
"fontsize" : 9.0,
"outlettype" : [ "", "" ],
"patching_rect" : [ 24.0, 76.0, 56.0, 17.0 ],
"id" : "obj-5",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "outlet",
"style" : "",
"numoutlets" : 0,
"patching_rect" : [ 24.0, 246.0, 16.0, 16.0 ],
"id" : "obj-6",
"numinlets" : 1,
"comment" : ""
}

}
, {
"box" : {
"maxclass" : "inlet",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 24.0, 32.0, 16.0, 16.0 ],
"id" : "obj-7",
"numinlets" : 0,
"comment" : ""
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-5", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-4", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-3", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-6", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-6", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
]
}
,
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"fontname" : "Verdana",
"globalpatchername" : "",
"style" : "",
"tags" : ""
}

}

}
, {
"box" : {
"maxclass" : "umenu",
"style" : "",
"numoutlets" : 3,
"fontsize" : 9.0,
"outlettype" : [ "int", "", "" ],
"items" : [ "Bluetooth-Serial-1", ",", "Bluetooth-Serial-2", ",", "Bluetooth-Modem", ",", "Bluetooth-PDA-Sync", ",", "usbmodem1411" ],
"allowdrag" : 0,
"patching_rect" : [ 342.0, 38.0, 149.0, 19.0 ],
"labelclick" : 1,
"id" : "obj-23",
"fontname" : "Verdana",
"parameter_enable" : 0,
"numinlets" : 1,
"textcolor" : [ 0.0, 0.0, 0.0, 1.0 ],
"bgcolor" : [ 0.635294, 0.803922, 0.490196, 1.0 ],
"bgfillcolor_type" : "color",
"bgfillcolor_color1" : [ 0.376471, 0.384314, 0.4, 1.0 ],
"bgfillcolor_color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"bgfillcolor_color" : [ 0.635294, 0.803922, 0.490196, 1.0 ],
"bgfillcolor_angle" : 270.0,
"bgfillcolor_proportion" : 0.39
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend port",
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "" ],
"patching_rect" : [ 407.0, 76.0, 68.0, 19.0 ],
"id" : "obj-24",
"fontname" : "Verdana",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "toggle",
"style" : "",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 253.0, 81.0, 19.0, 19.0 ],
"id" : "obj-26",
"parameter_enable" : 0,
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 20",
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "bang" ],
"patching_rect" : [ 253.0, 106.0, 52.0, 19.0 ],
"id" : "obj-27",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "fromsymbol",
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "" ],
"patching_rect" : [ 254.0, 249.0, 64.0, 19.0 ],
"id" : "obj-10",
"fontname" : "Verdana",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "itoa",
"style" : "",
"numoutlets" : 1,
"fontsize" : 9.0,
"outlettype" : [ "int" ],
"patching_rect" : [ 254.0, 226.0, 40.0, 19.0 ],
"id" : "obj-11",
"fontname" : "Verdana",
"numinlets" : 3
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "zl group 66",
"style" : "",
"numoutlets" : 2,
"fontsize" : 9.0,
"outlettype" : [ "", "" ],
"patching_rect" : [ 254.0, 202.0, 62.0, 19.0 ],
"id" : "obj-12",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel 13",
"style" : "",
"numoutlets" : 2,
"fontface" : 0,
"fontsize" : 9.0,
"outlettype" : [ "bang", "" ],
"patching_rect" : [ 254.0, 159.0, 38.0, 19.0 ],
"id" : "obj-13",
"fontname" : "Verdana",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "serial f 115200 8 1 0",
"style" : "",
"numoutlets" : 2,
"fontface" : 0,
"fontsize" : 9.0,
"outlettype" : [ "int", "" ],
"patching_rect" : [ 253.0, 134.0, 105.0, 19.0 ],
"id" : "obj-28",
"fontname" : "Verdana",
"numinlets" : 1
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "print",
"style" : "",
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ],
"patching_rect" : [ 180.0, 103.0, 50.0, 23.0 ],
"id" : "obj-17",
"fontname" : "Verdana",
"numinlets" : 2
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-6", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-9", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-28", 1 ],
"destination" : [ "obj-16", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-28", 0 ],
"destination" : [ "obj-13", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-28", 0 ],
"destination" : [ "obj-1", 1 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-28", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-26", 0 ],
"destination" : [ "obj-27", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-25", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-24", 0 ],
"destination" : [ "obj-28", 0 ],
"hidden" : 0,
"midpoints" : [ 416.5, 127.0, 262.5, 127.0 ],
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-23", 1 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-20", 0 ],
"destination" : [ "obj-3", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-20", 0 ],
"destination" : [ "obj-22", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-20", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-25", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-28", 0 ],
"hidden" : 0,
"midpoints" : [ 189.5, 125.5, 262.5, 125.5 ],
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-16", 0 ],
"destination" : [ "obj-23", 0 ],
"hidden" : 0,
"midpoints" : [ 436.5, 191.0, 527.0, 191.0, 527.0, 27.0, 351.5, 27.0 ],
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-13", 0 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-13", 1 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-12", 0 ],
"destination" : [ "obj-11", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-10", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-6", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
],
"appversion" : {
"major" : 7,
"minor" : 0,
"revision" : 3,
"architecture" : "x86",
"modernui" : 1
}

}

Jan 10 2016 | 6:34 am

The Arduino serial moitor works well. Max (at the moment) don’t receive nothing.

Jan 10 2016 | 6:50 am

did you change serialVisual to true in this new one? It is set to false by default.

Then you should only need [metro 10] –> [serial port 115200] —> BPM out

Jan 10 2016 | 9:42 am

Yes. Now work, also in Max. I receive all the data. Thank you very much for all helps.

Jan 10 2016 | 11:25 am

Great! Have fun!

Apr 19 2016 | 5:25 pm

Can I ask of anyone, if this is working for you with OSX 10.11 (yosemite) and Arduino Nano? There was an initial serial port driver incompatibility issue that was documented, and I solved that by downloading the recommended third party driver. I am wondering if this is contributing to my lack of consistent signal.

At times, with serialVisual set to TRUE, I get a stream of values close to 255; I’m assuming this is the fader output, since the other values are text based and sent to the serial monitor. When set to FALSE (for the PulseSensor software – which I can’t seem to find anywhere, has been removed from everywhere I’ve found it – or other 3rd party such as max) I get an occasional value of 10… or 16…. but mostly nothing.

I have modified the pulsesensor script to change the serial output by removing the S values (raw data) and changing the B & Q symbols to 0, 1, in hopes of removing any conflict of Max’s serial object reading integers… Not sure if this was ever a problem, but it shouldn’t hurt anything either.

I’m using PulseSensor Amped 1.4, and the newest version of Max (just downloaded it a week ago).

Thoughts?

Apr 22 2016 | 7:14 am

Hi!

So I have the Max Patch getting information from the serial port using metro 10 – serial port 1155200 – print number

However the information Im getting is not the BPM? its normally around 100 on the processing sketch
but in max it’s 10, 55 and all these random numbers.
Also what is the best way to use this data to see if its working? How can I test this on sound? Does the 10 = 0?

Thanks in advance!

Apr 25 2016 | 10:56 pm

Hi!

I’m having troubles displaying values that are coming in from the serial port. I switched static boolean serialVisual to be true and are able to print formatted data into the Max console, but when it comes to displaying numbers in the work area of the sketch-it just doesn’t happen.
I also tried to adjust the serial.print statements in the Arduino sketch (so it only displays 0 for when there is no pulse, and the BPM value when there is a reading). I’m not sure what i’m doing wrong and would really appreciate if somebody can stir me in the right direction.

{
"boxes" : [ {
"box" : {
"maxclass" : "number",
"patching_rect" : [ 108.333336, 512.0, 50.0, 22.0 ],
"id" : "obj-207",
"parameter_enable" : 0,
"style" : "",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 646.833313, 361.000031, 24.0, 24.0 ],
"id" : "obj-37",
"parameter_enable" : 0,
"style" : "toggleGold",
"numinlets" : 1,
"numoutlets" : 1,
"presentation_rect" : [ 30.0, 30.0, 24.0, 24.0 ],
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "print formatted",
"patching_rect" : [ 646.833313, 431.509918, 87.0, 22.0 ],
"id" : "obj-38",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "gate",
"patching_rect" : [ 646.833313, 395.542511, 33.0, 22.0 ],
"id" : "obj-39",
"style" : "",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "The zl object is taking sequences of these ASCII values and grouping them into a list;",
"linecount" : 2,
"patching_rect" : [ 204.333328, 319.274323, 323.0, 33.0 ],
"id" : "obj-206",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "prints serial in its raw form. This is ASCII numbers",
"patching_rect" : [ 705.333313, 304.274323, 382.0, 20.0 ],
"id" : "obj-205",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 642.333313, 220.666656, 24.0, 24.0 ],
"id" : "obj-33",
"parameter_enable" : 0,
"style" : "toggleGold",
"numinlets" : 1,
"numoutlets" : 1,
"presentation_rect" : [ 75.0, 75.0, 24.0, 24.0 ],
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "print raw",
"patching_rect" : [ 642.333313, 304.274323, 55.0, 22.0 ],
"id" : "obj-32",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "gate",
"patching_rect" : [ 642.333313, 261.306915, 33.0, 22.0 ],
"id" : "obj-25",
"style" : "",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "number",
"patching_rect" : [ 108.333336, 222.666656, 50.0, 22.0 ],
"id" : "obj-23",
"parameter_enable" : 0,
"style" : "",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "fromsymbol",
"patching_rect" : [ 108.333336, 419.209137, 72.0, 22.0 ],
"id" : "obj-9",
"style" : "newobjGreen-1",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "itoa",
"patching_rect" : [ 108.333336, 377.24173, 46.0, 22.0 ],
"id" : "obj-8",
"style" : "newobjBlue-1",
"numinlets" : 3,
"numoutlets" : 1,
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "zl group 1000",
"patching_rect" : [ 108.333336, 330.274323, 81.0, 22.0 ],
"id" : "obj-7",
"style" : "",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "", "" ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 32.333332, 131.666656, 24.0, 24.0 ],
"id" : "obj-6",
"parameter_enable" : 0,
"style" : "toggleGreen",
"numinlets" : 1,
"numoutlets" : 1,
"presentation_rect" : [ 75.0, 75.0, 24.0, 24.0 ],
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 10",
"patching_rect" : [ 32.333332, 159.666656, 64.0, 22.0 ],
"id" : "obj-5",
"style" : "",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "bang" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel 13 10",
"patching_rect" : [ 108.333336, 261.306915, 58.0, 22.0 ],
"id" : "obj-4",
"style" : "",
"numinlets" : 3,
"numoutlets" : 3,
"outlettype" : [ "bang", "bang", "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "print",
"patching_rect" : [ 108.333336, 159.666656, 33.0, 22.0 ],
"id" : "obj-2",
"style" : "",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"gradient" : 1,
"bgcolor" : [ 0.454902, 0.462745, 0.482353, 1.0 ],
"bgcolor2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"bgfillcolor_type" : "gradient",
"bgfillcolor_color1" : [ 0.454902, 0.462745, 0.482353, 1.0 ],
"bgfillcolor_color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"bgfillcolor_color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"bgfillcolor_angle" : 270.0,
"bgfillcolor_proportion" : 0.39,
"bgfillcolor_autogradient" : 0.0
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "serial b 115200",
"patching_rect" : [ 108.333336, 188.0, 181.5, 22.0 ],
"id" : "obj-1",
"style" : "newobjYellow-1",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "int", "" ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "converts a string into a list",
"patching_rect" : [ 196.333328, 419.209137, 150.0, 20.0 ],
"id" : "obj-128",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "converts ASCII numbers \ninto text",
"linecount" : 2,
"patching_rect" : [ 196.333328, 366.24173, 150.0, 33.0 ],
"id" : "obj-127",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "sel forces the list to be output (and cleared) whenever a 13 (carriage return) is received. In addition, it eliminates line-feed (ASCII 10) characters from the stream",
"linecount" : 3,
"patching_rect" : [ 188.833328, 261.306915, 378.0, 47.0 ],
"id" : "obj-124",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "split out CR LF",
"patching_rect" : [ 188.833328, 220.666656, 101.0, 20.0 ],
"id" : "obj-122",
"style" : "",
"numinlets" : 1,
"numoutlets" : 0
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-9", 0 ],
"destination" : [ "obj-207", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-23", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-9", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-39", 1 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-6", 0 ],
"destination" : [ "obj-5", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-4", 2 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"midpoints" : [ 156.833344, 299.958405, 120.333336, 299.958405, 120.333336, 305.326691, 117.833336, 305.326691 ],
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-39", 0 ],
"destination" : [ "obj-38", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-37", 0 ],
"destination" : [ "obj-39", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-33", 0 ],
"destination" : [ "obj-25", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-25", 0 ],
"destination" : [ "obj-32", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-4", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-25", 1 ],
"hidden" : 0,
"midpoints" : [ 117.833336, 255.970459, 665.833313, 255.970459 ],
"disabled" : 0
}

}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"disabled" : 0
}

}
],
"appversion" : {
"major" : 7,
"minor" : 2,
"revision" : 0,
"architecture" : "x86",
"modernui" : 1
}
,
"styles" : [ {
"name" : "newobjBlue-1",
"default" : {
"accentcolor" : [ 0.317647, 0.654902, 0.976471, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "newobjGreen-1",
"default" : {
"accentcolor" : [ 0.0, 0.533333, 0.168627, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "newobjYellow-1",
"default" : {
"accentcolor" : [ 0.82517, 0.78181, 0.059545, 1.0 ],
"fontsize" : [ 12.059008 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "numberGold-1",
"default" : {
"accentcolor" : [ 0.764706, 0.592157, 0.101961, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
]
}

Viewing 24 posts - 1 through 24 (of 24 total)

Forums > MaxMSP