Introduction: Musical Digital Interface

About: Sound Department

Welcome everybody,

I'd like to show you my own Musical Digital Interface.
I made it during my technical sound degree, this is my research papers.
To begin, I asked me how can I compose music without DAW, with recycled supplies and possibility play in standalone.

In this instructable, I will teach you how to use serial communication to send/receive sensors (analog & digital) informations from Arduino to Raspberry pi towards software puredata for trigger a sound.

Materials requiered are:

x1 Raspberry PI3

x1 Boîter de protection PI3

x1 Micro SD (32G)

x1 Arduino UNO

x1 Sensor IR Sharp GP2Y0E02B

x1 Breadbord

x1 Plate test gauge (0.2)

x28 Resistance 10MΩ

x2 Resistance 1.8kΩ

x1 Resistance 10kΩ

x20 Terminal lugs Male/Female

x1 Solder carrier

x1 coil of tin (1 meter)

x1 Soldering iron

x25 Flexibles Straps Male/Male

Step 1: Sensors

I used 4 piezoelectric coming from "Guitar Hero" Harmonix XBOX 360 remote.
I used a button on/off because reed switch magnetic of jam foot pedal guitar hero remote was out.

I used a IR sensor Sharp GP2Y0E02B.

For all of this sensors, I did pull-up assembly to effective operation...

So that empirically I found resistance value to button sensor and IR sensor. However I tested piezoelectric in order to know full scale of this one, and fixed resistance's value requisite and applicated for the 4 analog sensors.

Step 2: Pull-up Montage

After testing piezoelectric with voltage generator, I fixed resistance's value at 7MΩ.

The button resistance assembly pull-up was 10 kΩ.

For IR sensor, I used two 1,8kΩ resistance between respectively supply voltage and SDA (data) and SCL (clock).

Be careful because those resistance's values are for RTX Arduino UNO; something to know about Arduino impedance input: 10MΩ.

You can see the pull-up montage on the last picture of this step; I fixed straps piezoelectric in 0 1 2 3 pins on UNO, button strap in 2 digital pin but communicate the value on 6 pin on UNO and IR sensor strap in 4 5 pins on UNO, all of analog inputs of the Arduino Uno.

Step 3: Code Arduino

To ensure that the operation was effective, I tested send/receive informations of sensors to Arduino.

I put files in description but you can find them in examples section of Arduino Genuino programmation, except IR sensor because it's not complete, I've changed few informations in the section "define" like "shift" and I changed measurement calculation to be regular in distance variations.
You probably have seen "Wire" in IR sensor code. Indeed I used I2C protocol to communicate.
I invite you to see the I2C protocol, very interesting, you can use this one to transmit in real-time all digitals sensors that you want.

Step 4: Both Arduino Raspberry Serial Communication

Yeah :D

As you can see in the first picture, the link Arduino-Raspberry is USB plug.

I found a way to receive sensors's information directly by PureData Extented that is installed in Raspberry PI. Why PureData Extended? Because the Vanilla version doesn't use the same library than an application in Raspbian environnement.

So launch StandardFirmata in Arduino Genuino to fix I/O and value variations the right way!

To get back value's informations in Raspberry PI, 2 protocols exists: Firmata and Msg.

I choose Firmata for one reason, it was more simple to get informations in PureData via patch Pduino, one environnement.

I invite you to discover Msg if you use OSC protocol.

Step 5: PureData Patch Received

Indeed, after weeks coding on Genuino, I succeeded receiving all of my sensor's informations in one page, this permited to see variations in real-time thanks to Pduino, a patch in Puredata, section librairies extra.

From this step, we don't touch anymore on Arduino code. Value's informations are readable.

As I noticed in step 3, I received informations from digital button in 6 pin analog, it was simple to see effective operation of communication. All in one line.

Step 6: Development PureData

PureData is a specific language and you must spend your free time to succeed doing nice patchwork.

Some of PureData patch will be available in GitHub.

I hope that what I wrote here helped you to begin your own project close to mine.