The biggest technical challenge in this project has been learning and executing our project in MaxMSP. Many trial-and-errors and a long learning curve later, we finally got the pitch detection to work on Max.
I used the object ‘retune~’ with its ‘@pitchdetection’ attribute to get the frequency values. Once that was in place, I used if statements to limit the frequency detection to the acceptable frequency ranges of all the 8 notes. I then added ‘on(1)’ and ‘off(0)’ to each note range. Next step – serial communication between Arduino and Max. Max sends out these 0 & 1 values in the form of messages to Arduino based on which two leds (eventually smell dispensers) would blink.
After this iteration, the next step was to detect the selected note only. I added 8 separate gates for each note. These gates would allow one to switch on and off the process of pitch detection. Messages from Arduino (switching on a button) will travel through these gates and start the process. There is a two way communication : Buttons open gates (arduino to max) and pitch detection triggers the smells (max to arduino).
Special thank yous to Justin, Jason, T.K, Gabe and Matt for all their help.