A blog about music, music composition, music software, and music programming

Archive for the ‘Software Programming’ Category

Sea-shells, Wind-chimes, Dawn

Thursday, August 18th, 2011

A while ago we received a gift of a beautiful set of wind-chimes made out of sea-shells found on Fire Island. I set about creating a piece of music incorporating them and, after many months of revisions, this is what I created. The rhythmic pattern of the sea-shell wind-chimes was created via a PD program, as were some of the ambient effects. Vocals were provided by my beautiful wife Juliana.

SonicBirth: create your own AudioUnit plugins

Sunday, May 16th, 2010

SonicBirth is a plugin development environment - free, but currently unmaintained. Nonetheless, it provides some powerful functionality if you want to get into the details of tweaking your sounds. It can generate AudioUnit and VST plugins (others?) but AudioUnit plugins are what it was designed for. It consists of a standalone application where, in a Max/MSP-like gui, you piece together audio processing pieces. Then, when satisfied with what you’ve created, you can design a gui and export as a plugin (a ‘.component’ file for AU plugins).

Screenshot of the SonicBirth plugin development software

SonicBirth provides a long list of components to use in creating plugins. The plugins produced are certainly not perfect - you may have to modify the plugin a few times to get it the way you want - but in general very usable.

Useful Free Audio Units Plugins for Logic

Monday, March 29th, 2010

KVR Audio provides an extensive database of audio plugins in most formats, both free and pay. In general that’s a good place to start if you have something specific you’re looking for. To get you started though, here’s a few useful free Audio Unit plugins (for the Mac, of course - though most have Windows versions as well). Some come with an installer; others consist of simply a .component file, which you place in the Library -> Audio -> Plug-ins -> Components folder to install.

Screenshot of the Frohmage plugin
Frohmage: multi-band resonant filter. Can be a little tricky to tweak with any precision, but provides a nice metallic crunchiness to what you put it on.

Screenshot of the KTGranulator plugin
KTGranulator: granular synthesis plugin. Quite a unique sound - and hard to find plugins that do this well.

Screenshot of the Cyanide 2 plugin
Cyanide 2: Waveshaper (digital distortion). Absolutely brutal digital distortion. Nothing warm and fuzzy with this one.

Screenshot of the LAConvolver plugin
LAConvolver: Convolution reverb. Simple interface, but with the right impulse response files can sound terrific. Try http://www.kvraudio.com/forum/printview.php?t=62458&start=0 as a place to find some good impulse response files.

Screenshot of the C3 Multi-band Compressor
C3 Multi-band Compressor: Compressor. Nice for tweaking a mix in just the right way - toning down the bass a little, or adding a little of the right kind of punch.

Easy Convolution with Sound Hack.

Friday, January 29th, 2010

SoundHack, a freeware program by Tom Erbe, has some terrific and unique functionality for manipulating sound - including convolution.

Convolution, a type of analysis-based sound file manipulation often used for reverb, can be used to generate some extremely interesting sounds by “cross-breeding” two source sound files. This can be done programatically with a number of music programming languages like CSound and Max/MSP, but SoundHack makes it quite easy (and free).

Screenshot of SoundHack's convolution dialog box.

An Example:

Here I’ve taken an alto flute sample:

And convolved it with a female voice sample (courtesy of the freesound project and digifish music):

To produce:

This technique of convolution was used heavily - actually for every sound in the piece - for the piece Sunbeams Through Stained Glass.

Logic Express 8 tips and tricks for getting started

Thursday, November 12th, 2009

Recently switched to Logic Express 8 as my editor and, while in general I’ve found it to be fairly intuitive, I’ve had to search a bit to discover how to do some things. So I’m compiling this list, which I hope will be useful to others, of tips and tricks for getting started using the program.


  • How to get the playhead to snap to a barline/beat:
    In the ruler bar, click near the barline/beat and hold the mouse button down. The playhead will automatically snap to the nearest division as defined by the snap settings.
  • How to get dragged regions or midi events to snap to a barline/beat, not to the position relative to the barline/beat:
    In the “snap” drop-down menu choose “snap to absolute value”
  • How to get more than two insert slots for a track:
    Just fill up the first two slots and a third will appear, with more slots becoming available as they’re needed.
  • Navigating between markers
    Control + Command + Arrow (left or right) will jump to the previous (left arrow) or next (right arrow) marker in the project
  • How to jump to a specific marker
    Command + /, then enter the number of the marker in the dialog box which appears
  • How to auto-zoom-in or out
    Command + Left Arrow (zoom out) or Command + Right Arrow (zoom in)
  • Rename an audio or midi region
    Select ‘Text Tool’ from the ‘Left-Click Tool’ or ‘Command-Click Tool’ menus (top right of the arrange window). Then just click (or Command-Click) the region
  • How to alter the velocity of a midi note in the piano roll
    There’s a velocity tool available from the drop-down menus in the top right of the piano roll interface (square with a ‘v’ inside it). Using this tool you can drag up or down to change the velocity of the note. The program helpfully plays the note repeatedly as you change it to give you a sense of the impact of your change.
  • How to select multiple regions
    Two ways: simply drag the cursor to select a group of regions all together or click each region while holding down the ‘Shift’ key to select only certain regions.
  • How to see a spectrum analysis for a given track
    While there are plugins available for doing spectrum analysis, the channel EQ in Logic has a built in spectrum analyzer. Just click the ‘Analyzer’ button near the bottom left of the EQ window.
  • How to show the ‘freeze track’ button on tracks - used to reduce CPU usage
    Control-click on the ‘track header’ for any track (the section of controls where the solo, mute, etc. buttons are found) and choose ‘Configure Track Header…’. In the dialog box which appears check the box next to ‘freeze’ (green button with snowflake icon). You can then use that button in the track header to ‘freeze’ the track.

