teaching machines

Music Mouse, Part VI

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.

Pure Data Interpreter

Create a new file in Pure Data and follow these steps to birth your very own Music Mouse:

  • Add the standard messages and comport object.
  • Add a repack 4 object to collect up the four bytes of each message from the Arduino.
  • Add a 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.
  • Feed the outlet of repack to the inlet of route.
  • The browser-based Music Mouse lets its notes ring out for a long time. Let’s do that too. Add a makenote 100 10000 object. This makes a note with velocity 100 that lasts 10000 milliseconds = 10 seconds.
  • Add an unpack float float float object to tease apart the three bytes of the chord message.
  • Feed the chord, which comes from from the 0-outlet of route, to the inlet of unpack.
  • Feed each of the three outlets of unpack to the first inlet of makenote.
  • Add an unpack float object to tease apart the three bytes of the melody message. By listing only a single parameter, we effectively throw away the second and third numbers.
  • Feed the melody three bytes, which come from the 1-outlet of route, to the inlet of this second unpack.
  • Feed the melody’s MIDI number, which comes from the outlet of this second unpack, into the left inlet of the makenote object.
  • Add a noteout object.
  • Feed the first outlet (the MIDI number) of makenote to the first inlet of noteout.
  • Feed the second outlet (the velocity) of makenote to the second inlet of noteout.

Test your patch. Your should able to produce music with the joystick!

That’s the end of our structured lessons. Nice work! From here on out, you will be the one driving your learning. That’s daunting but also where the best learning happens. Your goal for the next weeks is to make an instrument or music- and hardware-driven experience that is all your own. You may already have some ideas. If you don’t, you may want to seek inspiration from the following activities:

  • Conduct lots of little experiments.
  • Check out the other sensors that your instructor has available.
  • Search the internet to see what crazy things musicians have done with Pure Data and Arduino.
  • Walk through Tero Parviainen’s How Generative Music Works.
  • Talk with your instructors.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *