HSP: A Simple and Effective Open-Source Platform for Implementing Haptic Musical Instruments Edgar Berdahl CCRMA Stanford University Stanford, CA, USA unter Niemeyer Telerobotics Laboratory Stanford University Stanford, CA, USA Julius O. Smith III CCRMA Stanford University Stanford, CA, USA Abstract When we asked a colleague of ours why people do not make more haptic musical instruments, he replied that he thought they were “too hard to program and too expensive.” We decided to solve these perceived problems by introducing HSP, a simple platform for implementing haptic musical in- struments. HSP obviates the need for employing low-level embedded control software because the haptic device is con- trolled directly from within the Pure Data (Pd) software run- ning on a general purpose computer. Positions can be read from the haptic device, and forces can be written to the de- vice using messages in Pd. Various additional objects have been created to facilitate rapid prototyping of useful hap- tic musical instruments in Pd. HSP operates under Linux, OS X, and Windows and supports the mass-produced Fal- con haptic device from NovInt, which can currently be ob- tained for as little as US$150. All of the above make HSP an especially excellent choice for pedagogical environments where multiple workstations are required and example pro- grams should be complete yet simple. Keywords: haptic musical instrument, HSP, haptics, com- puter music, physical modeling, Pure Data (Pd), NovInt 1. Prior Work Haptic musical instruments have been developed since the 1970’s at the latest. Much of the work has focused on the design of accurate haptic devices and physical modeling of virtual musical systems [1][2]. More recently, Sinclair [3] has controlled a SensAble Omni haptic device from Pd by employing elements from the CHAI 3D [4] and the Open Dynamics Engine (ODE) [5] libraries. However, the haptic feedback loop is not closed directly around messages passed in Pd; rather, Pd sends OSC messages to a haptics server that computes the forces to be applied to the haptic device. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers, or to redistribute to lists requires prior specific permission and/or a fee. NIME09, June 3-6, 2009, Pittsburgh, PA Copyright remains with the author(s). Figure 1. Musician holding the Falcon grip Currently CHAI 3D is fully supported only on Windows, but there is also a beta release for GNU/Linux. We decided to instead develop our own platform because we wanted a truly cross-platform solution, and we wanted to process the haptic signals directly in Pd due to its sim- plicity, instructional value, and the wide array of predefined objects for manipulating control messages in Pd. By em- ploying this method for processing haptic control data, we cause ourselves to think using many of the computer music metaphors that motivated the development of Pd itself and its extended libraries. 2. HSP High resolution haptic devices have been becoming more accessible to musicians due to advances in gaming and min- imally invasive surgery. We currently recommend that mu- sical instrument designers use the NovInt Falcon, as shown in Figure 1, which was originally designed for gaming and can deliver forces as large as 9 N. The position of the Fal- con grip (see Figure 1) is transmitted to a computer, and in response, the computer can command forces acting on the grip in 3D space. Machulis’ new open-source Falcon driver operates under Linux, Windows, and OS X [6]. There is no fully cross- platform open source driver for any other mass-produced haptic device capable of providing kinesthetic feedback. In fact, the flext external object np nifalcon allows the Falcon to be controlled directly from Max/MSP or Pd [6]. We pro- vide a wrapper object called Falcon to hide some of the complexity of the underlying object, while still providing modularity for future updates of HSP allowing other haptic NIME 2009 262