Score View

  • How to move notes to a different staff in the score view
    Use the ‘Voice Seperation Tool’ found in the drop-down in the top right of the score view (where the ‘Pointer’, ‘Pencil’, etc. tools are found) to assign the notes you want to move to a different voice. Using the tool draw a line between the notes which should stay on the staff and those which should move. (Note: you may have to define the ‘voices’ prior to doing this).
  • Not seeing the symbols you’re looking for in the score view?
    There are a number of buttons under the ‘part box’ menu - in the left column while in the score view. Clicking on the various buttons in the ‘part box’ will cause different symbols to become available for dragging onto the score.
  • How to move symbols (dynamic markings, pedal markings) on the score view
    Use the ‘Layout Tool’ found in the drop-down in the top right of the score view to be able to drag symbols to where you want them.


  • Track playing at different speed after tempo change?
    Recently freaked myself out when some of my tracks were out of sync with others after changing tempo via the tempo track. Then I realized that it was because the out of sync tracks were frozen and so were still playing back at the old speed. sigh…

Miroslav Classik Edition review

Sunday, September 27th, 2009

The Miroslav Classik Edition instrument is fairly simple, operating in both stand-alone and plugin modes. It seems to cover a thorough range of instruments, including all the major orchestral sections and a fair sampling of solo versions of the major instruments. As for sound quality, it’s pretty darn good. Nice rich sounds; far better other synth and sampler instruments I’ve used.


  • Rich, realistic sounds
  • Cheap: $200.00 for a decent orchestral library ain’t bad
  • Decent selection that covers the entire orchestra


  • IK Multimedia’s registration process is a frustrating nightmare (note that you can’t just authorize installation with an admin account while logged in to a regular user’s account; you have to be logged in as admin to authorize. That one cost me a few hours)
  • Sounds are so rich and idiomatic that they may be recognizable as being from this particular sample library
  • Limited to the classical orchestra with no option to add other sounds
  • While it covers the standard orchestra well, it doesn’t contain anything truly exotic

An evolving composition

Monday, May 4th, 2009

When I was in music school I was taught two different ideas about what the ‘intentions’ of the composer ought to be (there are many different variations on these ideas and some ideas that are entirely different - but these two were common in my school).

1. The “Every Detail” method. Wherein every single detail of the music is completely and totally decided by the composer. Every subtle nuance, every slight shading of how the music is to be played. This seems to be the norm in ‘classical music’. The score, when presented to the musician, is to describe with as much precision as can be mustered about how the music is to be played; and the musician is to do their best to bring about the composer’s intentions as exactly as possible. I have even been told by various teachers that if a musician asks about some detail of my music and I haven’t happened to consider that detail before I should make up something on the spot. The composer is to never allow even the slightest doubt that the music as conceived within my head is not fully formed - is not absolutely complete as written on the score. This fits in very well with the notion of “Composer as God” - omniscient and all-powerful.

2. “Aleatoric” methods. Some or all of the music is left to chance. Through some mechanism - often involving computerization - some facet of the music is ‘randomized’. It could be that the musicians are instructed to play random notes for a portion of the piece. It could be that dice were rolled by the composer in order to select which notes to put into the piece. Often the randomness is constrained so that it falls within some set limits - to restrain the literal chaos such methods bring about.

Of course in truth all composition involves a bit of both. No composer has predetermined every subtle nuance of every piece (argue if you will - I don’t believe even those old dead Germans were capable of such). And even the most radical of composers can’t escape the fact that you have to have some influence on those things you create.

In popular music and in Jazz there seems to have been an acceptance of the inevitable role that chance plays in creating music. It’s expected that recording artists will perform different ‘takes’ differently - that’s part of the reason they do so many. And Jazz, of course, is built on the idea of “composing” the music as it’s played - which in a way is about as aleatoric as you can get and still control what you create.

