Introduction to “Paperwaves”
Posted on October 26th, 2009 at 10:42 pm by admin

Paperwaves is an extension to the Papervision library that I am currently working on, in order to allow developers to realize the spatial diffusion of sound within a 3d environment.

At the present time, the project allows us to attach “soundsources” to any displayObject3D in our scene. The distance and angle is then calculated relative to our listener, (in this case, represented by the position and angle of the camera at a given moment in time). Thus, volume and pan are re-calculated as we move our position in 3d space. The realization is rather basic at present, but it should be sufficient to get a feel for the moving soundsources, (especially if you try the demo with stereo headphones). I have structured the  design so that more complex dampening effects and diffusion characteristics can be added at a later stage.

Before I make any source code public, I need to spend time  comparing different optimization strategies .  The package makes extensive use of 3D trigonometry functions that can be rather computationally expensive, so it would be good to have a solid foundation before considering more advanced functionality . In particular, the  pan function only works on the horizontal axis at present. However, for a taste of things to come, click on the image below to try the demo. (Headphones or a good stereo speaker system a must!!!)

click to view the scene

click to view the scene

From the developer’s perspective, the implementation is very simple.

First, we create a new SoundEnvironment3D(Camera3d, stage width, room diameter). We assume the “virtual room” to be a cube, and the there to be a linear reduction in volume with increasing distance from the soundsource. Not true to life, I know, but I will be adding variable dampening functions at a later stage.

soundEnv = new SoundEnvironment3D(camera, stage.stageWidth, 12000);

Now, we add any number of soundSources to the SoundEnvironment3D. Each of these takes as its parameters, an already instantiated object and a URL to a sound file on the server:

soundSource1= new SoundSource(object, “soundfile.mp3″, true);

Now, just add the soundSource to the scene…

soundEnv.addSoundSource(soundSource1);

In the onEnterFrame(Event ) method of my main class, we set the program to update the volume and pan upon each frame:

onEnterFrame( e:Event ):void

{

soundEnv.setVolumes();

soundEnv.setPans();

}

All done!!!

The marble speaker icon is available at http://icons.mysitemyway.com

The sound sources used in this project include: 1. Martin Luther King, 2. Churchill, 3. an abstract improvisation perfomed on a “prepeared” Fender Squire, 4. and a single alto saxophone pitch fed through an infinate convolution reverb…!

“Hip to be Square?” Building a Rotating Video Cube in Papervision 3D.
Posted on September 30th, 2009 at 11:39 pm by admin

The following project shows how I was able to stream multiple video materials onto a basic AS3/Papervision model. I was also able to construct a simple algorithm to determine the volume/pan of each video, thus giving the impression of a rotating 3D sound source.

Click on the image below to see the object in action. (Flash 9+ required).

Depending on the speed of your internet connection (and my server) you may have to wait a few seconds for the first video to appear. Be patient and soon all four sides will be streaming.

Firstly we set up four video streams to handle the incoming data. Each video file is assigned to a separate stream thus:

var myVideo:Video = new Video(320, 240);
myStream.play(filename);
myVideo.attachNetStream(myStream);
return myVideo;

Next, we create a collection of type materialsList to hold our four video streams, using the identifiers “front”, “left”, “right”, “back”:
materiallist = new MaterialsList();
materiallist.addMaterial(front, “front”);
materiallist.addMaterial(left, “left”);
etc etc…

Now, it is a simple matter of creating a new Cube object. The materialsList collection is automatically mapped to the cube’s surfaces.

cube = new Cube(materiallist, 800, 800, 800, 12, 12, 12, 12, 0, null);

The cube is rotated relative to the vertical mouse position within the display area (mousex). The rotation is capped at 270deg to prevent full rotation on the cube object:

cube.rotationY = -((mouseX / stage.width) * 250);

For the purposes of this project, we are only filling 4 faces of the cube. The volume and pan of each face are set so that its maximum volume is reached as it is facing forwards to the camera. As the cube is rotated left and right, we crossfade the volumes between the respective channels. (See diagram).

To aid window resizing/code reusability, all units are expressed relative to the stage.width property. We have four faces, so we divide our entire width into 4 “deviations”, (each face being visible for one such deviation). Each face is centered, (the centrePoint) in the middle of each deviation. So, the 1st face is located at 1/8th of the total rotation, the 2nd face at 3/8ths, the 3rd face a 5/8ths and the 4th face at 7/8ths.

