Fragments of a Bohlen-Pierce Composition (Pt 5)

If you took a bunch of random magazine clippings, created a disorderly stack, topped it with a rotten banana peel, and stapled it all slightly off center, you might get something that sounds like this:

Download: fragments_5.csd

This is just a sound test to see how all of these fragments so far fit together. As you can hear, I have my work cut out for me. Starting right now, I need to focus on motives, melodies, chord progressions, gestures, smarter note generators, etc. You know, the music.

This means putting off the granular synthesizer instrument. Time is of essence, and if I’m going to make a trade off, I’d rather put emphasis on the harmony of Bohlen-Pierce rather than designing another synth. I’m not saying the granular instrument won’t happen, because I’m actually quite confident I’ll have to the time to do it, and do it right. I just don’t want to find myself in a position where I’ve poured hours and hours into all these instruments, and not end up with a decent piece for the concert. It’s very easy to get caught up in all the technical stuff when composing a piece of computer music. Something I’m personally very guilty of.

Fragments of a Bohlen-Pierce Composition (Pt 4)

Since Friday, I’ve had almost nil in terms of time to work on fragments. The little time I did have, I put together an additive synthesizer prototype, which I call Tadd for the time being; short for Table Additive Synthesizer. Perhaps I should be calling it tads? It’s very rough, glitchy and a bit poppy, but I love it.

Download: fragments_4.csd

I’m not going to go into the details on how it works here. It’s still in early development, and I plan on only using it in a rough state for fragments. It’s a time constraint thing. Beyond this Bohlen-Pierce piece, I have some big ideas for Tadd, and will most likely write an article about it for the Csound Journal. In the mean time, if anyone has an questions about it, I’d be happy to answer.

Where am I with the piece? I now have a pretty good idea what my final instrumentation will be like. Effects will play a major role in this. I’m considering writing a stutter delay buffer, and possibly a trippy space dub echo machine. There will be heavy use of note generating algorithms present. Timbre wise, it could use one more instrument that contrasts the FM and additive sounds. I’m thinking granular.

There is the question of whether or not to do this in 4-channel quadraphonic surround. If there is time, I’ll give it a try. Though technically speaking, I’m not set up for it here. I’m not ruling it out, yet.

As for a metaphor for what the piece is about… That’s just now coming to me, but it’ll take me a few more days before it truly begins to manifest. The one thing I’m hoping to avoid is to use the Bohlen-Pierce scale as a gimmick rather than a primary element of the piece.

Note to self: listen to more Autechre this week.

Fragments of a Bohlen-Pierce Composition (Pt 3)

Whenever I start a piece, especially one based in old school computer music, I usually find myself working in a compositional clean room. What I mean by this is I usually have to spend many hours writing synthesis code that produces very sterile sounding textures and blips that lacks both depth and soul before moving on. Sometimes I never actually make it beyond this point. To be completely honest, I kinda dig the sound of it. However, I made promise to myself right before the new year that I’m going to force myself to get out of my comfort zone. This means taking off the clean suite, getting outside and playing in the mud. Where “mud” is obviously alluding to the organic. (note: there is some dripping sarcasm in the last line) Though I’m making a joke, mostly intended for myself, there is some truth to this.

As for Fragments, though I’m still in that clean room, I’m starting to make the transition. Today’s example is that first step, and very small one at that. I’m spending more time on the overall sound of the piece, space and structure. As opposed to just creating a process and letting it run for x amount of minutes.

One thing of particular interest is that I’m applying Bohlen-Pierce ratios and proportions to various elements of the piece. Such as note duration, envelope, next start times, FM modulation indexes and ratios, etc. Though I can’t claim this idea as mine, as it came from friend and mentor Dr. Richard Boulanger who had suggested it to me in an email.

Fragments 3: fragments_3.csd

Fragments of a Bohlen-Pierce Composition (Pt 2)

Though my intention is not to produce a phasing piece for the Bohlen-Pierce Symposium, I am using this technique, made famous by composer Steven Reich, as a vessel to get some of the harmonies of the tuning system into my head. Already, I feel there are some potential melodies, chords and even interesting rhythms that are jumping out at me that I could potentially use in a final piece. Though there is still a long, long road in front of me.

Bohlen-Pierce Etude for Three Phasing FM Voices
bpe4tpfmv.csd

Fragments of a Bohlen-Pierce Composition (Pt 1)

I’ve recently been invited to compose a piece for the first symposium on the Bohlen-Pierce scale, which takes place in Boston a month from now. This will be very challenging personally since I’ve never composed using this tuning. I’ve decided, after a little encouragement, to blog about my progress.

I’m doing the piece with Csound, which should come as no surprise. Minus a few scribbled notes in my journal, I have no idea what I’m going to do or where I expect this piece will sound like a month from today. Since time is of essence, I’ve started putting some code into a text file, and have come up with this csd: bp_day_1.csd.

At this point, it produces a series of random just intonation Bohlen-Pierce notes, which are  fed to a monophonic FM portamento synth, and processed with a delay and a reverb unit. A humble beginning for sure.

Csound Journal — Issue 12

Csound Journal Issue 12 Cover ArtIssue 12 of the Csound Journal is now online, just in time for the holidays. Special thanks to editors James Hearon and Steven Yi for putting together another great issue.

Articles

140 Characters

