Teaching Live Coding of Electronic Dance Music: A Case Study

Lee Cheng

The Education University of Hong Kong

<http://dx.doi.org/10.12801/1947-5403.2018.10.01.10>

Live coding is a relatively new performance practice that emphasizes the expressive possibilities afforded by computer programming. Live coding has often been associated with contemporary musical styles such as electronic dance music (EDM), which favors the design of rhythms through algorithms and does not require extensive musicianship training. While literature has addressed both live coding and EDM pedagogy, research that fuses the two remains sparse. This paper presents a case study on teaching undergraduate students the live coding of EDM with Sonic Pi in an elective course. It aims to examine the pedagogical implications of using live coding to teach EDM in a classroom environment. A mixed method approach was adopted to examine participants’ (N = 39) perceptions of the difficulties, learning processes, and teaching methods involved in creating EDM through live coding. The findings of this case study indicated that technical programming skills presented beginner students with the most difficulty, whereas learning EDM via live coding was found to be motivating and effective.

Introduction

Live coding is a way of improvising music or video animation through live edits of running source code. This relatively new performance practice, emerging after 2000, gained traction due to the affordability and mobility of laptops that permit real-time signal processing (Ward et al. 2004; Blackwell and Collins 2005; McLean and Wiggins 2010). Within the context of musical and visual performance, live coding places particular demands on the creative process, as it requires a shared vocabulary for exploration and experimentation (Sorensen and Brown 2007). While conventional musicianship focuses on expressiveness via the development of a musician’s motor skills, live coding offers an alternative path to learning music through the design and programming of algorithms and is therefore considered the “antithesis of immediate physical musicianship” (Collins 2007).

Because of its great potential and adaptability for improvisation (Collins, McLean, Rohrhuber and Ward 2003), live coding has been a teaching tool for the study of contemporary musical styles, especially electronic dance music (EDM) which favors the design of rhythms through algorithms. While studies investigating the pedagogy of live coding and EDM have been present (e.g. Ruthman et al. 2010; Manaris, Stevens and Brown 2016), there is a sparse of literature that fuses together the two domains. This paper presents a case study of teaching undergraduate students the skill of live coding EDM in an elective course.

Literature Review

As a presentation tool for displaying the writing of source code, live coding has been a pedagogical strategy for teaching programming concepts in computer science (Gaspar and Langevin 2007). As a creative process, live coding provides an environment for artistic expression in which programming favors creativity and improvisation in an educational context. Ruthmann et al. (2010) developed an interdisciplinary general education course entitled Sound Thinking that focuses on the development of students’ computational thinking through the live coding of music. They argued that the musical goals of live coding may motivate students’ development of creativity and imagination. McLean and Wiggins (2010) surveyed 32 live coders to examine the relationship between live coding and creativity. They concluded that live coding environments may be involved in the creation of higher-order conceptual representations of time-based art.

The algorithmic generation of EDM has been an area of interest for music technologists and researchers. Collins (2008) designed an algorithmic generator for EDM and synth pop that was fully implemented in SuperCollider. Wooller and Brown (2011) presented an algorithm that can musically augment the real-time performance of EDM by generating new musical materials through morphing. Anderson, Eigenfeldt and Pasquier (2013) developed a generative music system that composes EDM based on a corpus of transcribed musical data. Many other algorithmic systems to create EDM are available, yet there is scant literature on its pedagogical impact on music learning. While EDM is a viable teaching content for preparing students with forms of emerging artistry in the digital era (Väkevä 2010), fusing together live coding and EDM could be an effective classroom learning activity in school music education.

Aim

This study aims to examine the pedagogical implications of using live coding to teach EDM in a classroom environment. The following three research questions guided the study.

1. What are the difficulties of learning live coding in the classroom context?

2. What benefits does live coding offer to students learning EDM?

3. What may be an effective method for teaching EDM by live coding?

Methods

A mixed methods approach including a survey questionnaire and semi-structured interviews was used to investigate the participants’ (N = 39) learning experiences in a university elective course on live coding. This approach allowed the triangulation of data to strengthen the validity of the findings (Greene, Caracelli and Graham 1989). Both music and non-music major students were invited to participate in the survey questionnaire, while students majoring in music were asked to participate in the interview.

Case Study

The case study in this paper is the teaching of live coding in the university setting of an elective course. The course, entitled Introduction to Music Technology, was offered to any non-first and non-final year undergraduate student for selection, among other elective courses, to fulfil the curriculum requirement of their individual programs. The content of this course includes overviews of music history and recent music technology, practical experience with digital audio workstations, a case study in music technology, musical genres relating to music technology, a site visit to a recording studio, and performance technology. Thirty-nine undergraduate students enrolled in this course were invited to participate in this case study. Twenty-five of the participants were pre-service teachers, and eight of them were pre-service music teachers. Only four of them indicated that they had never learned music formally through instrumental/vocal training, while the other students had on average 11 years of musical training. Most of the students had attained ABRSM Grade 8 practical examination or the equivalent for their instruments/vocal.