The following algorithm expresses the above in a manner which holds true for all 4 faces of the cube. The videoNo variable is the number of each face, where 1 is the leftmost face and 4 the rightmost face.

private function getVol(VideoNo:Number):Number
{
var vol:Number = 0
//the width of one fade in or out.
var div:Number = (stage.width / 8);
//the width of a complete fade in AND out
var dev:Number = (div * 2);
//this gives us the centre pos (in 8ths of the width) of our video
//eg video 1 is @ 1/8th, video 2 is @ 3/8ts etc…
var centrePoint:Number = ((VideoNo * 2) - 1);

//CASE - mouseX pos to the LEFT of the video centrePoint
if ((mouseX < (div * centrePoint)) && (mouseX > ((div * centrePoint) - dev)))
{
var relMousePos:Number = mouseX - ((div * centrePoint) - dev);
vol = relMousePos / dev;
}
//CASE - mouseX pos to the RIGHT of the video centrePoint
if ((mouseX >= (div * centrePoint)) && (mouseX < ((div * centrePoint) + dev)))
{
var relMousePos:Number = mouseX - (div * centrePoint);
vol = 1 - (relMousePos / dev);
}
return vol;
}

This returns a value between 0 and 1, where 0 is muted, and 1 is full volume.

Whilst the program works like clockwork in local testing, in practice, it becomes difficult to stream 4 different videos at once across the internet, so you will see that I have limited the streaming to 2 films, both of which are “doubled up” for the purposes of this demonstration. In addition, the observant of you will notice that Kenny & Miles are in fact playing the trumpet left-handed… For some reason, the cube’s planes face INWARD, so we are in fact seeing the reverse face of each wall. (Unless, I was to place the camera INSIDE the cube?) Until I am able to figure out a workaround they will be playing left-handed for a bit longer…

>>> Get the sourcecode
Built in Flashdevelop using the Flex SDK.

References:

>>> Flash Video Streaming
>>> Papervision Mouse Rotation

VSTs in Linux
Posted on June 6th, 2009 at 10:57 pm by admin

If, like myself, you sometimes like to travel light… a laptop computer and a MIDI controller keyboard can be an easier option than toting an organ and a rhodes piano into a venue…

Also, if, like myself you prefer the stability and efficiency of Linux when presented with the thought of a glitch / crash / hanging note bringing your gig at Wembley Stadium to a grinding halt, there are still options for using your Windows VST plugins with a fair degree of success.

So, (presuming you also have a machine running XP),

Install WINE (the windows abstraction layer for Linux).

Download the freeware VSTHOST, and copy the files over to a new folder in WINE’s “windows” directory (eg C:\Program Files\VstHost). This provides a very straightforward application for controlling a network of VST synthesisers.

VSTHOST will not run out of the box because it requires a dynamic link library that is not included in the WINE distribution. Simply copy the file mfc42.dll from your REAL windows\system32 folder and place it in the \system32 folder in WINE.

In the terminal, navigate to …\VSThost.exe and run:
$ wine vsthost.exe

Or right click the icon and select “open with wine”.

Et Voila. Don’t forget to select your MIDI inputs first. I use an EE-MU MIDI to USB cable to get the data into my laptop. It seems to work out of the box on Ubuntu 8.1. I can’t vouch for other interfaces, but as all this software is open source you won’t loose anything by trying…

Consequences? (Random Jazz Song Title Generator)
Posted on June 2nd, 2009 at 8:42 pm by admin

If you click “reload” on your browser enough times you might get something worthwhile…

Soundtracks, Soundbites, Signs, Semiotics and Pork Scratchings…
Posted on January 21st, 2009 at 4:00 pm by admin