Inspired by the article Hear Free Generative Music, in Archaic Twitter Haiku, made with SuperCollider at CDM, as well as this Csound Mailing List thread, I had to give 140 characters or less a try.

Listen: 140.mp3
Download: 140.csd

In order to make it work in 140 characters or less, I had to cheat. The minimum size for a CSD file in Csound is 109 characters long. So I only count characters that are embedded in the orchestra and the score. It also didn’t tweet very well. :)

Here’s what the code looks like, or least how it would look if the tweet didn’t chew it up:

instr 1
a2 expon 1,p3,.0001
a1 oscils 8000,88*(p4%9+5),1
out a1*a2
if p2<60 then
event_i "i",1,rnd(.6)+.1,4,p4+rnd(2)
endif
endin
i 1 0 1 8

To all of the artists involved with sc140, superb job!

Making Records

Not of the vinyl variety, but the computer science data structure.

Csound comes with a few ways of generating, storing and retrieving data, with function tables being the primary data structure. Data can also be placed into global variables and chn busses. In terms of data abstractions, there isn’t a whole lot of choice. However, custom data abstractions and structures can be built from within a Csound orchestra.

In my blog Simple Keys — Modularized Key Mapping, I toyed with storing multiple key bindings, frequencies, amplitudes and function table numbers within a single ftable by treating the ftable as if it were an array of records, albeit a fairly clumsy one. Over the weekend, I continued along this line and distilled it even further.

Download: simple_record.csd

So far, I’m very happy with the results. Though the implementation maybe a bit hackish, the user-interface isn’t bad. This new system of making records is composed of five user-defined opcodes: RecordType, RecordField, Record, RecordSet and RecordGet. I additionally wrote wrapper GEN instruments, so they could be accessed from the score.

The first two, RecordType and RecordField, are used to create record abstractions. RecordType creates a new record type, while RecordField appends data fields to the record type. A record type is built from an ftable, thus shares the function table number space. The following score snippet creates a record type as ftable 100, and appends three fields: amp, freq and ftable.

i $RecordType  0 1 100           ; Record type stored at fn 100
i $RecordField 0 1 100 "amp"     ; Append field "amp"
i $RecordField 0 1 100 "freq"    ; Append field "freq"
i $RecordField 0 1 100 "ftable"  ; Append field "ftable"

For a record type to be useful, an instance of it must be created with Record. A record is also an ftable, and requires its own unique function table index. The following line creates a record from record type 100, and stores it in ftable 200:

i $Record 0 1 200 100  ; Instantiate record 200 from type 100

Once a record is created, the values of each field can be set with RecordSet:

i $RecordSet 0 1 200 "amp"    0.5  ; Set field "amp"
i $RecordSet 0 1 200 "freq"   440  ; Set field "freq"
i $RecordSet 0 1 200 "ftable" 1    ; Set field "ftable"

That’s just one record created from a single record type. In the csd, you’ll see I create two more records from the same record type.

Example

The Synth instrument is provided to show a simple example on how to use a record. Instead of passing amplitude, frequency and the function number of a stored single cycle wave as pfield data, a record number is passed to Synth with pfield 4. The user-defined opcode RecordGet is used to pull data from the record. The data is then passed to oscil.

instr $Synth
    irecord = p4  ; Record function number
    iamp RecordGet "amp", irecord        ; Get amplitude from record
    ifreq RecordGet "freq", irecord      ; Get frequency from record
    iftable RecordGet "ftable", irecord  ; Get ftable from record
    a1 oscil iamp, ifreq, iftable, -1
    out a1
endin
...
i $Synth 0 1 200  ; Feed synth record 200

More on all of this later.

Simple Keys — Modularized Key Mapping

Csound can read real-time input from an ASCII keyboard with the sensekey opcode. This is a convenient solution for doing things such as emulating a musical keyboard, or triggering loops.

Since I’m always looking for ways of modularizing code, I came up with a solution that allows me to map ASCII keys using i-events instead of hard coding bindings directly to an instrument. My solution still needs a little more work, though I’m confident that the final product will be fairly elegant. Well, as elegant as things get with Csound.

You can give it a try by downloading and running simple_keys.csd. It’s a one octave sinusoidal piano, that uses the following key map (lowercase only):

 s d  g h j
z x cv b n m,

Technical Overview

Instead of explicitly mapping each key from within an instrument, I worked a little Csound ftable trickery to make it so that I could bind keys using score events. A new key map is created like this with an i-event inside the orchestra:

event_i "i", $NewKeyMap, 0, 1, i_z, cpspch(8.00), 2

The score equivalent would be:

i $NewKeyMap 0 1 122 261.62556 2

The i-variable i_z holds the value of the ASCII code for the letter “z”, which is 122. The fifth parameter is the frequency that is to be associated with “z”. The last parameter is the ftable number of a stored single cycle wave.

When instrument NewKeyMap is called, it appends these parameters to an f-table. This f-table, called record_table, acts as an array of records, where each record stores an ASCII key code, frequency and f-table number.

The Listen instrument waits and listens for key presses. Whenever a key is pressed, the ASCII code of that key is checked against every record inside of record_table. If a match is found, then an event to instrument Synth is generated. The frequency and ftable number from the record is passed along the event as pfields.

I like this approach because I can reuse these three instruments in many ways without modification. For example, I could design a microtonal version of the keyboard just by creating a different set of events to instrument NewKeyMap, and I could use different timbres by generating different wave tables.