Max MSP Basics

Here is some stuff I put together a while back. It may be useful for some people 🙂
Ed

ground loop

Contents (click to jump to section):

What is Max/MSP?
Working with audio
Numbers, messages and lists
Programme flow and control
Making patches simpler
Playing audio samples
Simple MIDI control
Enveloping and cross-fading
Designing the user interface
Soundfile playback and timing.
Refining soundfile playback control and timing.
More elegant approaches to additive synthesis.
A better way to create polyphony: poly~
Breaking out; physical I/O and Arduino.
Working with acoustic instruments
Audio processing
Further audio manipulation
Jitter
Jitter II
Gen~
OSC
Javascript in Max
Algorithmic composition

What is Max/MSP?

Max/MSP (often just called ‘Max’) is a ‘multimedia programming environment’ which will allow you to create pretty much any kind of music or audio software you can think of. It can also handle video using a built-in extension called ‘Jitter’.

To get more of an idea of what Max can do, visit the website www.cycling74.com and click on the ‘projects made with Max’

View original post 24,603 more words

Advertisements

Blipfonica concert

If you’re around in Penmaenmawr on the 18th of May come to the inaugural outing of this….

4micAnatomy of a Mountain Stream: quadraphonic fixed media
Field recording & processing programming: Edward Wright

We often take things for granted until we look carefully at them. During the cold snap of the winter of 2011 when the snow had dampened all the sounds I bravely/foolishly balanced a surround sound recorder on a rock in the middle of the stream that runs down from the Carneddau, through Parc Plas Mawr in Penmaenan on its way to the sea.

Through manipulating the playback speed of the resulting sound-file it was possible to expose many details of the sound that are often obscured by our ‘normal’ way of listening. By simply changing the sampling rate, we can enter what feel like different sonic dimensions where the very large, and minutely small sonic structures become far more apparent.

In this piece the original 8 minute sound-file is played in its entirety, but the speed has been mapped and composed to create the framework of the piece. The audio was recorded on a Zoom H2 at 4chan x 48kHz x 24 bit, processed in Max/MSP 5. If you need the loo please go before listening to this piece!

Crosswire paper and piece…

CROSSWIRE; COMPUTERS, INSTRUMENTS

& EXTENDED-COMPOSITION

Edward Wright

Studio demo version.

1. ABSTRACT

This paper documents a piece of practice-based research, enquiring into the extent that certain computer programs can be regarded as musical compositions in themselves. I will argue that the works set down by composers are sets of parameters or restrictions within which performers work and create new, fresh interpretations. As a computer program Crosswire builds on these phenomena; rather than being a computer program designed as a way to facilitate the creation or execution of a piece of music, I shall argue, it is the composition, and the act of improvising upon that framework is the work’s musical realisation.

2. COMPOSITION AND DEFINITION

Composition has been traditionally defined as:

1a, the act of putting together, formation or construction…

2a, a literary or musical work b, the act of producing such a work.

This rather abstract definition does not adequately express the nuances of the various methods of generating and shaping material. A composition need not be written down to still be recognisable as such; a brief foray into the fields of traditional or acousmatic music will uphold this axiom. Secondly, composition defines a set of restrictions. These may be as obvious as defining which instrument should play, the dynamics and pitches that should be performed, or they may be more subtle such as the cultural expectation that dynamics should be performed in baroque music even when there are often very few, if any, notated.

It would be deceptive to view composition simply as the act of setting up restrictions. It can really only be understood in the context of musical realisation and performance and in trying to define what is or is not a composition, an antithesis may useful. Below is a diagram of the composition-performance chain. It is greatly simplified from reality but hopefully will help to define some of the key stages.

Set definition → Realisation → Perception

‘Set definition’ covers the act and artefact of composition. Intrinsically (music) composition defines a set of events that must be executed as part of its realisation. Thus a performance may be a correct realisation of the composition or alternatively may contain errors such as wrong notes. None the less a composition is rather more than a list of systematically quantified auditory events.