On of the great things about writing music for short films is the brevity of the medium. Longer forms tend to require set structural archetypes in order to sustain interest over a large space of time, (such as ABA, sonata form, variations, collage etc). Short forms, (say 2-5 minutes) can get quite interesting, because they allow directors the chance to take more risks with the narrative, perhaps abandoning the conventional notion of plot altogether, as is often the case in the film festival / art house movie genre, (almost to the point of cliché, some might say). After all, it can be rather futile to try and spin a complex story in such a short space of time, so a director will often concentrate on other elements, such as characterization, cinematography, editing techniques etc. Likewise, for the musicians / composers, it can be quite tough trying to say something meaningful in such a short space of time, (remembering to leave room for the speech and ambient sound of course), so what is often called for, is some kind of soundtrack that defies the conventional approach to melody/harmony/rhythm.

What attracts me as a composer, is the way in which I can use non-standard instrumentation, (how about a 2 minute soundtrack just for solo snare drum? How many sounds could you get out of one surface?). Often, when I go to film festivals, I hear great music, but a great deal of it seems to fall into the “I say chaps, lets get some ambient beats going here” or “how about another 5 minutes of moody post-Philip glass piano arpeggios?” Admittedly, these cliches are successful because they connect with very strong western cultural archetypes that we are subjected to on a daily basis. However, I tend to find some of these ideas a bit lacking in terms of different emotional colours, especially when were are dealing with cinema that is working on a higher level of subtelty that our standard fare. Its like trying to paint the world in red, yellow and blue when there are infinite shades in between, some of which are really difficult to describe because they elicit quite equally varied responses in different people because they have not been exposed to these “signs” at the same level. Indeed, there is no law that prevents the soundtrack from suggesting an entirely different interpretation to the film itself, (although this is treading in risky waters). Quote Bill Evans:

“I believe that all people are in possession of what might be called a “universal musical mind.” Any true music speaks with this universal mind - and to the universal mind in all people. The understanding that results will vary only insofar as people have or have not been conditioned to various styles of music in which the universal mind speaks.”

“Consequently, often some effort and exposure is necessary in order to understand some of the music coming from a different period, or a different culture than that to which the listener has been conditioned”.

“I do not agree that the layman’s opinion is less of a valid judgement of music than that of the professional musician…. since the professional, because of his constant involvement with the mechanics of music must fight to preserve the naivete that the layman already possesses”.
- Bill Evans “The Universal Mind of Bill Evans, Rhapsody Films

Well, face it, you didn’t exactly come to the film festival to get the latest blockbuster action did you? Its a great medium for me to package so-called “contemporary” music in a form that will be circulated to a mass audience via internet / TV / festivals etc. As described earlier, I like to use the opportunity to try out new combinations of sounds. (2 piccolos and a tuba anyone? Seriously?) But, increasingly, I am open to the idea of using unconventional forms, colours, spatial arrangement, contrasting genres / media. Small musical microstuctures that are held together by their own internal “poetry”, and by the system of syntactic and semantic connections to the film on screen. This becomes is almost a kind of musical “haikau” at times, (think of those microcosmic orchestral gems by Webern). I also like the idea of symbolic references, for example, a particular chord or colour could be a re-occurring structural “signpost”, that itself may also hold extra-musical associations. Stop and consider the musical “cliches” again; what symbolic references might they hold, (cultural, psychological, physical, nostalgia?). Do these vary depending on the cultural “conditioning” of the viewer? Is this a bad thing, or a reflection of our multicultural society? Think outside the theory…

Also, there is the use of the studio to consider, spatial, effects, mixing etc… This opens up possibilities that are next to impossible in real life, for example, getting some electronic sounds going against an African Choir, perhaps some commercial music mixed in and out phase with abstract percussive sound improvisation? (Not saying it’s a given formula for success), but its good to be open to new ideas…

“…if modernism was the fiery death of classical culture, then by analogy post-modernism is playing with the crispy bits” – Nick Peck

