Course:PHYS341/2022/An instrument anyone can sound good on

From UBC Wiki

No Music training required: Can we design an instrument that can let people without musical skill sound good and have fun playing music?

A project for physics 341 the physics of music.

By Brody Lodmell

Introduction

block diagram explaining how the theremin based instrument will work

There are many people in the world who haven’t done any music or ear training. I think it is possible to create an instrument that uses some science, music theory, and audio-processing computation to help the person playing create a melody that sounds good over top of the backing track. In “intro to jazz soloing” classes the teacher might suggest to you that you write down which key the song is for each measure and then play notes in the blues scale at that time. It is this general idea that we’re going to follow, but we’re going to amp that up to 11. We’re going to only allow the instrument to play notes in the corresponding pentatonic scale.

I want to create this instrument is because it will bring the joy of music creation to a greater audience.

Description of instrument

Artist Rendition of the music instrument created for phys 341

This device will be large, with lights. Something that will entice you to walk up to it at Science world or a music festival. The speakers will be playing some house music. When you stand on the star the instrument will activate. Moving your body and your hands will cause the instrument to play notes. The notes that it plays will be from the major pentatonic scale of whichever key the song is in, but the timbre of the notes will be impacted by how their body interacts with the theremin. The player doesn’t touch any part of the instrument, they simply exist and move about within the space. The instrument will “snap” to specific notes, sort of like when you’re moving items in powerpoint and they snap to the edges or to line up with other objects in the slide. The math and audio processing involved in this is actually just going to be handled by the autotune ™ plugin.

Physics of the Theremin

Block diagram Theremin.png

The Theremin works by exploiting the phenomena of “beats”. A simple electronic circuit (called an resistor capacitor oscillator) is constructed and tuned to create a sinusiodal wave at a specific tunable frequency. Then a second such circuit is created however instead of a capacitor, an antenae is used. When set up correctly, the frequency generator by the first circuit will be close enough to the frequency generated by the circuit involving the antenae. These signals will be added together and beats will be produced. Those beats will be the signal that when amplified becomes notes.

The figure from wikipedia, shows a basic diagram of the original instrument, which has two oscillators one to generate pitch and one to set the volume.

Beats are produced when two periodic waves are added to eachother that have slightly different frequencies. A 400 hz wave with a 401hz wave will produce a 1hz beat. Review the notes from lecture 23.

one page from lecture 23 of ubc phys 341 lecture notes

For the theremin, it produces a specifically dialed in frequency using an adjustible capacitor. Then the exact frequency that is generated by the instrument is dependant upon how the antenae changes it’s own capacitance properties. The only thing you need to know is that the capacitance changes, which is a property of the antenae and the surrounding air. The frequencies that are created are not going to be very far off from our expected dialed in frequency, so if we’ve set it up correctly we will get beats, and then those beats will be the notes that we will then use for the next part of the music production.

Theremins in Pop Culture

The theremins as an instrument are remarkably difficult to play, very subtle movement of your hands will cause large variations in tuning.

However there are some really cool players out there:

For example Jimmy Page (a member of the band Led Zepplin) has played a theremin on stage:

https://www.youtube.com/watch?v=1JtLHa3q37w

Leon Theremin himself playing it:

https://www.youtube.com/watch?v=w5qf9O6c20o

A Deeper look into the “Autotune” Audio Processing on the Theremin Signal

Histogram of a theremin sound

As we learned in class, the frequency of oscilation of the tone is the thing that determines which note it is. So the naïve way to increase the pitch of some note is to play it faster. Which sure enough is how things like alvin and the chipmunks are made. They play the original audio faster, and boom higher pitch. Autotuning the note is working on that same premise except that it can’t simply play the note faster, it must also account for the fact that now this sound will be done playing before or after expected. So the audio processing must account for this by repeating some of the pattern to fill in the space. The exact computational mechanism of how this works is beyond the scope of the project. When we build the thing, we will be able to use the Autotune plugin for Ableton Live in order to accomplish this.


The audio signal that is created by the theremin will have some note that will be the representative note. I have a sample of a thermin being played at around c6

the timbre of a thermin sound

This is a waveform of a theremin note: (figure: the timbre of a theremin sound )

And this is that note pitch corrected: (figure: the timbre of a theremin sound pitch corrected)

the timbre of a theremin sound after pitch correction

Note that it looks the “same” except squished. i.e. it has a similar timbre, but it will be a higher pitch because all of the frequencies will be increased to match the note we want.

This is effectively what the pitch correction engine will be doing. It will attempt to figure out which note is being played, it will do this by examining the spectrum for a sample, then it will pick a specific note from the list of acceptable notes to snap to.

The Music Theory Behind simply using notes in the Pentatonic Scale

The notes in the pentatonic major scale sound good because they follow the simple ratios of frequencies that sound good in our brain. This idea is also why children’s songs such as merry had a little lamb feature just these notes. The Orff Approach[1] is the musical education approach that features instruments that only play these notes in an effort to begin teaching music to children. The premise isn’t that literally everything that comes out of the instrument sounds good, the premise is that the music that is produced is more likely to sound good, and it will encourage exploration.

The reason that the notes sound good is that they are simple ratios of the root of the chord. The notes are constructed by going up a perfect fifth i.e. 3/2 of the the frequency, and then down an octave when neccesary.

C up a 5th goes to G which goes to D which goes to A which goes to E. Then down an octave when necessary. All of these ratios are always 3/2 or 1/2, and the inverses of those relationships.

Mockup/proof of concept of the Instrument

Screenshot of the Instrument Mockup https://phas.ubc.ca/~brodyl/341/341gm.html

Using Javascript I made a very simple mockup of the instrument. In this mockup the backing track stays in the same key of F major, and thus the instrument stays in that same key.You play the instrument by pressing somewhere on the square and this will generate notes, letting go of the square will release the note. Note that this simulation doesn’t use a theremin, it uses a different method for producing notes. This demo is simply an attempt at creating an instrument which only plays certain notes using an opaque playing structure.

Note that this mockup doesn't simulate a theremin at all, it is an attempt at seeing if the theory works. Can an instrument that only plays those notes sound good at all with an appropriate backing track.

Currently in the mockup, it doesn't change scale in the middle of the song yet, it just is trying to see if the idea might work before I go through the effort of building a physical version of the thing.

Here is a youtube video of me playing it: https://youtu.be/vWnLo8tp3-s

And here you can try it out yourself https://phys420.phas.ubc.ca/p420_2021/brodyl/341/341f.html

The prototype was created heavily relying upon the music javascript library: tone.js

References

The lecture notes of UBC Physics 341

The London Mercury Vol.XVII No.99 1928

https://www.youtube.com/watch?v=1JtLHa3q37w

https://tonejs.github.io/