How to learn music theory

Also, should this resource only include definitions and examples, or should it also feature exercises?

I think this should be set from the get-go…

Initially, just definitions and examples I think

1 Like

OK good… Also, should the course assume the user is familiar with the Sonic Pi tutorial?
I think maybe it’s better if the music theory thing, is separated from the basics of Sonic Pi itself.

If needed, a beginner will be directed to the tutorial and asked to come back for the music theory specific stuff, instead of explaining what play and sleep do, in this mini course.

But I’m not sure!

OK, so after some back and forth, here is a first draft of the outline presented by the AI…

Does this look OK to an expert eye?


Here is the revised overview:

  • Module 1: Pitch & The Musical Alphabet
    • Concept: Introduction to notes, the chromatic scale, and MIDI numbers as the sonic representation of pitch.
    • Sonic Pi: The play command and integer arguments.
  • Module 2: Scales & Key
    • Concept: Building major and minor scales from a pattern of whole and half steps. The concept of a tonal center (key).
    • Sonic Pi: Creating scales as arrays, using the scale function.
  • Module 3: Intervals
    • Concept: Measuring the distance between two pitches. Naming intervals (unison, third, fifth, etc.).
    • Sonic Pi: Calculating intervals with subtraction, playing two notes together.
  • Module 4: Harmony & Chords
    • Concept: Building triads (major, minor) from scale degrees. Chords as stacks of intervals.
    • Sonic Pi: The chord function, playing chord notes simultaneously with play_chord.
  • Module 5: Chord Progressions
    • Concept: The concept of harmonic movement. Introduction to Roman numeral analysis (I, IV, V).
    • Sonic Pi: Storing chords in an array to create a looped progression.
  • Module 6: Rhythm & Time
    • Concept: Beats, measures, and tempo. Basic rhythmic durations.
    • Sonic Pi: sleep, use_bpm, and creating patterns with live_loop.
  • Module 7: Melody & Accompaniment
    • Concept: How a melody interacts with its underlying harmony. Using chord tones and passing tones.
    • Sonic Pi: Layering independent live_loops for melody and chords.
  • Module 8: Basic Song Form
    • Concept: Common structures like Verse-Chorus. Creating contrast and repetition.
    • Sonic Pi: Using variables or cues (cue/sync) to switch between musical sections.

Ready to draft the first module with this adjusted, concept-first focus.

This all looks very good, perhaps introduce durations a bit earlier. And should there be space for non-Western idioms such as microtonal music, Eastern rhythms, IDM etc? Or leave those topics for the intermediate/advanced?

PD-Pi

Hey… I presented the AI with this feedback, and now the outline looks like the following. Is this better? To be honest, there are some things that I find were formulated better in the previous version… It changed a bit too much IMHO…


Excellent feedback. The experienced users are thinking about flow, inclusivity, and practical application.

Here is the revised curriculum overview incorporating their points.

  • Module 1: Pitch, Time & The First Loop

    • Concept: The two fundamental data types: pitch (as MIDI number) and duration (as a beat number). Their synthesis creates music.
    • Sonic Pi: play, sleep, use_bpm. Creating a simple, timed sequence in a live_loop.
  • Module 2: Scales & The List Nature of Melody

    • Concept: The major scale formula (W-W-H-W-W-W-H). A scale as an ordered list defining a key center.
    • Sonic Pi: Defining a scale as an array. Iterating through it to create a melody.
  • Module 3: Intervals: The Measured Space Between Pitches

    • Concept: Intervals as the arithmetic distance between two pitches. Consonance vs. dissonance.
    • Sonic Pi: Calculating and playing intervals. Introduction to harmony with two concurrent play commands.
  • Module 4: Harmony & Chords

    • Concept: Building triads (major/minor) by stacking thirds. Chords as vertical structures.
    • Sonic Pi: The chord function. Using play_chord and arpeggiating chord notes.
  • Module 5: Chord Progressions & Roman Numerals

    • Concept: The I-IV-V-I progression as the foundational harmonic cycle. Tension and release.
    • Sonic Pi: Storing chords in an array and cycling through them.
  • Module 6: Rhythm & Pattern

    • Concept: Time signatures, strong/weak beats, and basic rhythmic patterns beyond simple durations.
    • Sonic Pi: Creating drum patterns with samples. Syncing melodic loops to a drum loop.
  • Module 7: Exploring Beyond the 12 Notes

    • Concept: A brief look at the world beyond equal temperament: microtones and alternative scales.
    • Sonic Pi: Using the play command with decimal numbers for microtones. Introducing scale with non-Western tunings (e.g., :pelog).
  • Module 8: Composition & Structure

    • Concept: Song sections (Verse, Chorus). Repetition and contrast as structural tools.
    • Sonic Pi: Two methods: 1) Using define to create reusable melodic/harmonic functions. 2) Using cue/sync for timed section changes. Combining loops and functions to form a complete piece.

This structure now:

  1. Introduces duration in Module 1 alongside pitch, establishing the core duality immediately.
  2. Includes a dedicated module (7) for exploration, acknowledging other musical traditions and techniques in a beginner-accessible way (microtones via decimals, alternative built-in scales).
  3. Expands the structure module (8) to include the function-based pattern, a clean and powerful Sonic Pi idiom, alongside the cue/sync method.

Ready to draft Module 1: Pitch, Time & The First Loop with this integrated framework.

I asked it to put back the section about “Melody & Accompaniment” in there

