Programming Music with Sonic Pi Promotes Positive Attitudes for Beginners

In this episode I unpack Petrie’s (2021) publication titled “Programming music with Sonic Pi promotes positive attitudes for beginners,” which investigates student attitudes around enjoyment, importance, and anxiety when coding music through Sonic Pi.

  • Welcome back to another episode of the

    CSK8 podcast my name is jared o'leary

    each episode of this podcast is either

    an interview with a guest or multiple

    guests or a solo episode where i unpack

    some scholarship in relation to computer

    science education in this week's episode

    i'm unpacking a paper titled programming

    music with sonic pi promotes positive

    attitudes for beginners written by

    christopher petrie apologies if i

    mispronounced your name here's the

    abstract for this paper quote

    programming is often misaligned with

    beginner students interests and viewed

    as difficult however most students and

    teachers are not aware that it is

    possible to utilize domain-specific

    programming languages that combine

    programming with other domains like

    music making sonic pi is one free

    domain-specific programming platform

    that enables beginners to code music

    which has been designed for and used in

    schools since his first release in 2012.

    however there is a lack of academic

    research on the sonic pi platform about

    the extent it may affect beginner

    student attitudes towards programming in

    a school context the aim of the study

    was to investigate the extent sonic pi

    may help to promote positive attitudes

    towards programming a mixed methods case

    study was developed and trialled in

    school time with a middle school class

    which measured student attitudes with

    the three subscales of enjoyment

    importance and anxiety overall the

    results confirmed an alternative

    hypothesis that all students subscales

    for programming attitude increase

    significantly while these findings are

    not generalizable due to its limited

    scope they are very positive to inform

    the design and use of platforms like

    sonic pi in comparison to similar music

    coding platforms like ear sketch and

    tune pad and quote try to summarize this

    paper into a single sentence i'd say

    that this paper investigates student

    attitudes around enjoyment importance

    and anxiety when coding music through

    sonic pie you want to check out this

    particular paper i do recommend doing so

    you can find a link to it in the show

    notes as well as a link to the author's

    google scholar profile you can find that

    by clicking the link in the app that

    you're listening to this on or by going

    to jarrodleary.com and just clicking on

    podcast and while you're there you'll

    notice that this podcast is powered by

    boot up professional development which

    is the nonprofit that i work for if you

    haven't checked out boot.pd.org make

    sure you check out the curriculum and

    the professional development we provide

    so in the introduction the author

    mentions that there's a lot of different

    programming platforms and even languages

    that have come out in recent years to

    try and make it more appealing and

    easier for beginners and they cite some

    research that basically says that hey if

    you have a variety of ways to engage

    with programming or computer science

    then this can help improve attitudes

    towards programming which i completely

    agree with i used to facilitate multiple

    programming languages and platforms all

    in the same class so if there's like 30

    kids in there they'd be working on 30

    different projects but they could be

    working on sonic pi which is the

    platform in this particular study they

    could be doing javascript with khan

    academy they could be doing scratch

    which is block-based programming

    language or they could even be doing

    swift in xcode or in swift playgrounds

    to be able to create apps for their ipad

    or something so students had several

    different languages whether it was swift

    javascript scratch or ruby and sonic pi

    and several different platforms that all

    kind of emphasize different things

    whether it's like games and stories or

    art and animation or app development or

    music so although the majority of

    students tended to about 80 for each

    class would focus on scratch that

    remaining 20

    who might not have enjoyed scratch as

    much as i love it they preferred to do

    something else and so i definitely agree

    that having a variety of approaches

    really helps with like that 20 of

    students who might not be interested in

    what the majority are interested in and

    like the author mentions there's not a

    lot of studies on music making with code

    and if there are most of them tend to

    focus on well what are the benefits for

    computer science and interestingly i'm

    actually supervising a doc student who

    is studying high school attitudes on

    making music with sonic pi to see if it

    improves their attitudes towards music

    making not just computer science but

    this particular study is going to focus

    on the question quote can composing

    music with a sonic pi platform help to

    promote positive attitudes towards

    programming end quote that's from page

    two so we'll answer that question for

    this particular group today but stay

    tuned in the future for more research on

    whether or not it actually promotes

    positive attitudes towards music making

    right so the next section is the

    background so they talk about the

    importance of attitude as well as like

    domain-specific programming platforms

    which mark guzdail talked about a little

    bit in the interview that i did with him

    so make sure you check out that

    interview if you're interested in i'll

    include a link to that in the show notes

    but here's a quote from page two quote

    domain specific programming platforms

    have shown to be potentially motivating

    for beginners and foster positive

    attitudes because they enable an easier

    way to combine a domain they are already

    interested in like music with

    programming end quote i totally agree i

    had some students who are like yo the

    only thing i want to do in life is

    produce music if there's a way that i

    can somehow make music in this class

    then i will be happy because they were

    required to be there we found a way to

    incorporate that interest whether it's

    making music in sonic by or in scratch

    and then those students were happy if

    they were instead forced to make apps

    that were not related music they would

    have been like why do i need to know

    this so having some kind of domain

    specific programming platform can be

    really helpful for students like that

    and the following one the author kind of

    talks about well one what is sonic pine

    how is it different from other platforms

    like ear sketch and tune pad and then

    also kind of unpacking what is live

    coding so sonic pi uses ruby which is

    very syntax light so it's super easy

    programming language you don't have to

    worry about semicolons you don't have to

    type a lot to get things done it's a

    very quick language to program which is

    fantastic for people who are brand new

    to programming like i used to do sonic

    pie with fourth grade and above but you

    could certainly even do it with third

    grade and above just go a little bit

    slower but because sonic pi is so easy

    to use and type out people actually use

    it to do something called live coding so

    live coding in programming is typically

    described as like well when you go up

    for a lecture you will like instead of

    showing a completed example you actually

    type the example live but this is

    actually very different from that so

    yeah you're going up in you're

    displaying your code and you're typing

    it out live but you're doing it to make

    live music you're not just composing

    where you write out all the code and

    then you press play and say what does it

    sound like instead you're typing the

    code and then maybe the first line will

    just kind of like loop a bass drum beat

    and you'll press run and then that bass

    drum beat is going to go on forever

    because we're making some edm because

    why not then while you're still

    listening to the bass drum you might add

    in some high hat and some snare drum and

    you press run and it just automatically

    adds it into the music that you're

    making then you'll add in like a bass

    line some melodies harmonies etc and

    you'll live code music i'll include some

    videos in the show notes that kind of

    demonstrate some different ways that

    people make music live with sonic pi

    it's fascinating you might watch like an

    hour-long segment and you'll be able to

    see every line of code that is being

    used to create that so you can actually

    recreate it on your own without having

    to like reverse engineer it just by

    listening to it so this is a really neat

    affordance that sonic pi has that other

    platforms do not have but i will say as

    the author mentions that composing music

    is a whole lot easier to do than

    performing the music live so all the

    elementary students that i worked with

    and even the middle school kids they

    would compose their music in sonic pie

    they'd come back each day and kind of

    refine it or create something new rather

    than like perform it for their peers

    that is a more complicated thing to do

    but it's a really neat thing that you

    can do with sonic pi alright so the next

    section talks about attitude studies on

    music and programming so a lot of these

    are kind of like looking at ear sketch

    and some other platforms but to be

    honest there's really not a ton of

    research out there it's still very much

    under explored in my opinion which is

    neat we're forging new ground so stay

    tuned a decade from now hopefully we'll

    have a bunch of other people who are

    interested in music in cs who will

    explore this more like i did in my

    dissertation which looked at a variety

    of different practices to create chip

    music so if you want to check that out

    music with a retro and old video game

    and computer hardware there's a lot of

    coding and even hardware practices that

    the chip musicians engaged in i'll

    include a link to the dissertation in

    the show notes where it is available 100

    for free all right so next section is

    methods so this talks about how this was

    a six-part unit of work had 22

    programmers that were between ages of 11

    and 12 and it used a constructionist

    approach or kind of like guide students

    thinking through questions instead of

    providing answers but then had some like

    resources and whatnot to help support

    student engagement like sonic pi has a

    bunch of tutorials in it that show you

    how to do things has like a dictionary

    that shows you like what does this

    particular control structure do well

    here are some examples etcetera so it's

    very friendly to new users and it's a

    free platform by the way if you haven't

    tried out sonic pi yet like sonic pi.net

    i highly recommend it i'll include a

    link to that in the show notes just be

    warned you might get lost in it for

    hours because you'll just be having fun

    making music or listening to like the

    edm that people make or even like the

    there's like a bach piece that is

    completely written out in sonic pi or

    you can even create like spooky sound

    effects or like what could i do to make

    an ocean sound etc there's examples

    built into it i'll show you how to do

    all that alright so the next section or

    subsection rather of this paper talks

    about the pre and post unit of work

    questionnaires so it has like different

    parts where like one section focused on

    quantitative changes and attitudes

    towards music composition and

    programming next one is more qualitative

    responses towards music and programming

    and then the last section is like

    demographics so it's like what are their

    prior experiences with music and

    programming etc now the author does note

    on page five that they actually not only

    measured the programming attitudes but

    also some music composition attitudes to

    see if there are any similarities or

    differences between that and programming

    but again the main question guiding this

    is whether improved attitudes towards

    coding next subsection talks about pre

    and post interviews if you want to read

    more about that make sure you check that

    out and then kind of unpacks the

    research context and sample so 10 of the

    students were female 12 were male most

    were from new zealand european descent

    two were indian two were chinese one was

    german one was samoan and according to

    the school none of the students had any

    special needs or any specific

    significant language difficulties for

    their age so table two on page five is

    interesting so talks about how none of

    the students had prior experience with

    programming and music making in one

    activity however four of the males and

    two of the females had prior programming

    experience so six out of the 22. one of

    the males and three of the females so 4

    out of 22 had special music trainings

    like taking lessons but again did not

    have any programming experience two of

    the males and two of the females so four

    out of 22 had prior experience in both

    programming and in music but they were

    separate five of the males and three of

    the females so eight out of 22 were

    completely new to both programming and

    music making i had a good range of

    different experiences among the

    different participants all right so then

    the last section of the methods talks

    about data analysis so if you want to

    get nerdy learn more about the

    quantitative and qualitative analysis

    approaches check out page six but let's

    talk about the results here's a quote

    from page six quote all programming

    attitude subscales indicated higher t

    values than music suggesting the unit of

    work had a more significant difference

    in all attitude subscales for

    programming in comparison to all

    attitude subscales from music end quote

    that is interesting so in other words it

    improves students attitudes towards

    programming more than it improves their

    attitudes towards making music so that

    as a like somebody with a background in

    music education and computer science

    education is fascinating that might

    imply well maybe this kind of music

    making should occur in the cs class

    because it has more of an impact on

    computer science than it does on music

    making at least among these participants

    and the way that it was framed here

    another question that we must ask is

    well what could we change about the

    design of the

    instruction or the experience to make it

    so that it improves the attitudes for

    music making more than programming and

    if we find that to be the case should

    that experience occur in a music class

    instead of a cs class or should we just

    create an interdiscipline which is like

    a combo of music and cs and i argue in

    my dissertation that you certainly could

    do that especially if you take a look at

    the hardware practices that are

    discussed in the dissertation itself one

    of these days i should probably do an

    unpacking scholarship episode on that

    but it's like 300 pages something like

    that i don't know i wrote it a while ago

    here's another really interesting

    finding so i'm gonna read this quote

    from page seven quote the students with

    prior experience only in programming and

    of six and both programming and music in

    a four had the highest averages for all

    attitude sub-scales in t1 and t2 those

    students without prior experiences in

    either music or programming end of eight

    had the lowest average for both subjects

    these findings reflect that prior

    programming experience positively

    affects attitudes more than those

    without apprehension about learning

    programming or trying something new may

    be the reason why students without prior

    experience in programming have the

    lowest averages in quote that is a

    really interesting finding so if you had

    prior experience with programming or

    programming and music you had higher

    averages for your attitudes on the

    experience but if you did not have prior

    experiences in music and programming

    then you had the lowest attitude

    averages this is one of the things that

    i've talked about before when you

    combine two different subject areas

    you're having to learn two domains

    simultaneously and that from like a

    cognitive load experience might be a bit

    overwhelming for some students if you

    have experience in at least one of them

    then you can at least build off of that

    schema that you have developed in that

    other domain but if you are creating two

    different schema one free music one for

    programming simultaneously that might be

    a bit overwhelming so that is a really

    interesting finding for us to consider

    in computer science education because

    maybe instead of integrating computer

    science into other areas like science

    and cs together maybe that is actually

    going to cause some overwhelm like it

    did in this scenario if students are

    brand new to learning science or a

    particular area like i don't know

    biology or something and they're brand

    new to learning programming they might

    actually perform worse in both of those

    areas in terms of their attitudes or

    maybe even their content understanding

    something to consider and it's something

    that we don't really talk about much in

    the field in my opinion alright so let's

    look at the subscales so 4.2 it talks

    about enjoyment so 75 of the students

    had positive attitudes toward the

    experience and that for most of the

    students that it increased their

    enjoyment of programming significantly

    then here's a quote from page seven

    quote these responses help to identify

    the dominant theme that emerged from the

    qualitative data novelty of making music

    with code this theme helps explain why

    students enjoyed the unit of work which

    was a new experience for all students in

    quote this is really really important

    the novelty of an activity is extremely

    important to consider because that

    novelty can wear off

    really fast so for example in the

    district that i previously worked in i

    was given access to basically everything

    under the sun that related to

    makerspaces they wanted to test it out

    in the makerspace class that i had it

    was a middle school elective that had a

    really long waiting list for students to

    get into because it was an elective

    where they just got to kind of explore a

    bunch of maker activities however they

    wanted to often kids would find

    something to be really engaging and

    interesting like physical computing or

    something and about a week later maybe a

    couple weeks later they would lose all

    interest in it it was fun for a limited

    amount of time but once they've

    exhausted everything that you can do

    with that thing then students would

    often want to move on to something else

    the same thing could happen in these

    like interdisciplinary contexts students

    who are really interested in making

    music with code might be like wow this

    is really cool they dive into it for a

    little bit and then they might get bored

    with it that happened with a lot of

    students that i worked with where they

    would try it out for maybe a quarter and

    then after that they just wanted to go

    back to making games in scratch so

    something we really need to consider

    when doing this is we need to do more

    longitudinal studies of not only like

    these interdisciplinary intersections

    but also

    with like physical computing just

    because students have a lot of fun with

    beebot for a lesson or two doesn't mean

    it's something that is worth investing

    in if they lose all interest in it a

    couple weeks later especially if you

    have an entire unit that might be a

    semester long or a year long that

    involves that particular device or

    whatever device i'll in my rant there

    the next section 4.3 is on the

    importance so the author found that the

    important subscale increased for most of

    the students significantly there's

    actually a figure on page seven that you

    can check out you can see the increase

    in scores there as well as on page 8

    there are some quotes from different

    students i kind of talked about

    different themes related to like the

    novelty of coding music or enjoying

    coding music or that they like the

    creative aspect of programming these are

    all very important themes to consider

    when exploring this kind of engagement

    right so the next subsection talks about

    the qualitative results and so give some

    different examples for some responses

    like you could get a job that pays a lot

    of money doing this or we use technology

    a lot or i want to learn how to program

    robots because everything is being taken

    over by robots etc here's a quote from

    page nine quote programming was commonly

    reported as a valuable skill to learn by

    many participants regardless of their

    prior experience in this skill it was

    unclear whether this theme emerged

    because of students exposure to sonic pi

    specifically or the unit of work end

    quote which is a really good point i'm

    glad the author mentioned that it could

    also just be like pervasive discourse

    outside of the schools is like

    programming is important everyone needs

    to learn how to do this but a question

    that i've got is okay well they might

    see the importance of it but do they

    actually want to continue to learn

    programming like myself there are a lot

    of things i'm like yeah that's really

    important for people to know you can

    make a lot of money doing that

    particular skill for a job but i don't

    want to not everything that's important

    in society is important to me but that's

    just my opinion alright so the next

    subsection that starts on page nine

    talks about the anxiety so it was saying

    that the qualitative responses said that

    actually engaging in this decrease the

    anxiety in programming significantly for

    the participants in the study here's an

    interesting quote though from page nine

    quote these findings indicate that

    students with prior programming

    experience had much less anxiety than

    those without initially however all

    students were able to significantly

    reduce their anxiety with exposure to

    sonic pi by the end of the unit of work

    end quote now i guess one question that

    i'd have for that is how would that

    compare to other things like if you did

    stuff in scratch or javascript in

    khan academy or whatever is it just the

    exposure to programming and going oh

    it's not as hard as i thought it was or

    is this specifically the exposure to

    programming through

    ruby and sonic pi ruby being the

    language and sonic pi being in the

    platform but i don't know here's one

    more final quote from page nine quote

    while the quantitative results indicated

    a decrease in anxiety these reflections

    suggest students perceptions of

    programming as a difficult skill to

    learn may have contributed to their

    sense of anxiety notably no instances

    were recorded of students who thought

    programming is easy or comparatively

    difficult to other subjects end quote

    which if you listen to the interview

    with bob irving the second one in

    particular he talks about his book

    called hard fun and i think that kind of

    like really summarizes this no

    programming isn't easy but it's also a

    lot of fun so you can enjoy it but know

    that it's going to push you a little bit

    in terms of your understanding most

    likely alright so in the discussion

    section starts on page nine author

    mentions that hey this might be an

    effective way to introduce programming

    to students around ages 11 and 12. i

    agree i've done it in that age group

    i've done it younger again as young as

    fourth grade but an interesting quote

    from page nine says quote while both

    males and females saw increases in

    attitudes from t1 to t2 males generally

    began with more positive attitudes in t1

    additionally the unit of work had a

    greater positive effect on males in t2

    for programming end quote that's a

    really interesting finding i'm kind of

    wondering out loud how much of it had to

    do with the kind of music that they were

    making tends to lend itself toward edm

    and so depending on how you teach it the

    different styles and genres of music

    that you explore might be favored by

    some students more than others so that

    might have an effect so if i were to

    teach you how to use sonic pi to create

    heavy metal music that might resonate

    with some people

    more than people who would prefer it be

    taught to create pop music or

    trap or rap or hip-hop or whatever

    here's one more quote that i want to

    read from page 10 quote those with prior

    experiences in programming have the

    highest average increase from t1 to t2

    in all sub-scales end quote that is

    important a thought that i have on that

    is does that have to do with like

    expanding

    students understandings of what you can

    actually do with programming and

    computer science maybe they had like a

    narrow scope of their understanding of

    what you could do with cs like some

    blinders on like oh all you can do is

    program databases with sql sql and then

    when they see this they're like oh you

    can actually make music with this i had

    no idea and so maybe that increased

    their attitude and if you were to

    instead do like javascript khan academy

    stuff which focuses on art and animation

    would that also have a similar increase

    in their attitudes but i don't know a

    lot of how the media portrays like

    computer scientists is like some lone

    hacker sitting in a dark basement with

    like neon lights and edm playing really

    loud then when they see something that's

    not that well sort of not that then

    maybe they go oh there's some other cool

    things you can do all right so normally

    in these episodes i like to end with

    some lingering thoughts and questions

    but i actually kind of embedded them

    throughout because i thought it made

    more sense in this particular episode i

    really enjoyed reading this paper as

    somebody with multiple degrees in music

    education and having taught computer

    science education for the last several

    years i really enjoyed this intersection

    if you want to check out some of the

    other presentations publications and

    podcasts that i've done on the

    intersections of music and cs make sure

    you check out the show notes at

    jaredlery.com and if this podcast

    interested you please consider sharing

    with somebody else for sharing a review

    on whatever platform you're listening to

    this on thank you so much for listening

    stay tuned next week for another episode

    and until then i hope you're staying

    safe and are having a wonderful week