To chart my thoughts on listening to a film soundtrack [one that I have just completed]; a panning shot of a locomotive is accompanied by dissonant brass chords which move from right to left following the motion of the train. To some listeners, the voicing and articulation of the chord might suggest the sound of a train hooter, (US horns are often tuned to a triad). Throughout the soundtrack, this right to left panning is explored by a number of other sound layers. In addition, lower elements of the music seem to be suggesting the “clack-a-tee-clack” motion of the rails, but at other times this could be suggesting the heartbeat pulse of our “hero”. Another element is a celeste, which plays an ostinato that sounds likes a nursery rhyme, (distorted in rhythm and harmony). As our hero awakes from a violent dream, and falls back to bed in relief, this suggests the sound of a music box that might lull a child to sleep. However, this gradually emerges as a distorted version of a Bach Chorale, that a small number of listeners might recognize as “Es ist Genug” (“It is enough…”), played in distorted rhythmic canon by an army of bells of various shapes and descriptions, as [in a later scene] our hero seemingly prepares to take his own life. Even to those viewers who do not recognize the chorale, this choice of a Western-sounding hymn tune suggests some form of spiritual redemption, that either in life, or through death he might find relief from the nightmares that plague him throughout the film. The treatment of this passage, however is not without strong tones of Eastern Gamelan music, thus breaking any sense of tie with any religious connection. I wanted to hint at a more spiritual, not religious sense of questioning, which, (given the fact that the supposed suicide is not seen or heard) , leaves us questioning the possible dual outcomes of the film, (but, with an unusual sense of calm, given the violent nature of the preceeding subject matter).

In an earlier film (Two Glasses), I attempted a similar form of abstraction. The film was only 4 minutes long and involved no dialogue, portraying a potential marriage breakup between husband and wife. A reoccurring sound that we hear throughout the piece is a high pitched whistle, (which is in fact a single accordion note, sampled and filtered to isolate all but the highest harmonics). This sound might be familiar to some listeners who have tried the old party trick of rubbing a moistened finger over a wine glass, (a glass harmonica – another reference to the title of the piece). Also the “glassy” stare that the wife gives her deceiving husband at the start and close of the movie. At an earlier point in the film, the husband is portrayed making his way to the apartment of his secret lover. As he opens the door, the scene is accompanied by a crescendo on a single shaker. Why I chose this sound to build tension, I can’t remember, but in retrospect it bears a resemblance to the sound of the rattlesnake, (entering the viper’s den?), or could it be hinting at some kind of subliminal samba beat (frivolity?) Earlier, as the husband is seen making his way through a back alley, he is accompanied by a theme emphasizing 3rds and 7ths played by marimba and accordion. In this respect, the marimba plays a resemblance to its smaller cousin, the xylophone - an instrument often heard accompanying the mischievous antics of Cats & Mice in countless 50’s cartoons – the lightness of the percussive attack suggested gentle footsteps on a dangerous path of depict.

Once again, the fact that some sounds / events may suggest different interpretations to different viewers is all part of the fun for me. I like the idea of something that might suggest differing outcomes, perspectives and moods.

I want to stress that these are my observations on watching the films after having finished the soundtracks. This is just a kind of “after-the-fact” analysis from a semiotic perspective.

Does this kind of semiotic analysis deserve more of a place in our musical education? Or, on a more personal note, should this be more of a concern in our creative considerations as regards “Jazz” (or whatever improvised music is called these days). In some colleges, our analysis of “Jazz” often seems to be centered around a concept of “language” that is often little more than a kind of painting by the numbers. True linguistic analysis involves a deeper understanding of “assumed knowledge”, phrase structures and contours and that, in turn implies a study of semiotics. The best musicians develop an innate grasp of this concept regardless, but it strikes me that a music that tries to ignore any concept of this is, well… bound to die anyway…

“In the 1990’s jazz’s blood squirted all over the floor of American culture and its body and soul slowly escaped, leaving an empty shell twisted in the throes of death.” Watrous,“The Nineties” JazzTimes Sep. 2000

Or did it? It seems, (more so, in the last decade) that a new “wave” of thought has emerged, whereby a track is less of a structure for “blowing” and more about creating an instance of a mood. I would cite, as a well-known example, John Scofield with Medski, Martin & Woods on the album “A Go-Go”, in which each track acts as an attempt to conjure up a specific scene, (just like a series of short soundtracks for a surreal cartoon…. Ren & Stimpy hit Funkytown USA for a wild night of furball regurgitation, illegal meat products and corn-related humor). For instance, the track “Kubrick” is less than 2 minutes long, and features no “improvisation”, in the conventional sense (save murmuring tom-tom figure). As another example, the trio “The Bad Plus” have evolved a performing and recording style which, (as an antithesis of the jazz tradition), features strong doses humor, pop cultural references, extra-musical effects… suggesting a new paradigm for jazz whereby the sum total of the parts (i.e. the concept of the “track” as a single entity) is more important than everyone just tearing off a great string of solos…