By its nature, a composition (especially notated works) cannot define every specific element to an infinite degree of accuracy. When asked to ‘give an A’ an oboist may play loudly or more quietly, with a greater or lesser attack, ever so slightly more sharp or flat, or possibly even sing it. Such actions would still constitute giving an A.

It becomes clear that rather than creating a defined event list, composition delineates a set of narrow pathways to which a realisation must adhere. Some of these pathways are wider than others and allow more room for interpretation or indeed error. For example in Classical music pitch is strictly defined in terms of the correct note and intonation however vibrato is a notable exception to this. Volume is rather loosely defined. In punk meanwhile it can be observed that far less emphasis is placed on specific intonation, but, interestingly glissandi form an integral part of many vocal deliveries.

Therefore composition defines a multidimensional set of musical trajectories which realisation must follow. These can shape low level elements such pitch, timbre and volume but also more complex aspects such as interpretation and style. In some cases these trajectories must be adhered to very strictly and in others they simply provide a guide as to the intentions of the composer.

Based on this concept of trajectory, it is becomes clear that all music is to a greater, or far lesser extent, improvised. This goes as far as apparently fixed ‘tape’ pieces where the art of diffusion has blurred and reinforced the intended spatial and dynamic trajectories, let alone inconstancies of speaker placement. Even if it is the case that a piece of music is improvised it can still be viewed as composed provided that a set of parameters has been defined. If a performer were to play a Bach sonata with sympathetic dynamics even though there were none in the score it would still be Bach; equally Thelonious Monk’s jazz standard Round Midnight is recognisable from the chord progression alone, even when there is some debate as to the fine detail of what that progression is.

This suggests that rather than producing an empirical list of operations, a composition defines a set of boundaries. At a given time a realisation of these boundaries can be perceived to be adhering to the rules closely, or not, depending upon the acuity and cultural norms of the listener. When perceived through time this produces music based on a set of multi-dimensional trajectories. This is not what the line graph accuracy of notated music would seem to imply.

‘Realisation’ covers the act of taking the composition and performing it, either by traditional instrumental methods, loudspeaker diffusion or indeed simply playing back a recording. Realisation is an increasingly vital part of the communication of composition. Based upon the preceding paragraphs it is clearly fundamental to our understanding of music. There are many people who can read notated scores in their heads and gain a working understanding of the eventual sound. This may not be possible with more codified methods of sound creation such as a large script written in SuperCollider or indeed visual inspection of a simple CD-R.

‘Perception’ includes the hearing, and in many cases seeing, of the realisation of the set, by an observer. The observer may be the performer, who in turn may also be the composer, or alternatively a listener may be an audience member largely outside the rest of the chain. While there are obvious points of feedback in the composition-performance dialogue, such as the effect that a performer’s perception of their work, or their perception of an audience’s reaction to it will have on their realisation, the flow of information is overwhelmingly one way.

To illustrate this point, an instrument such as a piano would be viewed as a catalyst for realisation in the composition-performance chain. It is very unlikely that during a performance that the change to a different piano would radically alter the piece of music (except to trigger a slight pause in proceedings), however to swap compositions mid way through would be striking!

I would therefore argue that in order to judge whether an entity is a composition or not, the location of it’s primary function in the composition-performance chain must be determined. A piano in this instance is clearly a vehicle for realisation, even though its use may be a compositional concern in that the perception of the composition be through a piano ‘filter’. It is primarily sited in the realisation part of the chain, consider trying to perform a piece written for piano without the instrument…

3. BEYOND A PHYSICAL DEFINITION

There are many examples of innovation in composition, especially in its content. Content evolutions such as the development of sonata form or the inclusion of glissandi are numerous, examples of progress in composition itself are less easy to find.