Article

Petrie, C. (2021). Programming music with Sonic Pi promotes positive attitudes for beginners. Computers & Education, 179(March 2021), 1–13.


Abstract

“Programming is often misaligned with beginner students’ interests and viewed as difficult. However, most students and teachers are not aware that it is possible to utilise domain-specific programming languages that combine programming with other domains like music making. Sonic Pi is one free domain-specific programming platform that enables beginners to code music, which has been designed for and used in schools since its first release in 2012. However, there is a lack of academic research on the Sonic Pi platform about the extent it may affect beginner student attitudes towards programming in a school context. The aim of this study was to investigate the extent Sonic Pi may help to promote positive attitudes towards programming. A mixed-methods case study was developed and trialled in school time with a middle school class, which measured student attitudes with the three subscales of enjoyment, importance, and anxiety. Overall, the results confirmed an alternative hypothesis that all students’ subscales for programming attitude increased significantly. While these findings are not generalisable due to its limited scope, they are very positive to inform the design and use of platforms like Sonic Pi in comparison to similar music coding platforms like EarSketch and TunePad.”


Author Keywords

Interdisciplinary projects, applications in subject areas, improving classroom teaching


My One Sentence Summary

This paper investigates student attitudes around enjoyment, importance, and anxiety when coding music through Sonic Pi.


Resources/Links Relevant to This Episode



More Content