Monday, April 20, 2009

Schematics and Patches and Code for Toriton Plus

If you want to build your own Toriton Plus water instrument, you can find a good amount of information here.

You will need:
- A computer with Max 5 or Max 5 runtime installed, a spare USB port and an audio card
- This patch for Max 5 or Max5 runtime (download here)
- An Arduino board and an Arduino IDE for your computer
- This sketch for the Arduino board and IDE (download here)
- Red 1mW lasers x 5
- LDR 100kΩ - 1MΩ x 5
- 100kΩ resistors x 5
- 22kΩ resistors x 3
- 500kΩ pots x 5
- A clear bowl or cake dish (I bought one for $20 from my local HomeBasics retail store, however if this is too expensive I have seen equally suitable vessels in antique stores and discount variety stores)
- Some way of mounting the lasers so that they are pointing diagonally through the clear vessel onto the LDRs
- You might need a suitable table or if you want to be fancy you can build all your electronics, sensors and mounting equipment into the table like me
- Some water
- Please note that the Toriton is powered by the USB cable going from the computer to the Arduino board

Hardware Setup:

How to wire the keypad:

The idea of the digital scanning of a keypad is very simple. The keypad in question has twelve buttons, set up in four rows of three (like a phone keypad, for example). Each button has two connection points – one point goes to a row pin, and one point goes to a column pin. Therefore, seven pins are connected between the keypad and the Arduino – four for the rows and three for the columns. When a button is pushed, it connects the two points – a column pin and a row pin.

By setting a row pin ‘high’ (in this case, to 5V as opposed to ground which would be considered ‘low’), and reading the digital state of the columns, and then repeating this process for the four rows, it is possible to see which button on the keypad is pressed at a given point in time.

The hardware setup is very simple – only the keypad and three 22kΩ resistors are required. Connect Arduino digital i/o pins 2 to 8 to the keypad. Pins 2 – 5 are for rows 1 – 4 respectively and pins 6 – 8 are for columns 1 – 3 respectively. Connect each of pins 6 – 8 to ground via a 22kΩ each.

How to wire the LDRs and pots:
Of course, you will most likely want to use a more permanent solution than a breadboard. Each resistor is 100k. Each pot is 500k. Each LDR is 1MΩ in the dark.

Finally, each laser can be powered from the Arduino's 3.3V output.

How to use the Max/MSP patch:
Basic Use:
- Make sure your serial port A is your Arduino port
- turn the DAC ON
- make sure data is coming in (the multisliders should move)
- set your max point in the data (ie. move the water around after having toggled the max toggle). untoggle the max toggle
- set your max point in the data (ie. make the water still and then toggled the min toggle). untoggle the min toggle
- press keypad keys 1 to 5
- set the exp factor to between 1 and 1.09
- turn up the gain

Max Patch Customisation:

- Each of the ampy objects outputs scaled and interpolated data from its right outlet. Should you wish to use this data for other processes besides the built in synthesis, simply take this data output and scale it and send it to your other process (eg. scale between 0 and 127 for MIDI, 0 and whatever for OSC etc).

- Change the serial port letter from a to something else if your Arduino board uses a different port assignment
- Set the arg for speedlimFive lower should you wish to have a quicker response from the data.
- The rest of the patch is quite messy but if you have any specific questions, please ask me.


misoft said...

Wow! Thank you very much, I'll give a try! This is a fascinating project!

Sebastian Tomczak said...

no worries :)

Justas said...

I'm having trouble finding an 100k-1M LDR. Is it possible to use VT43N1 8K-300K which seems to be the most popular and easiest to find? How parts in the scheme would change then? (sorry for the questions, i'm total noob at electronics) :)
Thanks in advance.

Anonymous said...

Um. This would be awesome to make but I have no clue what I just read. Should I pass on trying to figure it out?