On a related note, here’s an excellent music theory basics tutorial, very concise, with accompanying pdf

1 Like

Nice… I’ll make sure and watch it… Sorry, I haven’t been very responsive, but I’m still around and motivated…

The AI did the final outline, and a draft of module one, but there has been a tiny bit of “drift” so I’ll refocus things before posting here, very soon!

Hey! I’m back…

So after some small corrective steps, here’s what my AI said the very first module should look like…

How did it do then?



Title: Module 1: Pitch, Time & The First Loop

Tags: [[Music Theory]] [[Sonic Pi]] [[Basics]] [[Pitch]] [[Rhythm]]

The Two Core Data Types

In Sonic Pi, music is built from two fundamental kinds of data:

  1. Pitch: Represented by a number. Higher number = higher pitch.
  2. Duration: Represented by a number. This number tells the computer how long to wait (in beats) before the next instruction.

1. Pitch as a Number: MIDI Notes

The most straightforward way to represent a pitch in code is using a MIDI note number. Imagine a number line stretched across a piano keyboard.

C4 (Middle C) --> 60
C#4/Db4 ------> 61
D4 -----------> 62
... etc. ...
C5 (One octave higher) --> 72

Note: Different systems name these pitches. In this course, we’ll primarily use MIDI numbers and the English system (C, D, E…). For reference:

  • English: C, D, E, F, G, A, B
  • Fixed-Do Solfège (European): Do, Re, Mi, Fa, Sol, La, Si
  • MIDI Number (e.g., for C4): 60

Sonic Pi understands both play 60 and play :C4.

The Code: The play command turns a number into sound.

play 60 # Plays Middle C
play 67 # Plays the G above Middle C

Try this now: Copy the two lines above, paste them into a Sonic Pi buffer, and press Run. You should hear two distinct pitches, played simultaneously.

Octave Simply Explained: In the code examples, notice that 60 and 72 are both called “C”. An octave is the distance where a note’s name repeats. In our number system, adding 12 moves you up to the next octave (e.g., from C4 to C5). Its musical use—for creating harmony, variation, and basslines—will be explored in later modules.

2. Duration as a Number: Beats & Sleep

Music happens over time. The sleep command tells Sonic Pi to pause for a number of beats.

play 60
sleep 1 # Waits for 1 full beat before the next command
play 62

You control the speed of the beat using use_bpm (Beats Per Minute).

use_bpm 120 # Sets a medium-fast tempo
play 60
sleep 1
play 62

3. Combining Them: Your First Melody (a List of Instructions)

A melody is a sequence of pitch-and-duration pairs. In code, this is a list of instructions.

use_bpm 120
play 64 # E4
sleep 0.5 # A half-beat wait
play 62 # D4
sleep 0.5
play 60 # C4
sleep 1 # A full-beat wait

4. The Loop: Creating a Musical Structure

A live_loop repeats a block of code forever, allowing you to build repeating patterns—the backbone of most music. It’s a container for your lists of instructions.

use_bpm 120

live_loop :first_loop do
  play 64
  sleep 0.5
  play 62
  sleep 0.5
  play 60
  sleep 1
end

Run this code. You will hear your three-note melody repeat. Change one of the play numbers or sleep times and run the code again (while it’s still playing) to hear it update instantly.

Summary & Core Philosophy

  • A Pitch is, first and foremost, a number on a line.
  • A Duration is a number representing beats of silence.
  • A Melody, at its core, is a timed list of these numbers, executed in order.
  • A Loop (live_loop) is a way to repeat that list, creating the cyclical structure essential to music.

In this curriculum, we will first understand what the data is (a number, a list), and then we will learn how it sounds. The sound is the result of the code.

I’m currently debating the AI about mentioning the term “note” in module 1 (maybe even in the summary), and not just “pitch” and “duration” separated.
This will be rooted in code, but it’s still a music theory intro first…


EDIT: Here’s the result of the corrected section:



Here is the concise integration for Module 1.

Place this new section after explaining sleep and before “Combining Them: Your First Melody”.


3. The Note: The Fundamental Unit

In music, a single sound is called a note. A note is defined by two properties:

  1. Its pitch (how high or low it is).
  2. Its duration (how long it lasts).

In Sonic Pi, a note is therefore constructed from our two core data types:

  • play [number] defines its pitch.
  • sleep [number] defines its duration.
# This is one note: Middle C, held for 1 beat.
play 60  # Pitch
sleep 1  # Duration

All musical structures—melodies, chords, rhythms—are built from sequences or combinations of notes.


This addition:

  1. Explicitly names the central concept (“note”).
  2. Grounds it in the already-explained code primitives.
  3. Provides a clear conceptual bridge to the next section about melodies.

It maintains the “code-first” perspective while fulfilling the music theory requirement. Ready to integrate or await forum feedback.

Yes, I agree: the term ‘note’ contains two main properties, pitch and duration, especially in the context of Sonic Pi. Timbre is something else entirely (although related to frequency) not central to basic music theory.

I wonder if this thread/topic has the potential to become too unwieldy for this forum - what do the admins think?

PD-Pi

True… Maybe we should start a dedicated thread, or maybe continue in private messages?

Or maybe I should go all the way, and only show the finished product for review?

In the meantime, does this module 1 look OK?

Yes, it all looks great. I still struggle with the concept and implication of the sleep function. It impacts on the duration of a sound (given the appropriate synth sound) but it also defines the time interval between events. Perhaps you should be more explicit about that definition?

PD-Pi