One such example would the development of Musique Concrète. Through the development of new technology the early Concrète composers were able to work physically with analogue sound recordings. This is undeniably a different approach to composition but it also presents us with a duality of function. Musique Concrète defines a very strict composition (being created from and set down in a recorded form), but also strongly guides its own realisation. Ironically, for a genre that promises so much freedom with the possibility of any sound as the basis for musical material it has become one of the least flexible performance formats. To follow the composition-perception model, the realisation is so bound up with the composition that it is largely one and the same. A lot of the ‘performance’ is carried out in the studio at the point of composition, far from the observation of the audience, leaving only the spatial interpretation through the act of diffusion. This blurring of the strict definitions between set definition, realisation and especially instrument/performer becomes more acutely apparent as we move through the last century of music making towards the present day.

In keeping with this trend, the field of Algorithmic Composition again crosses the boundaries between being a strict composition and often times providing its own realisation. Whilst being a very broad category, arguably ranging from the works of Dufay’s Nuper rosarum flores to Steve Reich’s phase works, these particular phenomena are abundantly clear in works such as Nikos Stavropoulos’ and Kingsley Ash’s Livecell. The digital implementation of algorithmic processes enables the musical results to be generated in real time and in the performance sphere. In the case of Livecell many of the compositional decisions are made by the computer (albeit guided and mediated by a controller) the resulting output is then scored by the program and fed to a ‘traditional’ string quartet for realisation. In this case there is a distinct malleability of roles. The Livecell software takes a large number of the compositional decisions and provides the score; however the controller also has a lot of control over the higher level actions of how and when Livecell is triggered and also how it interprets its output when creating a score. In this case the Livecell program and interface partly defines the composition set and is partly realisation tool; the controller is part composer and part instrumental performer.

This blurring of composition and realisation can be seen further in Cage’s Sonatas and Interludes. The use of the prepared piano as an extended instrument is well documented but in this particular case (perhaps the most well known of the prepared piano canon) something different is happening. In this series of works Cage clearly sets out which notes and rhythms should be played, but also gives strict instructions as to how the piano should be prepared. This precise specification of the timbre and amplitude of individual notes is as much a part of composition as the marking of a given note tenuto or marcato, or the voicing between different instruments of a given chord.

The use of a piano as a basis for these pieces can cause confusion. The piano is one of the iconic instruments of western music; it has a wide (non-continuous) frequency range, it is cable of a large range of dynamics, creating a number of polyphonic lines and can be controlled by one or more players. Most importantly a wide variety of composed works can be performed on it. Fundamentally it appears to be an instrument. However, Cage’s preparation directions are so specific to his pieces, that they are tied far more closely to his composition than to any transferable evolution of piano technology. It is the context specific that keeps the piano preparations for Sonatas and Interludes as part of set of compositions rather than becoming an extended instrument.

The tension between new instrument and new composition is further demonstrated by Marco Donnarumma’s Xth Sense (hailed as the ‘world’s most innovative musical instrument’). Clearly when a new instrument is developed, new music can be composed with it as is the case with Donnarumma’s Music for Flesh which presented the Xth Sense in its initial form. Since then the Xth Sense has been revised and improved, as could be expected with any design. The next composition was Music for Flesh II which is remarkable in a number of ways. Firstly this truly sets the Xth Sense outside of the remit of composition and thoroughly into the instrumental sphere having overcome any specificity that could have been linked to the first Music for Flesh.More interestingly the pre-set ‘scenes’ within the software of the Xth Sense have been modified to accommodate the new work. This does not necessitate low level changes to the program but rather a change in a set of variables and therefore a different reaction to the input from the hardware and performer. It is still debatable as to what extent this is a change of ‘set definition’/composition or a modification of the instrument.

Perhaps one of the clearest deliberate breaks from the rigid differentiation of descrete composition can be found in Bloom. This was created by Brian Eno and Peter Chilvers for the iPhone/iPad and claims to be ‘part instrument, part composition and part artwork’. Within this the user has a limited control over a self-generating ambient A/V work, with the option for automated play. It is a clear example of a work that can be realised with two different, albeit virtually identical controllers, namely the iPhone or iPad. I also provide and can within reason modify its compositional definition set and through the hardware create its own realisation.