Live coding was part of the performance technology component, which accounts for two lessons and a total of six hours. This component was preceded by the introduction of musical genres associated with music technology, including EDM and its subgenres. The topic of live coding includes basic syntax and parameters, the use of synthesizers and samplers, iterations, audio synthesis, and basic algorithmic design for creating music. Students were given time in each lesson to practice music with Sonic Pi and to complete assigned tasks. After lecturing and tutorial sessions, the students were required to form groups (2 to 3 students) and perform with live coding and other electronic/digital musical instruments for an assessment.

Survey Questionnaire and Semi-structured Interviews

The questionnaire consisted of five parts. The first and second parts collected participants’ musical and computing backgrounds; the third and fourth parts assessed their learning experiences of EDM and live coding in the course; and the final part assessed their opinions on live coding pedagogy. The items in the third, fourth, and final parts of the questionnaire were rated on a 5-point Likert scale.

The interview questions were designed to follow up on the data obtained from the survey questionnaire. The interviews provided qualitative data on the participants’ perceptions of their learning experience of live coding in the course, focusing on the learning difficulties which provide hints to improve the effectiveness of the teaching process. The interview was guided by the following series of open-ended questions.

1. Under what circumstances do you listen to electronic dance music?

2. What did you find most difficult about learning Sonic Pi in this course?

3. What difficulties did you encounter designing music algorithms?

4. How did you solve the problems you encountered?

5. What did you find most difficult about learning electronic dance music?

6. Between learning live coding and electronic dance music, which did you find more difficult, and why?

Findings

Computer literacy and Experience in EDM

Only six participants indicated that they were familiar with one or more programming languages, while the other participants had never learned any programming. The programming languages with which they were familiar included object-oriented languages such as Java and Swift, and networking languages such as PHP and Javascript. None of the participants indicated that they had previously learned computer music, visual, or multimedia programming languages such as Max/MSP, PureData or SuperCollider, although half of the class was studying music at this university. These responses implied that the course session on live coding was a novel experience for most of the participants.

The participants were asked to rate whether they recognized various EDM sub-genres as listed in Table 1. The survey data indicated that they were not familiar with many EDM genres. Only three of the sub-genres garnered more than half of the responses, including the most common ones such as Disco and Hip-hop. Drum and Bass also rated highly. However, it is of the researcher-teacher’s suspicion that the participants may have mistaken Drum and Bass to indicate the general use of the drum and bass, as in a rhythm section, and that the students did not recognize Drum and Bass as a musical sub-genre. Most of the other sub-genres garnered no more than a quarter of the responses.

Sub-genre

Response

Sub-genre

Response

Sub-genre

Response

Ambient

8

Breakbeat

3

Disco

27

Drum and Bass

27

Downtempo

1

Dubstep

8

Electro

8

Electronica

3

Garage

8

Hardcore

4

Hardstyle

0

Hip-hop

24

House

7

Industrial

1

IDM

1

Jungle

3

Post-disco

2

Techno

3

Trance

3

Trap

1

Vaporwave

0

Table 1. Participants’ (N=39) recognition of EDM sub-genres.

Comparatively, the participants’ responses regarding their experience in electronic/digital musical instruments (E/DMI) for EDM shows more depth compared with their computer programming and EDM experience. Fifteen participants responded indicating they had played the synthesizer, followed by nine responses for both the percussion pad and looper, then seven responses for digital audio workstations and the drum machine, and six responses for the sampler. No participant indicated music-making experience with the turntable.

E/DMI

Response

E/DMI

Response

E/DMI

Response

Synthesizer

15

Sampler

6

Turntable

0

Vocoder

1

Looper

9

Drum Machine

7

Percussion Pad

9

Digital Audio Workstation

7

Table 2. Participants’ (N = 39) experience on electronic/digital musical instruments.

When asked about the difficulties of learning EDM in the course, the participants’ responses mostly concerned the distinction between the different EDM sub-genres, as in the following responses:

I think the most difficult part [in learning EDM] is to memorize all of the specialties and characteristics of each genre. They are all EDM, but they are different in a very particular way (Student A).

Before knowing each genre, I think it is important to understand their history—to understand how a genre was created, why people practice a genre within a particular culture, and what is unique about each genre (Student B).

It’s difficult to remember the suggested tempo, groove, and timbre of each genre, because they sound so similar (Student C).

Experience in Live Coding

The participants were asked to rate their learning and practical experience in live coding on a 5-point Likert scale. The questions and the mean scores are listed in Table 3.

Question

M

SD

