Sunday, February 14, 2010

Hardware Computing/Wireless Instrument Workshop

Kevin Patton & Carmen Montoya Electronic Music and Hardware workshop University of Oregon Jan 27 2010

In this very cool workshop from artists Kevin Patton and Carmen Montoya we got to build a wireless musical instrument setup using a jeenode (essentially an Arduino) and MaxMSP/Jitter software. I got a variety of R2D2 type noises but if you were good you good conceivably create music just like you would any traditional musical instrument. (see video in previous post for final result)

At the core is an arduino like controller called a Jeenode which uses the AtMega328 Chip and has an onboard radio system (like an xbee but cheaper) to relay data. Attached to Jeenode was 3 axis accelerometer (we only used 2) and a 9V battery making it completely wireless.








On the receiving end was a usb thumb drive type device called a Jeelink which is also a programmable arduino w/radio setup which was is used to receive the data from the jeenode (That's 2 arduino devices total in this setup)












From their accelerometer data came in as a regular serial information which was routed to MaxMsp/Jitter. 2 Max patches were written to accept and process this information into sound. (these are available online) One creates an FM synthesis simulation tone and the other controlles sample playback. You could use both patches simultaneously if you wanted for complex tones. The end result for me was much fun making a whole lot of sci fi droid like noises. A bit of skill and practice would be required to start creating intentionally thought out music: The Music dept got to keep 4 of the devices and digital arts got to keep the other 4 so they are available for our use if you wanted to take a crack at some of this or modify it for your own purposes. Here's the details on how to get it all up and running.

You will need:
1)The jeenode/jeelink pair plus a programmng bub (more on the bub later) available from digital art dept which I'm in and most likley the music dept which I'm not in. Alternately you can buy them from Modern Device however you need to also pick up an accelerometer and 9 volt battery + battery holster and some sort of on/off switch.

2) Arduino compiler V1.7 (or better) available free

3) MaxMsp/Jitter 5.1 free 30 day demo (if you have already used up your demo already you can still use the runtime environment to play the patches but not edit them) [cycling 74 offers some steep discounts for students if you're interested in buying like around $200 or something]

4) Various support files available here (HardwareWorkshop-docs.zip) from Kevin and Carmen (if no longer available email me [link at end] I still have my copy - anyone know how to upload a file to a blog?)

5) Mac of some sort (PC versions of all these files actually exist and should work just fine but you're own your own when it comes to the usb/serial driver files. I'm sure they exist somewhere on the net)

Configuration

Step 1: Jeenod/Stick configuration. This is 90% of the setup and if you are using the ones left for the UofO they are already configured so you don't have to worry about any of this and skip to running the software unless you want to modify anything or are curious how this works.

Assemble the device: Attach the power shield just straight on top of the Jeenode as the pins slide in to the recepticles below. Pay attention to orientation so you don't install it upside down. Repeat same exact thing with accelerometer shield on lower pin receptacles. (This makes perfect sense once your holding it in your hand - see the pics for a guide as what to expect. If confused on orientation make sure the data lines goto DIO (digital in out) and power goes to 3.3v (positive) and ground). If you purchased these items yourself you may have to assemble the shields out of some header strips and perf board or come up with some other way of holding all the parts together. Final result will look something like this.......






Step 2 program the device: Before installing/launching arduino, install the FTDIUSBSerialDriver_v2_2_10.dmg driver (necesarry to get arduino serial data into the computer) which is included in the HardwareWorkshop-docs.zip and also possibly in the arduino install dmg

This driver won't work with earlier version of arduino so you will need to make sure you have at least the 1.7 arduino environment installed. Drag the arduino program to your applications (or wherever you want it locally) folder. Next Right click (cntrl click) on the arduino app and select show package contents. Navigate to Arduino > Contents > Resources > Java > Hardware > Libraries>Ports (create if necesarry)
Copy the Files from HardwareWorkshop-docs.zip>JeeNodeLibraries>Ports to the Arduino Ports folder opened above

Next copy the Files from HardwareWorkshop-docs.zip>JeeNodeLibraries>RF12 to the Arduino > Contents > Resources > Java > Hardware > Libraries>RF12 folder (create if necesarry)