The exploration outlined above would suggest that an instrument or sound controller can be defined as part of a composition by a specificity to a particular musical work. In the case of a traditional instrument the expressive qualities and gestural mapping can be transferred to a different definition set. This is not without limitations such as in the fields of tessitura and timbre, but within reason the instrument remains a vehicle for output realisation and is easily substituted without changing compositional content.

4. A THEORY

It is no longer possible to consider instruments and compositions as two separate entities, rather as points along a continuum. The specificity of an instrument is innately bound to the composition, a work can be composed idiomatically for an instrument, or at the opposite end of the spectrum, the construction of an ‘instrument’ (be that hardware or software) can be so symbiotically linked to a composition as to make it unsuitable for use with another work.

* * *

An entity can be viewed as part of the composition if it is active in the set definition and realisation links of the composition-performance chain, and if it is specific to that work to such an extent that it cannot be used to its full potential in a large number of other situations.

5. CROSSWIRE

Crosswire is a software composition created to test these ideas. The set-up requires a DAW with a minimum ofmono in and stereo out as well as a projector feed. An electric violin must be plugged into the mono input, the Crosswire standalone patch running, feeding the stereo out to speakers and video out to the projector. The violinist is expected to improvise within the remit of the reactions of the patch. The audio going into the patch is processed based upon parameters defined by that audio. The performer and audience can hear the resulting audio and see the processing decisions as a result of the projector feed. Processing decisions are taken based upon data relating to the pitch, timbre and volume content of the current sound. Some of the processing settings are implemented to be very sensitive so as to encourage variety and development in performance and in some cases lack of human repeatability.

The following text is an extract from the program note to the first performance:

“Crosswire is a piece of music, manifested as a computer program. The violin part is ‘freely’ improvised, and the output of the instrument is fed into the computer. Within Crosswire the sound of the violin is analysed to provide information on: the pitch of the note being played, how loud it is, and its harmonic content. This is then used to turn on or off a number of different types of processors and form or break links between them. This is displayed to the performer and audience as a hexagonal constellation (see below). Each dot represents a processor; when a dot is small the processor is off, when it is large it is on, and lines between dots symbolise links sending audio out of one process to another.

Fig 1. Crosswire performance display.

From top left clockwise: clean output (no processing, shown here on), delays, additive synth, panning, sampler and comb filter. A number of links can also be seen for instance from panning to the sampler and comb filter. Each of these processors is in turn controlled by the pitch/volume/harmonic analysis. In the case of the delays the delay time and feedback amount are in real time as a result of the analysis. Within this system the violin is played and its output is processed. The performer makes judgements as to how to progress based upon the sound coming out and the visual display, thus entering a ‘strange loop’ of interaction as the music played not only creates sonic material but also controls how that material is transformed and presented to the world.”

This program note would therefore suggest that the violin part is improvised, and in some senses it is, but within a very strict, albeit reactive, framework. In another sense it simply realises and works within these parameters as mediated by the cultural norms of the performer. I would therefore argue that Crosswire sits primarily in the ‘Set Definition’ area of the chain and is therefore a composition.

Crosswire is currently implemented in Max/MSP and makes use of the fiddle~ external object.

6. TESTING

Anecdotally Crosswire functions well as a self-contained piece. The work provides an environment in which the performer can create numerous and varied gestures. The inclusion of sampling and synthesis help to provide some sort of accompaniment or duet feel, while the comb filter extends the timbral range as well as the pitch potential. The tessitura is further extended by the use of variable playback speed within the sampler; this effect and the effects of other processors can also be heightened by the use of feedback delays. There are also a number of more global controls, for instance playing between 328-332 Hz, arguably the closest thing the work has to a key note, disengages all the processing except the clean output.