To what extent has EDM motivated your learning of live coding?

2.95

0.99

To what extent has EDM motivated your learning of algorithmic design?

2.90

1.07

How difficult do you find learning live coding?

3.67

0.96

How interesting do you find learning live coding?

2.92

0.87

To what extent has live coding been effective in helping you to learn algorithmic design?

2.95

0.83

To what extent has live coding been effective in helping you to learn EDM?

3.00

0.86

Table 3. Mean (M) and standard deviations (SD) of participants’ rating on live coding experience for EDM.

The participants responded “moderate” on most of the items concerning the motivational effect and effectiveness for learning algorithmic design, live coding, and EDM, and the mean scores ranged from 2.92 to 3.00. The mean score relating to the difficulty in learning live coding was exceptionally high (M = 3.67). When asked about the difficulties in learning live coding in the interview, the participants without prior computer programming experience referred to the basic techniques of programming, as shown in the following responses:

I never learned programming before, and when I was asked to write a piece of code for music, I made a lot of mistakes with computer grammar (syntax), and I spent a lot of time fixing those problems. Sometimes I didn’t even know what the problem was (Student D).

The most difficult part for me was memorizing the code. This is similar to learning a new language, in that we have to memorize words and their structures (Student E).

The participants with prior programming experience reported a similar level of difficulty, with an example provided by Student E:

I previously learned Java and C++, and they have very different syntax. I always mistype the code of other languages into the music programming language we learned in this course, which then generated a lot of syntax errors, until I finally became familiar with Sonic Pi (Student E).

Regarding the learning of algorithmic design by programming music, the participants reported difficulties in learning the syntax of live coding:

I have certain ideas on what programming can do in terms of music performance, and yet it’s difficult to put these into practice. It’s hard for me to write an algorithm that performs music by itself, as I had hoped (Student F).

Other than the problems of basic programming techniques, the participants also reflected on more specific issues related to programming music. For example, one participant reflected on his/her difficulty in searching for references:

I tried to search for some examples from the internet to solve my problem, but there was nothing available. It’s much harder to find references for music programming than for other types of programming (Student G).

Apart from searching for online sources, the participants reported using other methods of inquiry, such as asking the teacher or other students.

Live Coding Pedagogy

The questions concerning live coding pedagogy were asked in the final part of the questionnaire. The participants were asked which types of teaching methods they found applicable to live coding, including Lecturing/Direct Teaching (n = 16), Self-directed Learning (n = 12), Group Performance/Practice (n = 15), Task-oriented Learning (n = 18), and Demonstrating (n = 15). When asked about their opinion on the effectiveness of instruction in music with live coding in a computer classroom environment, the participants rated an average score of 3.00 (SD = 0.89). Participants also reflected that live coding could be a potential component in school music education, which aligns with the current trend of STEM (Science, technology, engineering and mathematics) and STEAM (STEM+Arts) education in Hong Kong:

The supervisor teacher at my teaching practice asked me what can music education do with STEM or e-learning, since the school principal encouraged every subject teacher to do so. iPad music-making using apps like GarageBand could be an option, but I think live coding should be more feasible since it only requires a computer to work with (Student I).

Discussion

The responses regarding the participants’ musical and computer programming background suggested a novice level in computer music, which positions the findings of this study as relevant to a beginner’s perspective on learning EDM through live coding. The findings of this study revealed that the technical issues represent the most difficult challenges for participants learning live coding, despite the motivational effect and self-assessed effectiveness of learning EDM and algorithmic design. These technical difficulties include debugging, syntaxing, becoming familiar with the coding language and environment. Compared with learning technical programming skills, the participants’ difficulties in learning EDM are knowledge-based, such as understanding and memorizing the characteristics of different EDM sub-genres.

The pedagogical approach of using live coding to teach EDM in the classroom context for non-music major students contributes to conventional lecturing by involving students in the EDM creative process incorporating with other digital musical instruments for an original and collaborative performance. While the learning of EDM often involves individualized hardware equipment, such as turntables and drum machines, using live coding as a teaching tool could lower the barrier and make the learning of EDM more accessible in the classroom context with practical experiences by the learners.

Participants’ responses regarding the types of teaching methods they found applicable to live coding reflect no strong consensus on a specific format, which suggested a mixed-method of teaching could be more feasible, such as the interdisciplinary approach of STEAM, as suggested by one of the participants. Teacher support is important especially for beginners in computer programming, not only because coding requires help but also because live coding is still an emerging performance practice that may not be as familiar as other conventional music practices.

Despite the difficulties encountered during the learning process, participants’ achievement in learning EDM was reflected by their creative works demonstrating their ability to manipulate live coding as a musical tool for a collaborative performance. By learning live coding and putting it into practice for a collaborative EDM performance, participants also developed attributes in generic skills including, but not limited to, communication skills, teamwork, project management, and creativity. These attributes could help develop learners into adaptable people who could transfer their generic skills into the ever diversifying and rapidly changing future workplaces (Bassett 2013).

