I connected Pure Data to Processing so that Pure Data could control the visuals in Processing and alter the sound. The pitch of the sound changes based on the position of my cursor over the Processing window. The volume is controlled in Pure Data. Pure Data also controls the movement of the visuals in Processing and where they are located (using the x and y axis).
Example with sound from Pure Data:
Arduino to PD to Processing:
I altered the Pure Data patch used in the examples above in order to connect Pure Data with Arduino. This would allow me to control Pure Data using Arduino and sensors and to then affect the visuals in Processing. I used the comport object, repack and unpack to get values in from Arduino and connected it to the right port using a message (open message). I received values from Arduino when I moved my sensors but there is also a bit of noise coming through which is a problem I need to remedy. I connected the number boxes with the values to vertical sliders to get a better indication of the impact Arduino was having on the patch. Four of the sliders affect the movement of the visuals in Processing. The PD patch can be found on the Pure Data post of this blog.
Max to Ableton to Processing:
MIDI tracks in Ableton send control changes to Processing so that the visuals react to the sound. Everything is mapped to a MIDI keyboard. The track and visuals start when I press the play button on the Midi keyboard. Ableton sends a message to Max which starts the Max patch. Max sends messages back to Ableton through the noteout objects and this plays the first three channels in Ableton. Ableton also sends messages to Processing through the IAC bus. The slider on the Midi keyboard controls the volume in Ableton. The keys trigger tracks to be played in Ableton. The knobs or faders on the Midi keyboard trigger changes in both Ableton and Processing. The pitch changes of the Ableton clips are used in Processing to alter the movement of the visuals.