Music theory

Albert De La Fuente Vigliotti
Table of Contents

Music theory #

How to build scales and triads #

C Major scale #

In Linux you can visualize and play a virtual midi keyboard using vmpk.

The major scales are based on the distance steps between semitones structure from C considering only the white keys (whole tones). For instance:

  • C to D equals 2 semitones
  • D to E equals 2 semitones
  • E to F equals 1 semitone
  • F to G equals 2 semitones
  • G to A equals 2 semitones
  • A to B equals 2 semitones
  • B to C equals 1 semitones

So the formula is: 2, 2, 1, 2, 2, 2, 1.

Once you have the scale, each note builds a triad. Triads can be major or minor. A major triad has 4 steps until the second note and 3 more steps until the third note. For example, C would form a triad with E and G. C and add 4 semitones (C#, D, D#, E), and from there add 3 semitones (F, F#, G).

There is just one detail to remember. Major scales have this pattern: MmmMMmd (M being major, m being minor and d being diminished). A major chord adds 4 semitones and then 3. A minor chord adds 3 and then 4. A diminished chord adds 3 and then 3 semitones.

Now let’s visualize that…

I also like to represent this on a short table like this:

C Major 1 2 3 4 5 6 7
root C
Major/minor M m m M M m d
major formula 2 2 1 2 2 2 1
1st triad note C D E F G A B
+ 4 3 3 4 4 3 3
2nd triad note E F G A B C D
+ 3 4 4 3 3 4 4
3rd triad note G A B C D E F

I love to code and often I use the computer to teach myself, in this case I am going to use the musthe python lib to generate the same scale and all the triads so I can check my answers. I will use this snippet:

from musthe import *
import pandas as pd

def build_triads_df(key_note, scale_type, modes):
    result = []
    scale = []
    scale = Scale(key_note, scale_type)
    result_lst = []
    for i in range(len(scale)):
        mode = modes[i]
        triad = Chord(scale[i], mode)
        result.append([scale[i], triad.notes[0], triad.notes[1], triad.notes[2]])
        i += 1
    df = pd.DataFrame(result, columns=['scale_note', 'triad_1st', 'triad_2nd', 'triad_3rd'])
    return(df, result)
key_note = Note('C')
scale_type = 'major'

df, lst = build_triads_df(key_note, scale_type, 'MmmMMm°')
df
  scale_note triad_1st triad_2nd triad_3rd
0          C         C         E         G
1          D         D         F         A
2          E         E         G         B
3          F         F         A         C
4          G         G         B         D
5          A         A         C         E
6          B         B         D         F

Note that the pandas table is transposed compared to the one I did manually.

Again, I like using software to help me to teach myself new things. I found a Ruby gem called Coltrane that allows to print in the terminal a scale represented in piano and guitar. Here is an example:

┌─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─╥─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─┐
│ │ ││ │ ║ │ ││ ││ │ ║ │ ││ │ ║ │ ││ ││ │ │
│ │ ││ │ ║ │ ││ ││ │ ║ │ ││ │ ║ │ ││ ││ │ │
│ │ ││ │ ║ │ ││ ││ │ ║ │ ││ │ ║ │ ││ ││ │ │
│ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ ║ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ │
│  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  │
│C ║D ║E ║F ║G ║A ║B ║C ║D ║E ║F ║G ║A ║B │
└──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──┘

C Minor scale #

Now I am going to generate the C Minor scale. It is generated in the same way as C Major but based as starting in A (only white keys in the piano).

The formula is: 2, 1, 2, 2, 1, 2, 2.

C minor 1 2 3 4 5 6 7
root C
Major/minor m d M m m M M
minor formula 2 1 2 2 1 2 2
1st triad note C D Eb F G Ab Bb
+ 3 3 4 3 3 4 4
2nd triad note Eb F G Ab Bb C D
+ 4 3 3 4 4 3 3
3rd triad note G Ab Bb C D Eb F

Now I am going to double check my work using musthe:

key_note = Note('C')
scale_type = 'natural_minor'

df, lst = build_triads_df(key_note, scale_type, 'm°MmmMM')
df
  scale_note triad_1st triad_2nd triad_3rd
0          C         C        Eb         G
1          D         D         F        Ab
2         Eb        Eb         G        Bb
3          F         F        Ab         C
4          G         G        Bb         D
5         Ab        Ab         C        Eb
6         Bb        Bb         D         F

And finally render that scale on coltrane.

┌─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─╥─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─┐
│ │ ││ │ ║ │ ││ ││ │ ║ │ ││ │ ║ │ ││ ││ │ │
│ │ ││D│ ║ │ ││G││A│ ║ │ ││D│ ║ │ ││G││A│ │
│ │ ││♯│ ║ │ ││♯││♯│ ║ │ ││♯│ ║ │ ││♯││♯│ │
│ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ ║ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ │
│  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  │
│C ║D ║  ║F ║G ║  ║  ║C ║D ║  ║F ║G ║  ║  │
└──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──┘

How cool is that, huh?

G minor scale #

key_note = Note('G')
scale_type = 'natural_minor'

df, lst = build_triads_df(key_note, scale_type, 'm°MmmMM')
df
  scale_note triad_1st triad_2nd triad_3rd
0          G         G        Bb         D
1          A         A         C        Eb
2         Bb        Bb         D         F
3          C         C        Eb         G
4          D         D         F         A
5         Eb        Eb         G        Bb
6          F         F         A         C
┌─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─╥─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─┐
│ │ ││ │ ║ │ ││ ││ │ ║ │ ││ │ ║ │ ││ ││ │ │
│ │ ││D│ ║ │ ││ ││A│ ║ │ ││D│ ║ │ ││ ││A│ │
│ │ ││♯│ ║ │ ││ ││♯│ ║ │ ││♯│ ║ │ ││ ││♯│ │
│ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ ║ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ │
│  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  │
│C ║D ║  ║F ║G ║A ║  ║C ║D ║  ║F ║G ║A ║  │
└──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──┘

Questions #

The book Hack Music Theory, Part 1 has helped me tremendously and I would highly recommend it. It is easy to follow. Here I have answered the questions.

Scales #

Q1. The enharmonic of D# is: [OK] A: Eb

Q2. The enharmonic of Gb is: [OK] A: F#

Q3. Write one octave of the E major scale: [OK] Formula: 2212221 (based on C) A: E F# G# A B C# D# E

Q4. Write one octave of the Db major scale: [OK] Formula: 2212221 (based on C) A: Db Eb F Gb Ab Bb C Db

Q5. Write one octave of the G natural minor scale: [OK] Formula: 2122122 (based on A, or 9 semi-tones from C) A: G A Bb C D Eb F G

Q6. Write one octave of the F# natural minor scale: [OK] Formula: 2122122 (based on A, or 9 semi-tones from C) A: F# G# A B C# D E F#

Q7. What is Bb major’s relative minor scale? [FAIL] Explanation: Add 9 semi-tones (or the equivalent of 5 tones from C) A: G minor

Explanation: counted poorly

Q8. What is E natural minor’s relative major scale? [OK] Explanation: Subtract 9 semi-tones (or the equivalent of 5 tones from C) A: G major

Q9. Which scale has the following scale spelling: 1 2 3 4 5 6 7 8? [FAIL] A: Major scale

Explanation: I thought it was C, but it is the major scale.

Q10. Write the scale spelling of the natural minor scale: [FAIL] A: 1 2 b3 4 b5 b6 7

Explanation: It is the difference between the intervals of the major and minor, example:

Formula
1 2 3 4 5 6 7
2212221 C D E F G A B
2122122 C D Eb F G Ab Bb
1 2 b3 4 5 b6 7

Chords #

Q1. Write the notes of the Eb major triad: [OK] A: Eb G Bb

Q2. Write the notes of the B major triad: [OK] A: B D# F#

Q3. Write the notes of the B minor triad: [OK] A: B D F#

Q4. Write the notes of the F minor triad: [FAIL] A: F Ab C

Reason: counted poorly

Q5. Name the following triad: Gb Bb Db [OK] A: Gb major

Q6. Name the following triad: E G B [OK] A: E minor

Q7. What is the interval between the root note and the note C in the Ab maj triad? [FAIL] A: 4 (major 3rd)

Q8. What is the interval between the root note and the note D in the G# dim triad? [FAIL] A: 6 (dim 5th)

Q9. Using chord symbols, write the triads that are built from each degree of the F major scale: [OK] A: F-maj G-min A-min Bb-maj C-maj D-min E-dim

Major fm 2 2 1 2 2 2 1
Deg fm M m m M M m d
F Major scale F G A Bb C D E
Triad 2nd A Bb C D E F G
Triad 3rd C D E F G A Bb

Q10. Using chord symbols, write the triads that are built from each degree of the E natural minor scale: [OK] A: E-min F#-dim G-maj A-min B-min C-maj D-maj

2 1 2 2 1 2 2
m d M n n M M
E F# G A B C D

Intervals #

1 b 2 b 3 4 b 5 b 6 b 7 8 Blocks S Name Not. Repr Example Character
1 1 0 Perfect Unison P1 / d2 1-1 C-C Perfect consonance
1 b2 2 1 Minor 2nd m2 / A1 1-b2 C-Db Extreme dissonance
1 2 3 2 Major 2nd M2 / d3 1-2 C-D Moderately dissonant
1 b3 4 3 Minor 3rd m3 / A2 1-b3 C-D-Eb Dark consonance
1 3 5 4 Major 3rd M3 / d4 1-3 C-D-E Consonant and bright
1 4 6 5 Perfect 4th P4 / A3 1-4 C-D-E-F Consonant but unstable
1 b5 7 6 Diminished 5th (tritone) d5 / A4 1-b5 C-D-E-Gb/F# Extreme dissonance
1 5 8 7 Perfect 5th P5 / d6 1-5 C-D-E-F-G Highly consonant
1 b6 9 8 Minor 6th m6 / A5 1-b6 C-D-E-F-G-Ab Consonant
1 6 10 9 Major 6th M6 / d7 1-6 C-D-E-F-G-A Consonant
1 b7 11 10 Minor 7th m7 / A6 1-b7 C-D-E-F-G-A-Bb Dissonant
1 7 12 11 Major 7th M7 / d8 1-7 C-D-E-F-G-A-B Dissonant
1 8 13 12 Perfect 8th P8 / A7 1-8 C-D-E-F-G-A-B-C Extreme consonant

In order to get the number you need to count from the first note up until the second note. For example: From C to A it is a 6th, because, C(1), D(2),E(3), F(4), G(5), A(6)

  • 2nds, 3rds, 6ths may be major or minor
  • 4ths and 5ths may be perfect, diminished or augmented
  • 7ths may be diminished, minor and major

Ancient Jewish/Hebrew scales #

Ahava Raba mode: E F G# A B C D E misharamash mode: D E F G# A B C D

Tunning: D E F G# A B C D E

https://www.youtube.com/watch?v=0_X3z4p95wg

he traditional klezmer ‘Ahava Raba’ mode is indeed identical to the Maqam Hijaz…even more circumstantial evidence of the antiquity of this musical mode throughout the Middle East?

The really fascinating thing, is that if a 10 string lyre is tuned to this mode, starting on the 2nd string, (equivalent intervals as EFG#ABCDE) the other main traditional klezmer mode with the equivalent intervals as DEFG#ABCD, is simultaneously created by starting on the 1st string.


scales missing

C Jewish (Adonai Malakh) intervals: 1,b2,2,b3,4,5,6,b7 half-steps: 1-1-1-2-2-2-1-2 notes: C,Db,D,Eb,F,G,A,Bb

C Jewish (Ahaba Rabba) intervals: 1,b2,3,4,5,b6,b7 half-steps: 1-3-1-2-1-2-2 notes: C,Db,E,F,G,Ab,Bb

could be called something else though!


Adonai Malakh - Two versions in 8 Not Scales

Jewish Ahaba Rabba - look for Mixolydian b9 b13

Modes #

https://www.youtube.com/watch?v=DFFqVFNVcYM https://www.youtube.com/watch?v=c3RjlkENz6M

Modes on C

Name Degree
Lydian IV 1# F#
Ionian Natural major I 0
Mixolydian V 1b Bb
Dorian II 2b Eb, Eb
Aeolian Natural minor VI 3b Bb, Eb, Ab
Phrygian III 4b Bb, Eb, Ab, Db
Locrian VII 5b Eb, Eb, Ab, Db, Gb

Poly-rhythms and Euclidean rhythms #

https://www.youtube.com/watch?v=6oVuOT4sSiw https://www.youtube.com/watch?v=bKazVnHh2w4

Coltrane #

C Major scale #

D Major scale #

┌─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─╥─┬─┬┬─┬─╥─┬─┬┬─┬┬─┬─┐
│ │ ││ │ ║ │ ││ ││ │ ║ │ ││ │ ║ │ ││ ││ │ │
│ │C││ │ ║ │F││ ││ │ ║ │C││ │ ║ │F││ ││ │ │
│ │♯││ │ ║ │♯││ ││ │ ║ │♯││ │ ║ │♯││ ││ │ │
│ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ ║ ┕╥┙┕╥┙ ║ ┕╥┙┕╥┙┕╥┙ │
│  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  ║  │
│  ║D ║E ║  ║G ║A ║B ║  ║D ║E ║  ║G ║A ║B │
└──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──╨──┘
This is a coltrane\\ test 1\\ test 2 block

Music theory websites #

Music Theory Cheat Sheet: Keys, Scales, Chords, Notes & Intervals #

Musescore: online music courses | Learn how to play, read and compose music with the world’s largest sheet music catalog #

  • Source: https://musescore.com/courses
  • Title: Musescore: online music courses | Learn how to play, read and compose music with the world’s largest sheet music catalog
  • Captured on: [2024-02-26 Mon]

Harmonagon™ #

https://www.youtube.com/playlist?list=PLFKcevgRavAcrEcYSYv7Y-BEY5pyOH_Rf

Ear training #

Intervals: Ear Training (MP3s) - Piano-ology #

Music theory in the terminal or libraries #

GitHub - gciruelos/musthe: Music theory implemented in Python. Notes, intervals, scales and chords. python #

  • Source: https://github.com/gciruelos/musthe
  • Title: GitHub - gciruelos/musthe: Music theory implemented in Python. Notes, intervals, scales and chords.
  • Captured on: [2024-02-25 Sun]

GitHub - synestematic/kord: a music theory development framework in python python #

https://github.com/yuma-m/pychord #

GitHub - pedrozath/coltrane: 🎹🎸A music theory library with a command-line interface ruby #

GitHub - Rainbow-Dreamer/musicpy: Musicpy is a music programming language in Python designed to write music in very handy syntax through music theory and algorithms. composition #

  • Source: https://github.com/Rainbow-Dreamer/musicpy
  • Title: GitHub - Rainbow-Dreamer/musicpy: Musicpy is a music programming language in Python designed to write music in very handy syntax through music theory and algorithms.
  • Captured on: [2024-02-25 Sun]

Music analysis #

Tabs that show the theory behind songs - Hooktheory #

Example 1: #

https://vm.tiktok.com/ZMMFdBrmN/

D minor scale

2122122 - 25

1 D 2 E 3 F 4 G 5 A 6 Bb 7 C 8 D

i(Dm) - VI(Bb) - VII© - i(Dm) i(Dm) - III(F) - VII© - i(Dm)

Making music diagrams (fretboard, piano, etc) #

Fretboard Diagram Creator #

Music theory visualization systems #

Keyboard #

Guitar #

Music theory software to practice #

PianoBooster #

PolyMeilex/Neothesia: Flashy Synthesia Like Software For Linux,Windows and MacOs #

Music production software on linux #

  • Reaper
  • Ardour
  • Musescore
  • Q tractor
  • LLMS
  • Rosegarden
  • Lilypond
  • Frescobaldy
  • Denemo
  • Audacity
  • Hydrogen (drum machine)
  • Guitarix
  • Tux Guitar

DAW Comparison for Linux (LMMS, Qtractor, Ardour) - YouTube #

5 free and open music-making tools | Opensource.com #

“Aaron Wolf | Music Lessons in Portland & Oregon City: Guitar, Music Science, and more #

Music app websites #

BeatScratch: funk at your fingertips #

Plugins #

Linux Audio Plugin Options - YouTube #

BBC SO #

Howto Reaper + BBC SO https://linuxmusicians.com/viewtopic.php?t=22480 https://www.reddit.com/r/linuxaudio/comments/vj9gmw/how_to_run_spitfire_labs_on_linux/

More plugins #

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

Devices #

Audio is Coming To Linux! - YouTube #

Scale degrees #

Names and symbols used in harmonic analysis to denote tones of the scale as roots of chords. The most important are degrees I = tonic (T), IV = subdominant (S) and V = dominant (D).

\relative c' {
  {
    c1 d e f g a b c
  }
  \lyrics { I II III IV V VI VII I }
  \lyrics { T "" ""  S  D }
}

Diatonic scales #

A scale consisting of 5 whole tones and 2 semitones (S). Scales played on the white keys of a piano keyboard are diatonic.

\relative c' {
  {
    c1 d
    e^"~~ S" f g a b^"~~ S" c
  }
  \lyrics {
    Ionian
  }
}
\relative c' {
  {
    d1
    e^"~~ S" f g a b^"~~ S" c d
  }
  \lyrics {
    Dorian
  }
}
\relative c' {
  {
    e1^"~~ S" f g a b^"~~ S" c d e
  }
  \lyrics {
    Phrygian
  }
}
\relative c' {
  {
    f1 g a
    b^"~~ S" c d e^"~~ S" f
  }
  \lyrics {
    Lydian
  }
}
\relative g' {
  {
    g1 a
    b^"~~ S" c d e^"~~ S" f g
  }
  \lyrics {
    Mixolydian
  }
}
\relative a' {
  {
    a1
    b^"~~ S" c d e^"~~ S" f g a
  }
  \lyrics {
    Aeolian
  }
}
\relative g' {
  {
    b1^"~~ S" c d e^"~~ S" f g a b
  }
  \lyrics {
    Locrian
  }
}

Things to organize #

\header{ tagline="" }
\relative c' {
  f e d c
  b a g a
  b c d e
  f g f e
  d c b a
  g1
}