Introduction

In short, I’ve always liked the sound of the violin, so I’m going to learn how to play it and I’m going to share my progress with you.

To keep me motivated and show what is possible with a bit of dedication, I’ve decided to give myself an initial target of practising regularly for 6 months, recording my progress along the way. As well as sharing videos, I’ve decided to also write a journal of what I am trying to achieve each week. In the journal will be links to articles that I’ve read and tutorials that I’ve used, as well as discussions with more accomplished violinists on what they believe is important for developing good technique.

I hope it proves valuable to anyone who wishes to learn a new instrument (particularly the violin), and I already can’t wait to look back in six months time and see how it went.

Top Tip #1

Nothing can hinder the development of a musician quite like the fear of making mistakes. You will not get things perfect the very first time you try, so allow yourself to get things ‘wrong’ and learn from them. Embrace your mistakes.

I begin this journey knowing that I will make countless mistakes along the way, and while they may well give us some laughs (and occasionally hurt our ears), acknowledging and exploring them simply helps us to improve.

See you in a week!

(If you have any comments, questions or tips for me throughout this journey, please do share them below.)

Project Overview

The aim of this project was to compose an original Gamelan piece that could be performed in the Supercollider programme. For this composition, there was an intent to maintain elements of traditional Javanese music such as rhythm, pitch selection and structure, and contrast this with less traditional elements including harmony and rhythmic variations.

The majority of the sounds used were created within the Supercollider programme itself. This was achieved by recording each pitch of the main instruments from the University of York’s ‘Gamelan Sekar Petak’ and analysing the data to determine frequencies, ring times and relative loudness. The information was then put into Supercollider to create virtual instruments.

From these virtual instruments, sequences of pitches and rests were created in the programme as dictated by the composition (including their durations). By combining these sequences, the composition was realised in its most simplistic form.

In order to make a more realistic sounding performance, small elements of randomisation within Supercollider were attached to aspects such as pitch, appropriate reverberation was added, and stereo imaging was also implemented to reflect the layout of the Gamelan.

Additional instruments such as the Kendhang (drum) and Rebab (string instrument) were composed outside of the programme and recorded in multi-track via live midi performance using pre-made virtual instruments. The resulting track was then loaded into a buffer within supercollider and called upon to play in conjunction with the code containing the Gamelan composition.

Composition

The original composition for this project follows many Javanese traditions. These include pitch selection, rhythm, structure, instrumentation & function of instruments. Due to the choice of using the Pélog tuning system, there were seven pitches available. Though only five (possibly six) of these pitches are usually used within a given composition, a different variation was used for each individual section of the work. This was to explore the differences between using the third and fourth pitch. The piece is ABA form with an introduction (Buka), and the first and second A sections are repeated. Pitches 1,2,3,5,6,7 are used for the more traditional A section, and 1,2,4,5,6 for the more contemporary B section.

The instruments of the Gamelan can be categorized into groups with specific functions. Some of these functions are Balungan (core melody) which is made up of the Saron, Demung, Slenthem and Peking; punctuation (time-marking and phrase-marking for example) which is a role often performed by the Gong/Kempul, Kenong, Kethuk/Kempyang and Kendhang; and melodic decoration which is often played by the Gendér and Bonang. The Bonang usually also plays the Buka. The Virtual Gamelan piece adheres to these groupings but does not include the Gendér or Kempul.

Rhythmically, the Peking follows a very basic traditional style of playing twice the speed of the Balungan melody and doubling the notes played to achieve this. The Kendhang also follows a traditional Lancaran style, following the standard patterns for tempo changes.

While not following any of the traditional Javanese Gamelan structures strictly, the piece shares similarities with the Ketawang, Landrang and Lancaran structures. The following shows the basic structure of each gongan (space between gong strikes) in the Virtual Gamelan piece:

pTpW pTpN pTpN pTpG

p = Kempyang  T = Kethuk W = Wela (rest)   N = Kenong G = Gong

The composition features changes in tempo that are essential to Gamelan music. In the full performance, the piece slows down towards the B section and speeds up in the final section, building towards a final slowing of the tempo and the characteristic sound of the slightly delayed final gong. The remaining Gamelan instruments play their final note after the gong has been struck for the final time.