Or on a bigger scale, the music of Maria Schneider, contains a large number of symbolic references, integrated into a large scale-developmental form, (which Maria readily cites as influences when describing the compositional process). Some of these are immediately apparent, such are bird calls heard on “Cerulean Skies” , some are more subtle; the irregular meters of “Hang Gliding” describing the heart pulse of a hang glider pilot preparing to launch into flight. Of course, a Jazz orchestra still has a fairly defined “sound”, (inherited at some distant level from Duke Ellington), but after all, wasn’t it Ellington who said that Jazz was a feeling, not an intellectual theorem?

Speaking of Ellington, I might even hazard a suggestion that increasingly, “jazz” is returning to the pictoral concept of earlier players? Tell the story of people, moods, cultures, ages. This is not a critic of anything that has happen since, and I am certainly not advocating any form of historical re-enactment. On the contrary, armed with new resources, the music still has the power to instantly tell the story of our age and the world we live in.

One of the occasional hazards of “art” is the need to admit to an overwhelming sense of humility. The more you think you are finding your feet, the more you are stuck by the enormity of the whole concept. The moment you think you have your “sound”, something else comes along. Of course there are no-out-of-the-box solutions. Here I am, somehow brought up on very structuralist musical post-Schoenbergain values (no idea why, seeing as I didn’t exactly grow up listening to Beethoven), calling some of those values into question. Schoenberg lamented the demise of “structural listening” amongst concert audiences, but taking my music appreciation into consideration (and rumor has it that I have musical education), I doubt if, ever, my primary motivation for attending a concert of Western Classical music has been to sit there clocking the instances of themes, development / forms etc. I am, of course, more interested from a sensual, not structural perspective, as are, I expect, the vast majority of audience members. However, Schoenberg also proposed a model of musical evolution within a particular culture whereby successive generations expand upon differing elements of the music. We now live in a culture where music, (including a great deal of experimental/contemporary music) is increasingly about creating short instances of a “feeling”, rather than a musical/artistic concept. I don’t feel that this was the case 10 years ago. Perhaps this is a product of the internet revolution, (music finding new outlets as bandwidth-friendly “soundbites” or as mass-produced library music for films and presentations?) As you can see from my thoughts on my film music (above), I am on the fence, and I try to work on both levels when creating music. Where do you stand? I hearby throw the debate open…

“Vertigo” – Art Gallery Of the Future…
Posted on January 15th, 2009 at 8:16 pm by admin

After some months away, I have returned to designing some new apps in AS3 / PaperVision3D. My latest project extends the picture show concept in the form of a trendy new zero gravity art gallery called “Vertigo”, which uses some of the images from nick.peck.co.uk. This version features a few minor mods. to the code, including the ability to load exported Google Sketchup objects (.kmz files), as you will see from our stylish new water feature… Click to proceed to the page. (Flash 9 or above).

Please give it a moment to load. Custom preloader due shortly…

Heard on the Edge of Dreams
Posted on January 6th, 2009 at 10:15 pm by admin

“Any tone can succeed any other tone, any tone can sound simultaneously with any other tone or tones, and any group of tones can be followed by any other group of tones… successful projection will depend upon the contextual and formal conditions that prevail, and upon the skill and soul of the composer.”

- Vincent Persichetti “Twentieth Century Harmony”

By exploring harmonies that sit in the boundaries of our vocabulary, a rich new of world of chords with unique syntactical and expressive qualities can be found.

Varitations in chord density, range, simplicity / complexity are all equally important. Differing acoustics and instrumentation can radically alter our perception of intervals and chords as we may have become accustomed to them on the keyboard / guitar.

In the following fragment for brass choir, strings and percussion, simultaneous harmonic and melodic layers, as well as distortions of conventional harmonic colours all add to the overall sense of tonal contradiction. The process is hard to describe as I largely rely on my ear during composition, and I’m here I’m trying to convey a particular feeling that lies just beyond conventional description. The brass parts are shown in condensed score here (Pdf).

CLICK HERE TO LISTEN TO THE SCORE (mp3)

Using the “Giant Steps” Sound…
Posted on December 31st, 2008 at 5:29 pm by admin

We interupt this post to bring you some music:

<<< CLICK HERE FOR COMEDY INTERLUDE >>>

The hipster has just demonstrated another sound that I am quite fond of. For a given tonality, (say C dorian), try alternating between three key centres a major third apart, (say C dorian, E dorian, Ab dorian).

This kind of suggests the “Giant Steps” sound, which is:

Ebmaj7 F#7 | Bmaj7 D7 | Gmaj7 Bb7 | Ebmaj7 (Descending in major)

Same kind of idea, but ascending in minor…

Cm7 | B7 | Em7 | Eb7alt | Abm7 | G7alt | Cm7

The result is a sound of harmonic dislocation that I find quite pleasing in certain contexts. As ever, its important to judge the correct moment to use and idea, and to try and integrate it into whatever has taken place before and after it.

Rather that thinking in terms of shifting key centres, it is also possible to construct artificial scales out of these symmetrically displaced triads. The combination of Cm, Em and Abm triads yields this interesting scale combination that contains interesting patterns of intervals. Once again, used sparingly, this could be the source of some interesting tonal colours (pianists will have to think about the role of appropriate chord voicings and how they could be used in this context).

C Eb E Gb G Ab B

GEEK MOMENT - this scale is the same if you use C, E and Ab major OR C, E and Ab minor triads…)

The combination of three major triads a maj 3rd apart is also called the augmented scale, and has been described in “The Augmented Scale In Jazz” by Walt Weiskopf and Ramon Ricker.

This opens out a whole new spectrum of harmonic possibilities that were mapped out by Nicolas Slonimsky in “A Thesaurus of Scales and Melodic Patterns”. Whilst I am only vaguely familiar with the book itself, I occasionally try to apply some of these ideas when improvising.

What is Practice?
Posted on December 31st, 2008 at 5:08 pm by admin

I dislike the idea of piano practice as some kind of “keep fit”. The idea of making good music on the piano has nothing to do physical strength. I admit that I cannot play my scales “well” but its just not something that is top of my list of priorities. For this reason, I rarely teach piano technique as such. I am more interested in ergonomics applied to the keyboard. The time is better spent eliminating sources of tension so that the player has more chance to play without the inhibition of ideas through supposed “technical difficulty”.

I also dislike the idea of practicing as “shredding”. Quite simply, as an improvising musician, I never seem to gain anything by doing it. The brain has to learn to freely manipulate these shapes and ideas in real time, not reading them off a page. If you are having trouble “getting the fingers to work” in this cold weather - I would suggest some simple body stretching exercises about 10 minutes before the gig. You will look like an idiot :-) , but it really does help start the blood flow to the arms and fingers and gets the relevant tendons ready for action.

I try to practice “improvising” by experimenting with new ideas and colours in the context of tunes/grooves and trying to get myself into the mindset of flowing improvisation as fast as possible. Sometimes, if there is new material, I work on learning it. Otherwise, I’ll rather be writing some code or something… One thing I do like to do is to practice playing in very slow time over a form, giving me time to try and catch the melodic ideas “in my head” rather than falling into the patterns.

Six Note Scales (Hexachords)
Posted on December 31st, 2008 at 4:57 pm by admin

When I refer to six-note-scales, these are basically major scales with the 4th degree (“avoid note”) missing. You will hear these scales a great deal in celtic folk music and a great deal of jazz music from 1970 onwards…

EXAMPLE (mp3)

Eg: C, D, E, G, A, B

GEEK MOMENT - G,A,B,C,D,E - its intervalically symmetrical around the axis of B-C…..? Interesting?

Jazz musicians often play a chromatic passing note on the b5th degree of the scale making an 8-note run (fits the rhythm of the bar better?). This is referred to as the “bebop” scale, by folks who have dark glasses and berets. However, in this day of polished new-age sheen I often want to respect the diatonic purity of the underlying harmony, so I would rather remove a note from my seven note scale scale so that I have an even number of (six) notes.

Six Note Scales (Pdf)

I like the sound of these scales very much, especially when I want to play flowing lines over a very diatonic harmony, for example on a ballad or a folk tune. Not only is the fingering very easy on the piano, but you also have the advantage that it is a lot easier to end on a “strong note” when you need to, compared to conventional seven note scales.

« Previous Entries