I believe these are support for the radio interfaces installed on the jeenodes.

-------this part on needs editing and correcting ---going from memory and notes right now -----

Load the configuration code (note, this is not the final code that runs on the instrument trasnmitter arduino or the usb receiver arduino. This is just the code that allows us to configure it all and pair the controller device to the reciever device so that multiple arduino instruments can be run at the same time without interfering with each other )

Turn on the Jeenode.
Plug the jeenode controller into the bub and the bub into the usb port. (Note, UofO may not have gotten the bub in which case you can't program the jeenodes directly. However, if you are clever you might be able to pop out the atmega328 chip, stick it in a compatible arduino - and load up the code from there - haven't tried this though)

Select the correct serial device from the arduino>>tools >Serial Port >> ??? (usually the top one will have tty in there somewhere)
select Tools > Board > atmega328 (the top one)
press the upload button and wait a few moments for the code to upload
Once uploaded, press the serial monitor button - a window appears. If it's jibberish change the baud rate to 38400. If regular text doesn't appear, change it to 56700
Now we manually configure the device by sending text the thre serial monitor.

pick a unique letter for the groupId (jeenode pairing id)(using 'K' for this example but anything works as long as it isn't already in use by other jeenode pairs - not an issue if you are only using one jeenode/jeelink set)
enter : iK
for some reason it doesn't always take the first time so repeat all commands twice
enter : iK

set the radio to the correct frequencie (915mhz)
enter: b9
repeat
enter: b9

set the group number (using 50 here arbitrarily)
enter: g50
enter: g50

see your final config by entering k. the config prints out NodeId,GroupId,Console
once configured you can upload the real code. Open the ReadAllPorts_Send.pde file and press the upload button. Once the lights stop flashing the transmitter is done.

Next configure the receiving device. Unplug the bub and the device and plug in the jeelink device and repeat the exact same steps as above using the configuration code and plugging in the same node,group,and frequencie parameters numbers except for the device node make sure it has a different number ex transmitter is 1 receiver is 2. check the final configuration by clicking k
-------------above part needs editing and correcting------wil do soon I promise---------

Now open the ReceiverCode.pde file and upload it to the jeelink

Finally, Open the serial monitor,and check to see if data in coming in changes as you rotate the controller. Hopefully this works, if so congratulations! you are ready to make some noise

Running the software

Make sure Arduino is closed and then open Max/SerialIn-SimpleFM.maxpat with MaxMsp/Jitter or the MaxMSP/Jitter Runtime environment.

Select the corect serial device in the yellow part one box of the max patch
Click the 'turn on' button to activate serial input
click the speaker button at the bottom and adjust the volume slider to desired volume

notice the an1-an4 text fields show changing data when controller is moved around
adjust the presets/carrier,modulation,harmonocity to alter the tone

For sample based noises, keep the previous maxpat file open and running and also open Max/SampleScrubber.maxpat

Drag and drop a folder of any kind of mp3s to use as sample sources into the sample area, click all (or some for different controll effects) of the crosshair button controls at the top and click the play button and adjust volume. (some weird fiddling and volume adjustments and other controls in the max patches are usually necessary here - just keep tweeking it till you here both going simultaneously. For some reason it does't work perfectly instantly at this point but will eventually if you keep fiddling -I'm not a max person, not quite sure why it does this or specifically what fixes it other than just 'random fiddling' - if someone has a better explenation of any of this - email me)



You should be getting sound at the point, start playing with the controls and making music.

If you're so inclined you can program your own max patches to do whatever you want sound/visual wise with the incoming serial data from the jeenode controllers. The software on the jeenode transmitter simply relays whatever inputs it is receiving on it's 4 ports so you could use any kind of data you can plug into the jeenode like buttons, photoresistor values, bend sensors, pressure sensors, proximity sensors, potentiometers, etc etc.

Other software than can use the serial information from the jeenodes includes but is not limited to: processing and isadora

That's it - email me with corrections/questions/whatever - Thanks Clay ckent@youoregun.edu (misspelled)

No comments:

Post a Comment