This experiment uses the Minim sound library and the TUIO messaging protocol for multitouch devices. TUIO messages can be generated with a number of devices including the Apple magic trackpad. This requires a TUIO server to broadcast the multitouch events. For MacOS a small application by Fajran Iman Rusadi - Tongseng - produces the necessary messages.
This inspired me to make a simple drum machine with some basic visualisations. For this application I divided the magic trackpad into four regions with each region representing a percussion instrument. The Minim library’s Audio Sample class was used to trigger each of the instrument’s .wav files. There are a number of classes that perform this task, however the Audio Sample class is best suited for this purpose, as it stores the entire .wav file in Minim’s memory buffer, providing instant playback. However, the sample size needed to be kept to around 512 samples, otherwise the latency between the TUIO and triggering the sample is too long.
Tools used: Processing, Minim, TUIO for Java, Tongseng