Why a sound?


Off the back of some recent live
pulsars performances and the public release of the PdPG, I thought I'd do some writing about Pulsar Synthesis, neural networks, and how both systems interact with each other in the PdPG, and outside as a control structure.

Pulsar Synthesis

What is Pulsar Synthesis? A very brief overview (some more in-depth histories are Nathan Ho's in depth article and Marcin Pietruszewski's excellent writings): in 2001, Curtis Roads described a synthesis technique, "Pulsar Synthesis", in Sound Composition with Pulsars (Roads, 2001). If you've had a cursory look into this kind of synthesis, you'll be familiar with Fig. 1, taken from Sound Composition With Pulsars (Roads, 2001); in essence, a single cycle waveform is followed by a moment of silence. Together, these make up one period of a Pulsar. The space the waveform (or "pulsaret") takes within the period can vary. Each period is enveloped with a waveform of the user's choice (again, followed by a moment of silence).

There's more, from modulation tables to interactions between pulsars, but in essence, that's it.

 
Fig. 1 - Diagram of a pulsar from Sound Composition With Pulsars (Roads, 2001)


Roads made the original Pulsar Generator for OS9. More recently, Marcin Pietruszewski made the nuPg, a modern implementation written in SuperCollider 3.

Why the PdPG?

So, why another one? Kind of simply, on Pulsar.scramble vol. 3 (a compilation series of music made with various pulsar synths), someone left a comment asking for a Pure Data implementation and I wanted to pull it off. As I learnt more about Pulsar Synthesis, I became fascinated with the blurring between the micro, meso and macro timescales (a bit more on this later, but this concept of musical time scales are from Curtis Roads' Microsound (Roads, 2001)), and how the user interacts with them; for instance, in a typical synth, working at a fundamental frequency below ~20Hz will result in clicks and pops with little harmonic complexity. In Pulsar Synthesis, as the fundamental crosses from the audio-rate threshold to below, the synth will play rhythmic figures, retaining harmonic complexity across each impluse as it emits the loaded pulsarets (Sound Composition With Pulsars, p4, Roads, 2001).

I began with as faithful an implementation to Roads original as I could (I could never get the original working in OS9 emulators, so there was some eyeball-ing). Along the way I saw some space to work in some ideas of my own: an alternative masking system (masking mutes a period of a pulsar), switchable fundamental/ramps (base frequency for each Pulsar), "circular" cross modulation (output of a Pulsar FM's the ramp of the next, giving us strong interaction between each Pulsar), and machine learning to scrub between pulsarets.

The PdPG was designed with performance in mind - though completely capable of deliberate and drawn-out compositional activities, my practice tends towards improvisational performance, interacting in realtime with the computer and the systems running on it. This is why I chose to implement a level randomisation of certain parameters on startup - certain modulation wavetables and most importantly, the wavetables in the pulsarets and envelopes.

Some Machine Learning

PdPG uses the FluCoMa library's KNNRegressor to interpolate between wavetables: "KNNRegressor is a supervised machine learning algorithm for regression". Simply put, it will take a parameter(s) and spit out more parameter(s), learning what the latter should be via training data provided by the user. In the context of our synth, the input is a linear slider (the "scan" controls), and the output is a wavetable of n points. Training data is a position on the slider paired with an entire wavetable; when the slider is at point x, generate the chosen wavetable. Here, we train the regressor with five random wavetables from a user-selectable directory. 

Now we have a system of accurately recalling five wavetables, so what? What's interesting is the space between the wavetables; the regressor will predict values in the wavetable between the ones provided, thus creating a whole new set of shapes, essentially as many as there is space on the "scan" slider. New waveforms appear as amalgam of the ones provided, meaning the output is dependent on what waveforms are loaded next to each other. From a large collection of wavetables, the potential number of new shapes is massive and by traversing the one dimensional input space non-linearly, new timbres that transform across the meso scale can be achieved.

I like to think of this as asking 'what does the machine think?'. 

What Does the Machine Think?

Randomness and chance are nothing new in music. Obvious examples are John Cage's works, such as the Music of Changes (1951), or Brian Eno's generative experiments. Randomising parameters is an easy way to present the user with a synth state they likely wouldn't have conceived themselves, at least in good time, and computers offer convenient avenues to generate these random parameters. By personifying the computer a little bit, we are literally asking it what it thinks

However, simply getting the computer to spit a bunch of random parameters out might not be the most effective way to make good music. Over the last couple of years, I've become more interested in 'randomness with purpose', largely brought on after contact with Xenakis' stochastic methods (see Formalized Music (Xenakis, 1972) for way more info than you'll ever need). For example, by weighting randomness we can ask the machine to bias towards a certain range of outputs (a very simple stochastic method). The idea of pushing randomness in a certain direction, whilst still maintaining a level of unpredictability brings us to the next neural network in the performance system.

 
Fig 2. - My 'neural net' patch used for performance (and composition). X/Y coords interpreted by a neural net, trained with randomised, but weighted, data, and mapped to every on of PdPG's main panel controls (bar volume and drive).


Fig. 2 is a screenshot of a control space neural network patch. The concept is largely lifted from FluCoMa's Controlling a Synth using a Neural Network tutorial with some further development. Coming into contact with neural networks pushed me towards David Tudor's Neural Synthesis (1995), a series of performances using the Neural Network Synthesiser, created for Tudor by Forrest Warthman, Ron Clapman and Mark Holler (Reminded by the Instruments, ch. 10, Nakai, 2021). The intended use of a neural network is to learn patterns and predict outputs based on training data provided; ironically, Tudor was most interested in the instruments randomness that came about by way of it's analogue components:

    "The focus on randomness, the instrument’s capacity to never fall into predictable
     patterns, however, went directly against what neural networks are designed for: to
     recognize patterns." (p564, Nakai, 2021).

This doesn't happen in a digital system, so to introduce unpredictability to the neural network, I implemented this randomised, but stochastically weighted, training data, mapping it against X/Y coordinates. It would allow me a rough idea of what an output might be, but where on the X/Y space it may appear and what training data would be next to it is out of my control; since the data was only weighted, there was still the opportunity for extreme values to appear. The neural network interprets the space between each set of training data, asking 'what the machine thinks' the in-between settings would be. 

Mapping this X/Y space to the cursor provides two immediate performance opportunities: 'playing' the neural network, and using the neural network to create instant, new 'presets' for the synth. With the former, we can 'play' the transition between different parameter sets as a continuous change. With the latter, we can find a parameter set we like, and 'jam' around it, switching off interaction with the neural network (in my patch with the ESC key) and manually altering the controls, playing the synth like usual.

By expediting control of the micro level (Microsound (p4, Roads, 2001) - if the settings of a synth control the timbre of the instrument, they may be thought of as composing on "the threshold of auditory perception", or the micro scale), the user can focus on the meso ("Divisions of form. Groupings of sound objects into hierarchies of phrase structures of various sizes, measured in minutes or seconds" (Microsound, Roads, 2001)) and macro levels ("The time scale of overall musical architecture or form, measured in minutes or hours, or in extreme cases, days" (Microsound, Roads, 2001)), or more simply, longer-term changes over the course of a performance.

All this is done with the aim of removing a certain level of decision making from the user to encourage listening and improvisation. Whilst completely feasible to incorporate a system allowing the user to manually input training data (for the control network or the wavetables), I believe this level control wouldn't stimulate creativity, rather encouraging a user to fall into habit or routine. To create a dataset large enough to be useful, the user would need to have an unbiased memory of all the wavetables in their collection (the one I use has over 400 single cycle waveforms), or create tens of "presets" for their synth. Whilst neither options are completely out of the question, once a user has done this enough times, it would become more efficient/convenient to reuse datasets, therefore removing the unpredictability and interesting decision making the randomisation brings with it.

For me, the machine becomes an 'assistant' or participant of the performance (once again adding a bit of personification to the machine), encouraging response or reaction to the information presented. I find myself asking for a new dataset from the neural network and listening closely to what it gives me: is this sound interesting? If I move the cursor upwards, what change happens next? Does this show promise to be a new section in a set? etc. etc. It becomes simple to interact with the synth's entire parameter set using an interface idiomatic to computer use: the mouse. I can pay far more attention to the sound itself.

Wrapping Up

At the time of writing, I've been working on and with the PdPG for around eight months. When I began the project, I wasn't entirely convinced of the efficacy of the PdPG (being a rewarding performance and composition synth in terms of interaction and 'sound'), however, the more time I spend engaging with Pulsar Synthesis, the further I want to push the systems I have to control it. I have some ideas of where to take this (e.g. asking the neural network to 'play with the user' or 'interrupt' them, and new timbral controls), but these require a bit more time to marinade.

If you're interested in trying the PdPG, you can find the patches on my Github linked below:

If you're interested in hearing the PdPG, I recently played a set with it and the control space neural network (alongside some other Pd bits and bobs):

Finally, I have more to say about the PdPG, as well as an album of computer compositions made with it and the neural net, though I'm waiting for the right time/place for this to come out. All this is to say I intend of writing and releasing more about the PdPG.

References

Browne, R. and Xenakis, I. (1973). Formalized Music: Thought and Mathematics in Composition. Notes, 30(1), p.67. doi:https://doi.org/10.2307/896037.

Nakai, Y. (2021). Reminded by the Instruments. Oxford University Press.

Roads, C. (2001). Sound Composition with Pulsars. Journal of the Audio Engineering Society, 49(3), pp.134–147.

Roads, C. (2001). Microsound. Cambridge, Mass. ; London: Mit.

Comments