Conclusion

This case study examined the pedagogical context of live coding in teaching EDM in a classroom environment from the perspective of beginning students in computer programming. The technical programming skills were found to be the most difficult part for beginning live coders, whereas learning EDM via live coding was found to be motivating and effective. With adaptability and convenience inherent to live coding environments, task-oriented learning may be an appropriate teaching method to complement direct teaching and lecturing. Future research inspired by this pilot study may include: (1) pedagogical approaches in teaching live coding as an interdisciplinary subject matter; (2) teaching algorithmic design for music creation; and (3) empirical research on the benefits of learning EDM through live coding.

Author Biography

Lee Cheng (www.leecheng.info | lcheng@eduhk.hk) is an interdisciplinary artist-teacher and researcher, currently working as a Lecturer II of the Department of Cultural and Creative Arts at The Education University of Hong Kong. His research and artistic interests interdisciplinarize music, multi-media, technology and education. He is also serving as the director of EdUHK iLOrk, a laptop orchestra and mobile device ensemble.

Web: <www.ilork.com>

References

Anderson, Christopher, Arne Eigenfeldt and Philippe Pasquier. 2013. “The Generative Electronic Dance Music Algorithmic Systems (GEDMAS)”. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, 5–8. Bellevue: AAAI Press.

Bassett, Peter. 2013. “Benefits beyond Music: Transferable Skills for Adult Life”. Unpublished Master’s Thesis, University of Sheffield.

Blackwell, Alan Frank and Nick Collins. 2005. “The Programming Language as a Musical Instrument”. In Proceedings of the 17th Workshop of the Psychology of Programming Interest Group, 120–30. Brighton: University of Sussex.

Collins, Nick, Alex McLean, Julian Rohrhuber and Adrian Ward. 2003. “Live Coding in Laptop Performance”. Organised Sound, 8(3): 321–30. <http://dx.doi.org/10.1017/s135577180300030x.>

Collins, Nick. 2007. ‘Live Coding Practice’. In Proceedings of the 7th International Conference on New Interfaces for Musical Expression, 112–7. New York: ACM Press. <http://dx.doi.org/10.1145/1279740.1279760>.

Collins, Nick. 2008. “Infno: Generating Synth Pop and Electronic Dance Music on Demand”. In Proceedings of the International Computer Music Conference. Montreal: International Computer Music Association.

Gaspar, Alessio and Sarah Langevin. 2007. “Restoring Coding with Intention in Introductory Programming Courses”. In Proceedings of the 8th ACM SIGITE Conference on Information Technology Education, 91–8. Destin: ACM Press. <http://dx.doi.org/10.1145/1324302.1324323>.

Manaris, Bill, Blake Stevens and Andrew R. Brown. 2016. “JythonMusic: An Environment for Teaching Algorithmic Music Composition, Dynamic Coding and Musical Performativity”. Journal of Music, Technology and Education 9(1): 33–56. <http://dx.doi.org/10.1386/jmte.9.1.33_1>.

McLean, Alex and Geraint Wiggins. 2010. “Live Coding towards Computational Creativity”. In Proceedings of the International Conference on Computational Creativity, 175–9. Lisbon: Department of Informatics Engineering, University of Coimbra.

Ruthmann, Alex, Jesse M. Heines, Gena R. Greher, Paul Laidler and Charles Saulters, II. 2010. “Teaching Computational Thinking through Musical Live Coding in Scratch”. In Proceedings of the 41st ACM technical symposium on Computer science education, 351–5. New York: ACM. <http://dx.doi.org/10.1145/1734263.1734384>.

Sorensen, Andrew and Andrew R. Brown. 2007. “aa-cell in Practice: An Approach to Musical Live Coding”. In Proceedings of the International Computer Music Conference, 292–9. Copenhagen: International Computer Music Association.

Väkevä, Lauri. 2010. “Garage band or GarageBand®? Remixing Musical Futures”. British Journal of Music Education, 27(1): 59–70. <http://dx.doi.org/10.1017/s0265051709990209>.

Ward, Adrian, Julian Rohrhuber, Fredrik Olofsson, Alex McLean, Dave Griffiths, Nick Collins and Amy Alexander. 2004. “Live Algorithm Programming and a Temporary Organization for Its Promotion”. In Proceedings of the README Software Art Conference, 243–61. Aarhus, Denmark.

Wooller, René and Andrew R. Brown. 2011. “Note Sequencing Morphing Algorithms for Performance of Electronic Dance Music”. Digital Creativity 22(1): 13–25. <http://dx.doi.org/10.1080/14626268.2011.538704>.