This post is part of a series of notes and exercises for a summer camp on making musical instruments with Arduino and Pure Data.
The Arduino side of the Music Mouse is working. Whew! All that’s left is to interpret the messages it sends out in Pure Data. Soon we’ll have music.
Create a new file in Pure Data and follow these steps to birth your very own Music Mouse:
comport
object.repack 4
object to collect up the four bytes of each message from the Arduino.route 0 1
object to divert the message along different branches of your patch based on the message type, the first byte of each message.repack
to the inlet of route
.makenote 100 10000
object. This makes a note with velocity 100 that lasts 10000 milliseconds = 10 seconds.unpack float float float
object to tease apart the three bytes of the harmony message.route
, to the inlet of unpack
.unpack
to the first inlet of makenote
.unpack float
object to tease apart the three bytes of the melody message. By listing only a single parameter after unpack
, we effectively throw away the two zeroes.route
, to the inlet of this second unpack
.unpack
, into the left inlet of the makenote
object.noteout
object.makenote
to the first inlet of noteout
.makenote
to the second inlet of noteout
.Test your patch. Your should able to produce music with the joystick!
Comments