In the B section, there are contrasting, less traditional elements. These include harmonies, choice of pitch, rhythmic elements and instrumentation. This is largely represented by the introduction of the Rebab; a two stringed melodic instrument. Although a traditional Gamelan instrument, here it is used in a more contemporary way. The pitches for this instrument in the Virtual Gamelan piece are actually the closest Western equivalents to the Pélog system rather than the Pélog pitches themselves. As such, this creates unusual harmonies. Intricate non-traditional rhythmic and melodic variations also occur within the Rebab part.

Process of Synth Creation

In order to call the required sounds in Supercollider, SynthDefs were created for each pitch of each instrument. This was necessary due to the complexities of the sounds being replicated and meant that 54 SynthDefs were required. The first task regarding the creation of the SynthDefs was to record all of the pitches of every instrument within the Gamelan ensemble. In order to synthesise these sounds, it was necessary to carry out spectral analysis on the recordings. This made it possible to determine the numerous frequencies that could be heard in each pitch of each instrument, as well as their ring times and relative loudness. To accomplish this, I used the Sonic Visualiser software. While the frequencies were quite precise, the ring times and relative loudness were approximated from the visuals and fined tuned aurally.

To create the sounds within Supercollider, I used the Klank and dynKlank classes. These allow the user to input multiple frequencies, their ring times and relative loudness as well as the exciter used (such as Impulse or WhiteNoise). The following is an example from the code for the Slenthem SynthDef (Pélog pitch 1):

SynthDef(\sl1, {arg out=0,  freqDev= 1;

    var sig, sig1, sig2;

    sig1 = DynKlank.ar(`[[140, 394.7, 628.7, 736.5, 1557.4, 1857, 2638.6]*freqDev, [13, 9, 8, 5,5, 2, 2], [4, 1.5, 4, 3, 2, 2, 2]], Impulse.ar(0,0,0.1))*EnvGen.kr(Env.linen(7, 0.5, 0.8, 1), doneAction: 2);

    sig2 = DynKlank.ar(`[[140, 394.7, 628.7, 736.5, 1557.4]*freqDev, [13, 10, 10, 5,5, 2, 2], [4, 1.5, 6, 4.5, 2, 2, 2]], Impulse.ar(0,0,0.1))*EnvGen.kr(Env.adsr(1, 0.5, 0.8, 1));

    sig = (sig1*0.4) + (sig2*0.4);

    Out.ar(out, Pan2.ar(sig, 0.1));

}).add;

Using EnvGen within the signals, it was possible to create SynthDefs that had more realistic characteristics. The attacks, decays and releases could be determined by aural comparison. By combining two signals and using two EnvGens with different data, there is an ability to fine tune the envelope. This was necessary as there is often an initial attack when the mallet makes contact with the metallophone, and then a subsequent, somewhat more gradual rise in dynamics thereafter (this is especially true of the gong).

Detailed stereo imaging was possible by using the two channel equal power panner (Pan2). This allows for small changes of stereo position by using the pos argument where -1 is left and +1 is right.

Inputting the Composition into Supercollider

With the SynthDefs created, the next task was the input of the composition. This was to be achieved by calling the relevant rests and pitches for each instrument via its individual SynthDef, and defining their durations. Pseq was used to create the sequences of each instrument within Supercollider. In order to add very minor frequency deviations and durations, Pbind was used. This also allowed for repeats of sections and the combination of sections of singular instrumental sequences into one event stream. To allow multiple instrumental sequences to be performed together, Ppar was used as this allows multiple event streams to be performed simultaneously.

In addition to the coded aspect of the composition, the Rebab and Kendhang parts were recorded individually via live midi performance alongside the Supercollider performance. The sounds used were from East West’s RA library. The two tracks were combined and bounced into one file that could then be loaded into a buffer within Supercollider:

p = Buffer.read(s, “…/Drum and Rebab.wav”)

{ PlayBuf.ar(2, p.bufnum, 1,1, 0, 0)*5 }.play;

This file could now be played in conjunction with the Gamelan metallophone SynthDefs.

To make the piece more realistic, appropriate reverberation was added to replicate the acoustics of a traditional performance environment via the FreeVerb class. This allows the user to input values for basic aspects of reverberation such the room size and dry/wet balance. Pdefs and Ndefs were used to implement the reverberation. The Pdef allows the user to reference a stream and the Ndef allows for effects such as reverberation to be attached to this:

Pdef(\piece1,  Ppar([a,b,c,d,e,f,g,h]) );

Ndef(\pattern1, Pdef(\piece1) );

Ndef(\reverb, { FreeVerb.ar( Ndef.ar(\pattern1), 0.5, 0.55, 0.5) * 0.8});

Ndef(\reverb).play;

