ITP blog ยท code-of-music

Week 5 harmony

15 October 2018

Listen

Delicate Steve plays beautiful slide guitar melodies on top of each other. Ramona Reborn builds up with the interplay of three such voices:

Another example of harmony which crossed my mind as we listened to drone sounds in class was classical sitar. Ravi Shankar demonstrates some of the best of this genre of music:

Code

Check out my p5.js sketch for the week here.

I started out by trying to emulate some of the slide guitar sounds in Delicate Steve's songs by using some basic pitch bending. I created a PolySynth and applied rampTo on each of the voices' frequencies right after triggering the attack stage of the envelope (notes are released when keys are released).

I noticed that if I played notes quickly in succession, the pitch would start to increase past the bounds that I had initially programmed. rampTo was being called in quick succession to transpose the notes up the scale. Although this effect was an artifact of my initial naive implementation, I decided to run with the idea to compose some harmonies.

I added a drone synth based off the drone_event sample sketch. Mine uses an FM sine oscillator with triangle modulation. It plays a constant C2 note on every measure, except when there are multiple keys pressed -- then, it changes pitch to match the current (potentially ramped) frequency of the first voice in the PolySynth. This creates some interesting harmonies and disharmonies.

There are a lot of parameters to tweak here... I'd like to see how the sketch sounds with the drone playing every 2 beats instead of every measure (so that it's easier to line up with notes the user is playing). I could also "quantize" the drone pitches so that it never gets caught on a dissonant frequency between notes (or even on notes that are not harmonic with the current scale) while rampTo is active.