The player therefore has control over a lot of different parameters and the potential to make a very beautiful performance, but also to create something very bad. This is important as this allows the work the flexibility to evolve and progress ‘as mediated by the cultural norms of the performer’ in that the performer can chose to perform in one way and discard other (to them less palatable) options.

The work has been performed several times throughout and has undergone revisions and improvements.These performances have lasted between 5 and 20 minutes and so far have been exclusively in a concert environment.

An exception from the normal format of performance was as part of the ICCoaction event in Edinburgh (Scotland) for which Richard Worth composed and notated Green Man Blue. This was for the Red Note Ensemble and Crosswire. The performance used Crosswire to process the summed microphone signals of an ensemble (violin, bass clarinet, trombone and double bass). Having initially defined Crosswire as an investigation into composition, and it now being integrated into another composition in an event focused on composition for new instruments seemed to pose some insurmountable problems for the underlying theory or the piece.

A composition is of a low order of flexibility, in that it exists as a relatively fixed form. Moving along the chain we are met with phenomena of increasing flexibility such as performance and eventually perception by an audience. An instrument-performer combination is usually capable of realising more than one composition in spite of a generally rigid architecture, and is therefore possessed of a higher order of flexibility. Equally it is quite possible to perceive numerous instruments at once. Retracing our steps we hit a wall with human processing capacity in that it is not possible to perceive that many compositions played by multiple instruments at once.

Therefore one test of an artefact’s status as a composition would be to test its flexibility within that role. This must also be mitigated by the transferability of the digital form along the composition-performance chain irrespective of inflexibility within the specific function of composition.

As it is contradictory to say that one piece of music is a different piece of music at the same time, I would suggest that in this situation one of following will have happened; either Crosswire has been changed in function to act not like a composition, but rather as an effects processor for Worths’ composition (fitting in with the idea of transferability), or, that there is now an incredibly detailed transcribed improvisation based upon the Crosswire definition set, or that there is something else going on such as its use as an instrument, combinations of the above, or that it never was a composition.

Starting with the easiest argument, Crosswire is not a standalone instrument in that it requires another sound source to activate it. It could be considered an extended or hyper-instrument, but the interaction between the violin input sound and the Crosswire processing combined with the precision to which some of the control data is sampled, make some actions unrepeatable with any degree of accuracy and the system too unpredictable to be regarded as a reliable instrument in the conventional performative sense.

Returning to the idea of specificity, in the case of Green Man Blue the Crosswire software and its definition set were proven to be linked to the wider Crosswire realisation environment. The nature of the written material could not fully exploit the available range of the processing. This becomes clear when considering decisions based upon pitch. Many of Crosswire’s settings are based on microtonal differentiations which make use of one of the great strengths of a solo (especially ‘improvised’) violin. This is far harder to achieve with standard notation and especially with more than one instrument. Equally the measured time that is so helpful for group performance is not necessarily suited to a working with software that works in ms. and a very fluid time base rather than in bars.

This is not to take anything away from Worth’s piece as it is a good piece, rather that only a part of Crosswire was suited to his purposes.Crosswire ‘can be viewed as part of the composition [as it is] active in the set definition and realisation regions of the composition-performance chain, [and it] is specific to that work to such an extent that it cannot be used to it’s full potential in a large number of other situations.’

Clearly one work does not classify as ‘a large number’ of compositions but it is at the least a corroboration of the theory.

In conclusion the boundaries between what constitutes composition and what constitutes realisation seem to be becoming less polarised, to the point where there is room for a lot of creativity within this new space. It may not be long until it becomes meaningless to talk of composition and performance, in our traditional understanding of them, as two separate entities. Rather I predict that we will see a growing trend towards a more unified method of composition-performance as styles and facilities continue to evolve.

* * *

My thanks to Richard Worth and Lauren Hayes for their patience and help in my first attempt at making the Crosswire patch suitable for use by people other than myself.