Final Thoughts

This project successfully achieved its aims in that the metallophone sounds were created entirely within Supercollider and an original Gamelan piece was composed and performed through Supercollider at the University of York’s Rymer Auditorium in 2017. That said, there are a few areas that could be developed. This includes further development of the SynthDefs and potentially a more interactive performance. This could allow for more natural movement in the piece and make further use of the capabilities of the Supercollider programme.

I hope this post has provided a valuable insight into the process of music composition through code. Please feel free to share your thoughts or projects below, and if you want to learn more about Supercollider or Gamelan music, the following reading list is useful.

Further Reading

Pickvance, Richard. A Gamelan Manual: A Player’s Guide to the Central Javanese Gamelan. Richard Pickvance/Jaman Mas Books, 2006.

Sorrell, Neil. A Guide to the Gamelan. New York: Society for Asian Music, 2000.

Lindsay, Jennifer. Javanese Gamelan: Traditional Orchestra of Indonesia. Singapore: Oxford University Press, 1992.

Online Resources

FreeVerb. Accessed April 10, 2017. http://doc.sccode.org/Classes/FreeVerb.html.

Pattern Guide 03: What Is Pbind. Accessed April 10, 2017. http://doc.sccode.org/Tutorials/A-Practical-Guide/PG_03_What_Is_Pbind.html.

Ppar Embed Event Streams in Parallel – SuperCollider 3.2 Help Files. Accessed April 18, 2017. http://danielnouri.org/docs/SuperColliderHelp/Streams-Patterns-Events/Ppar.html.

Pan2. Accessed April 10, 2017. http://doc.sccode.org/Classes/Pan2.html.

16. Sequencing with Patterns. Accessed April 10, 2017. http://doc.sccode.org/Tutorials/Getting-Started/16-Sequencing-with-Patterns.html.

SynthDef. Accessed April 10, 2017. http://doc.sccode.org/Classes/SynthDef.html.

Klank. Accessed April 10, 2017. http://doc.sccode.org/Classes/Klank.html.

Introduction to the Modes

I’m often asked what modes are and how they work, so here is a short breakdown.

Simply put, there are seven modern modes and they are all built from slightly different interval patterns. The easiest introduction to the modes involves the use of just the white notes of the keyboard.

If you try playing a one octave scale of just white notes, regardless of which note you begin on, you will have played a mode. Starting your scale on each of the seven different white notes gives you a different mode.

Modal Theory

First, let us establish our understanding of melodic interval patterns in relation to key. Most of us will be familiar with the sounds of major and minor keys. If we were to play an ascending succession of white notes on the keyboard from C to C, we will have played the scale of C Major. This is also known as the Ionian mode. The interval pattern for major scales (Ionian mode) is as follows:

C Major

   Tonic   >
   Tone  >   Tone   >   Semitone   >   Tone   >   Tone   >   Tone   >   Semitone  
     C     D      E         F    G     A     B        C
The Scale of C Major

A Minor (Natural)

Finding the relative minor of C Major (a minor third below), and playing white notes from A to A results in the natural A Minor scale. This is also known as the Aeolian mode. The interval pattern can be seen here:

   Tonic   >   Tone   >   Semitone   >   Tone   >   Tone   >   Semitone   >   Tone   >   Tone   >
      A      B         C      D      E         F      G      A
 The Scale of A Minor (Natural)

So, what happens if we play all the white notes from D to D? Would that be the key of D Major or D Minor? Well, you may have already worked out that the answer is neither. In short, the interval patterns shown above for major and minor keys mean that black notes (sharps or flats) must replace certain white notes for every key other than C Major and A Minor. This is where the remaining five modes come in.

If we were to play all the white notes from D to D, what we end up with is the Dorian mode. If we play all the white notes from E to E, we find the Phrygian mode. F to F is Lydian, G to G is Mixolydian and B to B is Locrian. Below are audio clips and charts detailing each mode and its interval pattern:

Ionian Mode

   Tonal Centre   >
   Tone  >   Tone   >   Semitone   >   Tone   >   Tone   >   Tone   >   Semitone  
              C     D      E         F    G     A     B        C
Ionian Mode on C

Dorian Mode

    Tonal Centre   >
   Tone  >   Semitone   >   Tone   >   Tone   >   Tone   >   Semitone   >   Tone  
               D     E          F      G      A       B         C     D
Dorian Mode on D

