Writing multimedia interaction systems is not easy. Their concurrent processes usually access shared resources in a non-deterministic order, often leading to unpredictable behavior. Using Pure Data (Pd) and Max MSP is possible to program concurrency, however, it is difficult to synchronize processes based on multiple criteria. Process calculi such as the Non-deterministic Timed Concurrent Constraint (ntcc) calculus, overcome that problem by representing multiple criteria as constraints. We propose using our framework Ntccrt to manage concurrency in Pd and Max. Ntccrt is a real-time capable interpreter for ntcc. Using Ntccrt externals (binary plugins) in Pd we ran models for machine improvisation and signal processing.
Machine improvisation and related style simulation problems usually consider building repre- sentations of time-based media data, such as music, either by explicit coding of rules or applying machine learning methods. Stylistic learning applies such methods to musical sequences in order to capture salient musical features and organize these features into a model. The Stylistic simulation process browses the model in order to generate variant musical sequences that are stylistically consistent with the learned ma- terial. If both the learning process and the simulation process happen in real-time, in an interactive system where the computer “plays” with musicians, then Machine Improvisation is achieved. Improvisation models have to cope with a trade-off between completeness (all the possible patterns and their continuation laws are discovered) and incrementality (the completeness is ensured only asymptotically for infinite sequences). In a previous work we devised a complete and incremental model based on the Factor Oracle Algorithm. In this paper we propose a concurrent constraints model for the Factor Oracle and show how it can be used in a concurrent learning improvisation situation. Our model is based on a non-deterministic concurrent constraint process calculus (NTCC). Such an approach allows the system to respond in a faster and more flexible manner to real-life performance situations. In addition, the declarative nature of constraints greatly simplifies the expansion of the system with improvisation rules at a higher musical level. We also describe the implementation of our model in a NTCC interpreter written in Common Lisp that is capable of real time performance.