7. NOTES


This extract is from the definition in the Concise Oxford Dictionary.

One such example would be the recorded vocals on The Scream by Siouxsie and the Banshees.

Debate still rages as to the superiority of the Miles Davis version or the Monk version, and Cootie Williams and Bernie Hanighen have received co-credits for their contributions. The addition of numerous simplified versions further complicates the issue. However, all of these versions are popularly acknowledged as ‘round Midnight

Although not necessarily ‘algorithmic’ in the modern understanding of the phrase these works rely very heavily upon the use of number and transformation as a compositional element.

This quote was said of Xth Sense as part of the Margaret Guthman Musical Instrument Competition (Georgia Tech, US 2012).

This quotation is from the iPhone‘App store’ marketing text.

In many cases playability of a given instrument depends upon its links to physical gestures and their repeatability. Playing a quiet note on the piano has a direct physical gesture, and there is an obvious correlation with playing the same note forte. Equally on many instruments you move in one direction to raise the pitch and in the opposite to lower it.

In this context strange loop refers to when moving up or down through a hierarchical system, one finds oneself back at the start as popularised by Hofstadter.

fiddle~ is an object for pitch following and sinusoidal decomposition and was devised by Miller Puckette, MSP port by Ted Apel and David Zacaerilli

For full details of performances see

http://www.virtual440.com/?file=kop11.php

8. REFERENCES

Bibliography

Collins, N, Cottle, D & Wilson, S. (eds.) 2011. The SuperCollider Book. Cambridge, MA: MIT Press.

Gourse, L. 1998. Straight, No Chaser: The Life and Genius of Thelonious Monk. New York: Schirmer Books.

Hofstadter, D. R. (1999). Gödel, Escher, Bach: An eternal golden braid (20th anniversary ed.). New York: Basic Books.

Adams, R., Levitin, D. J. & McAdams, S. Control parameters for musical instruments: a foundation for new mappings of gesture to sound. Organised Sound.7(2):171 -189.

Warren, C. Brunelleschi’s Dome and Dufay’s Motet. The Musical Quarterly 59:92–105.

Donnarumma, M. Accessed on 29/5/12. Xth Sensehttp://marcodonnarumma.com/works/xth-sense/ .

Wright, E. Accessed on 1/06/12. http://www.virtual440.com.

Bloom app store page. Accessed on 14/5/12. http://www.generativemusic.com/ .

Crosswire on composers’ channel. Accessed on 2/5/12 www.youtube.com/watch?v=Hv6B4yBSwQ86.

fiddle~ Accessed on 29/5/12. http://crca.ucsd.edu/~tapel/software.html

ICCoacation. Accessed on 15/5/12. http://www.inventorcomposer.net

Livecell Accessed on 15/2/12. http://www.youtube.com/watch?v=qHC6VE_c7H0 15/2/12

Round Midnight forum debate. Accessed on 10/5/12. http://forums.allaboutjazz.com/showthread.php?t=33951

Ash, K. M. & Stavropoulos, N. 2011. Livecell: Real-Time Score Generation Through Interactive Generative Composition. Proceedings of the 2011 International Computer Music Conference. Huddersfield.

Donnarumma, M. 2011 XTH SENSE: sense: researching biological sounds of human body for an experimental paradigm of musical performance. . Proceedings of the 2011 International Computer Music Conference. Huddersfield

Bach, J.S. 19–?. Sonaten und Partiten, violin BWV 1001-1006 . London : Augener, score 7943.

Cage, J. 1960. Sonatas and interludes : prepared piano. New York : Henmar Press, score Edition Peters6755.

Discography

TheloniusMonk. 1944. Round Midnight (1999). On Round Midnight (re-issue). Spain: Definitive, DRCD 11133 – CD.

Siouxsie and the Banshees. 1978 Jigsaw Feeling. On The Scream.London: Polydor POLD5009-Vinyl.