Code of Music: Week 4 Interactive Rhythm Ideas

For this week’s assignment, me and my partner Jianhao Ma came up with some ideas for an interactive rhythm concept that could work inside the browser. During class, we explored a variety of different ways to create rhythm, which ranged from a buttons on a circle to typing letters into a text box. We built upon these ideas to create a new experience based on a variety of interactions from the user. Below are descriptions and images to explain our idea:

1.) Browser Music Sequencer

When the user enters the website, they will be greeted with a tutorial on how to use the interface. They can add notes by clicking a button and a corresponding window will appear in the browser. To delete a note, they simply click the exit button on the window. Notes will be read from left to right, top to bottom just like sheet music. Based on the position, number of windows, and notes, a different rhythm will be played each time.

2.) Typo Music Generator

The typo music generator is relatively straightforward. The user can copy and paste text from an essay or type something into the text box. When an error is displayed, it will generate a note similar to an error sound. This rhythm can be looped to create music.

3.) Phone rhythm generator using accelerometer

Using the user’s phone accelerometer, we can create rhythm based on how fast or slow the phone is shaking. P5.js has multiple functions to track user movement in mobile browsers. The user can also select from multiple sound libraries to generate different types of music. 

Code of Music: Week 4 Drum Beat – Thomas Tai

Sketch: https://editor.p5js.org/thomastai/sketches/QZekqVlL

For this assignment, our task was to create a drum beat using Tone.js. The beat I posted as rhythmically engaging did not have any drums, so I decided to make my own beat inspired by the song. I started out by using a drum machine found on the internet to create some rhythms, which I later converted to code. The beat consists of four measures subdivided into four beats. I used Tone.js transport object to call a beat function every four notes and used a counter variable to keep track of the current measure. This exercise was a fun and interesting way to explore rhythm in Tone.js.

Inspiration:

Drum Loop:

Sketch Demo:

Code of Music: Week 3 Reading Response

For this week’s reading, we were asked to continue reading This is your brain on music, chapter 2. Some of the most fundamental concepts in music are tempo, meter, and rhythm. Tempo refers to the speed at which music is played and meter refers to the first beat of the pattern. Rhythm, which refers to the length of notes, is a fundamental aspect to all types of music. One interesting aspect about rhythm is that we can predict what happens next in the song. Similar to language, music also has structure and pattern. When a note doesn’t belong, we can instantly feel and recognize that something is off. Recurrent Neural Networks which were originally used for language processing are now being used to generate music.

Music is subjective, but listeners can tell when something sounds unpleasant or out of tune. Our brains can discern chords that are harmonious and disharmonious. Multiple notes that form integer frequencies will be in harmony, while other notes may clash and feel out of place. Music may not appear to be science, but the fundamental physics of sound involve math. According to the author, “The particular notes found in our major scale trace their roots back to the ancient Greeks and their notions of consonance.” The major scales generate frequencies that are in harmony, which is why orchestras will use the same key when playing a piece together. While we as the listeners don’t care about the music theory behind a song, we subconsciously judge it for its harmony and rhythm.

The tempo of a piece is the speed of the beat measured in beats per minutes. With the time signature, which specifies how many beats are contained in each measure as a fraction, we can express exactly how a piece should be played. Many songs in the western world are written in common time in which there are four beats in a measure. Loudness is another important element of music, which is scientifically measured in decibels. A song will typically have changes in loudness which are indicated by the composer. Dynamics, along with other elements in music such as rhythm, pitch, melody, and harmony make up the basic building blocks of music. While we don’t know exactly how the brain processes music, we can certainly appreciate songs for the joy they bring.

Code of Music: Week 2 Rhythmically Interesting Song

This video is about a rave that happens on a remote island with thousands of crabs snapping their claws to the beat of electronic music.  I picked this song because it has an addicting and interesting beat that matches perfectly with the visuals. The song is very basic – there are three sections with the melody repeating every 2 measures for the intro and outro. Most of the notes seem to be synthesized and the tempo is around 120 bpm. Despite the simplicity of the song, it has reached 90+ million views on Youtube which shows how music doesn’t need to be complex.

Code of Music: Week 1: Catalog + Ideas

Introduction 

For this assignment, we had to study and describe a musical composition using words to develop a catalog of attributes. There are multiple ways to describe a piece of music, and it is ultimately up to the listener to interpret it. Some common attributes of music include harmony, melody, rhythm, form, and key. I choose to analyze a midi file from classicalarchives.com to be able to see the multiple layers that make up an entire piece. The name of the piece is Antonio Vivaldi: La primavera (Spring) in E, RV269, Op.8, No.1 which was originally composed in 1723 and rewritten using digital midi technology. Attached below is one performance by a talented group.

Catalog of Attributes 

Beat: 90 Beats Per Minute

Sound Elements: Violin I, Violin II, Violin III, Viola, Cello, Double Bass

Harmony: Cello and Bass mostly play one quarter note repeatedly which provides the beat for other instruments.

Melody: Fast and lively sound (ball dance music), distinct baroque style, noticeable contrast in dynamics, one common theme repeated, notes going up and down, many trills that sound like bird chirps.

Rhythm: Common Time

Form: The composition has three main sections that go from quick to slow to quick again. 

Possible Idea

Spring is a classic piece that many musicians play both in orchestras and as a solo piece. The piece is part of four different concertos called Spring, Summer, Autumn, and Winter. It would be interesting to train a neural network to generate Vivaldi music based on the time of year.  We could create a website that generates the piece and users could come and listen. However, this could be difficult to do without a deep understanding of machine learning and procedurally generated computer music. Another possible alternative would be to take parts from each piece and mix them together. 

Image Source: https://www.washingtonpost.com/weather/2019/11/17/snow-fall-color-comparing-beauty-all-four-seasons-tidal-basin-photos/