Sending Supersonic Values to Ableton

Hey there,

I want to send distance values from an ultrasonic sensor to ableton for mapping parameters.
I saw that it is possible using the Firmata Library and the Arduino Connection Kit for Ableton. Unfortunately, I don't receive any signal in Ableton.

I use:

My Code:


#include <Boards.h>
#include <Firmata.h>
#include <FirmataConstants.h>
#include <FirmataDefines.h>
#include <FirmataMarshaller.h>
#include <FirmataParser.h>

#include <NewPing.h>

NewPing sonar(12, 11, 255);


void setup() {
  Serial.begin(9600);
}

void loop() {
  
  delay(50);  

  int distance = sonar.ping_cm(); // Send ping, get distance in cm and print result (0 = outside set distance range)

  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println("cm ");

  Firmata.sendAnalog(distance, 0);
}

This is the Connection Kit in Ableton (it's the right port):

The Monitor puts out the correct values (0-255) but the Connection Kit isn't receiving any values.

Does anyone have a solution for this?

Cheers

One step towards help and solution would providing documentation for the none Arduino things. Spells: Links to datasheets....
Every helper doesn't play with this stuff......

Sorry. You're right. I’ve updated it above

Better late then never.
Too much of new stuff for me. Would take days to penetrate.
Anyway, good luck!

Hi, @skaend
Welcome to the forum.

When you go to test the UNO with Ableton, do you have the Arduino IDE running or not.
If you do, close the IDE and see if you can get the UNO and Ableton to connect, you may need to reset the UNO or reboot the Ableton program.

As asked previously you do have the correct port selected?
Have you looked to see what others are detected by the PC program?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:
PS. From now on if you add any data/info, do it in a new post to keep the thread legible.

I found the solution:

To connect with the Ableton Connection Kit you need the Firmata Standard Firmware running.
On the bottom of their documentation page (link in post) I found an example code which worked just fine. I implemented my code and voila.

#include <NewPing.h>

#include <Firmata.h>

//byte analogPin;
NewPing sonar(12, 11, 255);

void analogWriteCallback(byte pin, int value)
{
  pinMode(pin, OUTPUT);
  analogWrite(pin, value);
}

void setup()
{
  Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);
  Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
  Firmata.begin();
}

void loop()
{
  while (Firmata.available()) {
    Firmata.processInput();
  }

  Firmata.sendAnalog(0, sonar.ping_cm());
}

I think it works with the IDE open, but it's still good practice to close everything and reboot.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.