Well I’ve had the idea for a while now to create a piece in a slightly different way. In a way that allows a lot of control but also makes use of the benefits of chance - namely an evolutionary process. The plan is this:

  • write a series of simple motifs which could be placed in just about any order without the transitions seeming disjunct. all of the motives will be in the same style, which was chosen during the early stages of composing the piece.
  • write some computer code to generate semi-random orderings of these motifs. generate and record one random ordering per day for some set number of days until a large collection has been generated.
  • after many listenings reduce the number of orderings to the ones that are most desirable according to my preference. build the piece from these few.

My hope is that this will give me both the control that I desire and also allow me to benefit from chance, hopefully coming up with variations on my own musical ideas which I never would have imagined. More soon…

Markov Chains in Ruby

Monday, December 17th, 2007

So the plan for a piece i’m writing is this: a set of very simple melodies, each with some set of probabilities of progressing to one of the other melodies; in other words - markov chains. Each of the melodies will have a set of possible doublings/harmonizations, and as the piece progresses the chance of those doublings/harmonizations occurring will increase - the piece will ‘thicken’ over time. This gradual process will repeat a few times, each repetition forming a major unit of the piece, probably three in all.

One of my goals is to see if the piece (and the process of writing it) can ‘evolve’ over time; by generating many versions of each major unit of the piece and choosing the one I like best - perhaps one per day - I hope to gradually improve the melodies and the probabilities to make better versions; constrained randomness generating a kind of feed-back into the compositional process. In the end i’m hoping this will be something better (or a least different) from what I would have created just sitting down and deliberately selecting each note. At the same time, though, I don’t want to dive into something totally aleatoric - I still want some control. I’m not hoping for something radically different to come about because of all this - just for the way that I write music to be altered enough so that what I create is a variant of what I would have created.

At any rate, I needed some code to do this and this post shows the beginnings of that effort. So here’s the ruby code to generate a sequence of melodies - using a markov chain of course. It only spits out the array index number of each melody in the sequence (5 in all) - it’s designed to tell me what order the melodies should be played in, always starts on 0, and will append melody numbers to the sequence until it reaches the maximum value passed into the initialization method. A lot of the inspiration for this code plus some other (probably superior) ways of accomplishing this can be found at the rubyquiz.com

class RiffSelector
  def initialize(riffCount)
    # define the markov chain for the riffs...
    @chain = [[0, 1, 0, 0, 1], [0, 0, 1, 2, 0], [0, 1, 0, 1, 0], [0, 0, 2, 0, 1], [1, 0, 1, 0, 0]]
    # the starting state...
    @current = 0
    # the eventual list of riffs (with doublings)...
    @result = "0"
    # loop through, appending the next riff in the chain...
    (1..riffCount).each do
      nextState = getNext()
      @result += ', ' + nextState.to_s

  def getNext()
    probs = @chain[@current]# the array of probabilities of what state will be chosen next given the current state
    total_prob = 0# the sum of all the probabilites
    probs.each { |prob| total_prob += prob }
    random = rand(total_prob.to_i) + 1# pick a random number within the range of 1..[sum of probabilities]
    likelihood = 0
    for state in (0..(probs.length - 1))# loop through each of the states
      likelihood += probs.at(state)# sum probabilities as we go so that we'll eventually have a high enough number to equal the total_prob
      for iter in (0..likelihood)
        if random < = iter# iterate through until we reach or exceed the random number chosen earlier or until we run out of 'likelihood'
          @current = state
          return state

  def getChain()
    return @result

foo = RiffSelector.new(19)# pass in the number of riffs to put into the chain
puts foo.getChain()# output the result

Sound File Amplitude Modulation

Sunday, September 9th, 2007

A Supercollider script I wrote to allow amplitude modulation of sound files, with the modulation depth being variable over time. Idea being, of course, to ‘morph’ the sound over time. Not the prettiest code, but effective (suggestions welcome, of course).

b = Buffer.read(s,"sounds/a11wlk01.wav");

		{ arg out=0, bufnum=0, modfreq=1000, startdepth=0.0, middepth=0.25, enddepth=0.0, attack=5.0, decay=5.0, rate=1, trigger=1, startPos=0, loop=1, multiplier=0.5;
			var modulator;
			modulator= SinOsc.ar
						[attack, decay],
				)*modulator//...and amplitude modulate it

Synth(playbuf, [out, 0, bufnum, b.bufnum, modfreq, 1568, attack, 2.0, decay, 2.0, startdepth, 0.0, middepth, 0.5, enddepth, 0.0, loop, 0]);

Creative Commons License

All music/content on this site is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.