Phrygian Mode

   Tonal Centre   >
   Semitone  >   Tone   >   Tone   >   Tone   >   Semitone   >   Tone   >   Tone  
              E        F     G      A      B         C     D     E
Phrygian Mode on E

Lydian Mode

       Tonal Centre   >
   Tone  >   Tone   >   Tone   >   Semitone   >   Tone   >   Tone   >   Semitone  
                 F     G     A      B          C      D      E       F
Lydian Mode on F

Mixolydian Mode

Tonal Centre   >
   Tone  >   Tone   >   Semitone   >   Tone   >   Tone   >   Semitone   >   Tone  
           G      A      B         C      D      E         F     G
Mixolydian Mode on G

Aeolian Mode

   Tonal Centre   >
   Tone  >   Semitone   >   Tone   >   Tone   >   Semitone   >   Tone   >   Tone  
              A      B          C     D      E          F      G     A
Aeolian Mode on A

Locrian Mode

   Tonal Centre   >
   Semitone  >   Tone   >   Tone   >   Semitone   >   Tone   >   Tone   >   Tone  
              B         C      D      E          F      G      A     B
Locrian Mode on B

As with our major and minor keys, each mode can be begin on any note as long as it follows the relevant interval pattern. In order to get a better understanding of the subtle differences between the modes, I recommend trying out all of the modes using the same tonal centre. For example, by starting on C and following the interval patterns outlined above (you will play sharps and flats depending on the mode), you will be able to hear the different characteristics of the modes in relation to each other.

Characteristics and Musical Examples of Modes

While some music is entirely composed within a mode or modes (harmonically and melodically), very often there are fleeting moments of mode usage in many pieces as well (particularly noticeable within jazz). Below, I have given a brief description of the character of each mode and recorded some short excerpts that show use of modes within familiar music. There are links to the full pieces if you’d like to explore them more.

Ionian Mode

The same as the modern major tonality. Often described as bright and uplifting. This mode can be found very commonly in many styles of music. The examples below are Eric Clapton’s Wonderful Tonight and American Pie by Don McLean.

Wonderful Tonight & American Pie

Dorian Mode

Minor in quality due to the minor root chord, but doesn’t have a raised seventh degree which gives the upper end of the mode a major feel. From Gregorian Plainchant to folk music and even modern pop, Dorian mode has been heard in Western music throughout the ages. I chose Scarborough Fair and Gary Jules’ version of Mad World (featured in the film Donnie Darko) as examples of Dorian Mode.

Scarborough Fair & Mad World

Phrygian Mode

Minor in quality, this rather rare mode can sound dark and mysterious due to the minor 2nd interval. It is sometimes described as having a ‘longing’ feel. The mode is sometimes associated with Middle Eastern music and Spanish Flamenco music and is often altered by sharpening the third degree (becoming Altered Phyrgian Mode) to really emphasise this feel. The original theme from Doctor Who is one of my favourite pieces that makes use of Phrygian Mode.

Doctor Who Theme (1963)

Lydian Mode

This mode is major in quality. Has an upbeat, sometimes comical association and is often heard in cartoons, animations and film. The theme from The Simpsons is probably the best example I have heard.

Theme from The Simpsons

Mixolydian Mode

Major in quality and, aside from Ionian Mode, the most similar to the modern major key. The only difference is the whole tone between the 7th and 8th degree of the scale. A good example is Clocks by Coldplay.

Clocks

Aeolian Mode

The same as the natural minor tonality, Aeolian Mode is often described as sad or solemn. It is frequently heard set against its relative major (Ionian mode). For centuries, composers have made use of the ambiguity and duality between these major and minor tonalities to create intrigue in their music. REM’s Losing My Religion is a fine example of Aeolian Mode usage.

Losing My Religion

Locrian Mode

Diminished in quality (due to the fifth degree being diminished rather than perfect). In Western music, it is the rarest of the modes but can still be found at least in part in music of various styles. Most commonly, elements are heard in Jazz or Middle Eastern music. Interestingly, a modern piece of folk music called Dust to Dust by John Kirkpatrick explores the mode through melody alone. Written in B Locrian, it often it feels as though it is moving towards Aeolian Mode, but the artist always draws back to a tonal centre of B. Below is a short excerpt that I arranged for piano, but I do recommend having a listen to the vocal version by following the link above. 

Dust to Dust

Final Thoughts

I hope that you’ve gained some insight into the modes and their modern-day usage. If you have any burning questions, other examples of songs that use the modes, or just want to make a general comment, please feel free to share your thoughts below!