Introduction

The purpose of this notebook is to display notes used in various music scales.

See also

Packages that work with chords:

  • R package chorrrds provides “tools to use in combination with the music chords” such as the “deg_maj and deg_min data frames, that contains all of the minor and major main scales and its respective degrees”. I did not try it.

  • R package pichor displays piano chords and chord inversions. I did not try it.

Setup

Create a data frame that contains the twelve notes of the chromatic scale used later in the analysis.

notes <- tribble(
    ~it,   ~en, 
    "do",  "C",
    "do#", "C#" ,
    "re",  "D",
    "mib", "Eb",
    "mi",  "E",
    "fa",  "F",
    "fa#", "F#",
    "sol", "G",
    "sol#","G#",
    "la",  "A",
    "sib", "Bb",
    "si",  "B",
)
notes$n = as.integer(rownames(notes))

# Duplicate the notes so that increments of scale number below don't fall out of the range.
notes2 <- rbind(notes, notes)

# A function to generate the line of a markdown table separated by pipes "|"
display <- function(x){cat("", x, "\n", sep="|")}

# The scale corresponding to the white notes of the piano
major_heptatonic <- c(0, 2, 4, 5, 7, 9, 11)
notes[major_heptatonic + 1,]
## # A tibble: 7 × 3
##   it    en        n
##   <chr> <chr> <int>
## 1 do    C         1
## 2 re    D         3
## 3 mi    E         5
## 4 fa    F         6
## 5 sol   G         8
## 6 la    A        10
## 7 si    B        12
# A function to display a table with the given scale shifted to all the note of
# the major heptatonic scale
display_scale <- function(input_scale){
    display(input_scale)
    display(rep("---", length(input_scale)))
    for (i in major_heptatonic + 1){
        display(notes2$it[input_scale + i])
    }

    for (i in major_heptatonic + 1){
        display(notes2$en[input_scale + i])
    }
}

Heptatonic scale

Heptatonic scale

“A heptatonic scale is a musical scale that has seven pitches (a.k.a. tones) per octave.”

Heptatonic major scale

display_scale(major_heptatonic)
0 2 4 5 7 9 11
do re mi fa sol la si
re mi fa# sol la si do#
mi fa# sol# la si do# mib
fa sol la sib do re mi
sol la si do re mi fa#
la si do# re mi fa# sol#
si do# mib mi fa# sol# sib
C D E F G A B
D E F# G A B C#
E F# G# A B C# Eb
F G A Bb C D E
G A B C D E F#
A B C# D E F# G#
B C# Eb E F# G# Bb

The Bb or Sib scale

notes2$it[major_heptatonic+11]
## [1] "sib" "do"  "re"  "mib" "fa"  "sol" "la"

Heptatonic minor scale

display_scale(c(0, 2, 3, 5, 7, 8, 10))
0 2 3 5 7 8 10
do re mib fa sol sol# sib
re mi fa sol la sib do
mi fa# sol la si do re
fa sol sol# sib do do# mib
sol la sib do re mib fa
la si do re mi fa sol
si do# re mi fa# sol la
C D Eb F G G# Bb
D E F G A Bb C
E F# G A B C D
F G G# Bb C C# Eb
G A Bb C D Eb F
A B C D E F G
B C# D E F# G A

Note how the notes of the C major scale are the same as the notes of the A minor scale. The notes of the F major scale are the same as the notes of the D minor scale. This is explained in minor scale and the correspondance between minor and major scales is visible on the circle of fifths.

Chords in the scale of

For each scale, show the major, minor and 7 chords that are in that scale.

major <- c(0, 4, 7)
minor <- c(0, 3, 7)
major7 <- c(0, 4, 7, 10)
notes2$it[major + 1]

[1] “do” “mi” “sol”

notes2$it[minor + 1]

[1] “do” “mib” “sol”

major_chords <- notes
major_chords$m4 = slice(notes2,(4+1):(4+12))
major_chords$m7 = slice(notes2,(7+1):(7+12))
minor_chords <- notes
minor_chords$m3 = slice(notes2,(3+1):(3+12))
minor_chords$m7 = slice(notes2,(7+1):(7+12))
major7_chords <- notes
major7_chords$m4 = slice(notes2,(4+1):(4+12))
major7_chords$m7 = slice(notes2,(7+1):(7+12))
major7_chords$m10 = slice(notes2,(10+1):(10+12))


for (i in 1:nrow(notes)){
    cat(sprintf("\nThe %s scale: ", notes2$en[major_heptatonic + i][1]))
    cat(notes2$it[major_heptatonic + i])
    major_match = c()
    minor_match = c()
    major7_match = c()
    for (j in 1:nrow(notes)){
        if (length(setdiff(notes2$n[major + j], notes2$n[major_heptatonic + i])) == 0L){
            major_match = c(major_match, j)
        }
        if (length(setdiff(notes2$n[minor + j], notes2$n[major_heptatonic + i])) == 0L){
            minor_match = c(minor_match, j)
        }
        if (length(setdiff(notes2$n[major7 + j], notes2$n[major_heptatonic + i])) == 0L){
            major7_match = c(major7_match, j)
        }
    }
    cat(" contains the major chords ")
    major_slice <- slice(major_chords, major_match)
    cat(major_slice$it)
    cat(", the minor chords ")
    minor_slice <- slice(minor_chords,minor_match)
    cat(paste0(minor_slice$it, "(m)"))
    cat(" and the major7 chord ")
    major7_slice = slice(major7_chords,major7_match)
    cat(paste0(major7_slice$it, "7"))
    chords <- unnest(major_slice, cols=c(m4,m7), names_repair="universal") %>%
        bind_rows(unnest(minor_slice, cols=c(m3,m7), names_repair="universal")) %>%
        bind_rows(unnest(major7_slice, cols=c(m4,m7,m10), names_repair="universal"))
    names(chords) <- paste0(rep(c("it", "en","n"),4),rep(1:4,each=3))
    options(knitr.kable.NA = '')
    chords %>% knitr::kable() %>% print()
}

The C scale: do re mi fa sol la si contains the major chords do fa sol, the minor chords re(m) mi(m) la(m) and the major7 chord sol7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
do C 1 mi E 5 sol G 8
fa F 6 la A 10 do C 1
sol G 8 si B 12 re D 3
re D 3 fa F 6 la A 10
mi E 5 sol G 8 si B 12
la A 10 do C 1 mi E 5
sol G 8 si B 12 re D 3 fa F 6

The C# scale: do# mib fa fa# sol# sib do contains the major chords do# fa# sol#, the minor chords mib(m) fa(m) sib(m) and the major7 chord sol#7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
do# C# 2 fa F 6 sol# G# 9
fa# F# 7 sib Bb 11 do# C# 2
sol# G# 9 do C 1 mib Eb 4
mib Eb 4 fa# F# 7 sib Bb 11
fa F 6 sol# G# 9 do C 1
sib Bb 11 do# C# 2 fa F 6
sol# G# 9 do C 1 mib Eb 4 fa# F# 7

The D scale: re mi fa# sol la si do# contains the major chords re sol la, the minor chords mi(m) fa#(m) si(m) and the major7 chord la7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
re D 3 fa# F# 7 la A 10
sol G 8 si B 12 re D 3
la A 10 do# C# 2 mi E 5
mi E 5 sol G 8 si B 12
fa# F# 7 la A 10 do# C# 2
si B 12 re D 3 fa# F# 7
la A 10 do# C# 2 mi E 5 sol G 8

The Eb scale: mib fa sol sol# sib do re contains the major chords mib sol# sib, the minor chords do(m) fa(m) sol(m) and the major7 chord sib7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
mib Eb 4 sol G 8 sib Bb 11
sol# G# 9 do C 1 mib Eb 4
sib Bb 11 re D 3 fa F 6
do C 1 mib Eb 4 sol G 8
fa F 6 sol# G# 9 do C 1
sol G 8 sib Bb 11 re D 3
sib Bb 11 re D 3 fa F 6 sol# G# 9

The E scale: mi fa# sol# la si do# mib contains the major chords mi la si, the minor chords do#(m) fa#(m) sol#(m) and the major7 chord si7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
mi E 5 sol# G# 9 si B 12
la A 10 do# C# 2 mi E 5
si B 12 mib Eb 4 fa# F# 7
do# C# 2 mi E 5 sol# G# 9
fa# F# 7 la A 10 do# C# 2
sol# G# 9 si B 12 mib Eb 4
si B 12 mib Eb 4 fa# F# 7 la A 10

The F scale: fa sol la sib do re mi contains the major chords do fa sib, the minor chords re(m) sol(m) la(m) and the major7 chord do7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
do C 1 mi E 5 sol G 8
fa F 6 la A 10 do C 1
sib Bb 11 re D 3 fa F 6
re D 3 fa F 6 la A 10
sol G 8 sib Bb 11 re D 3
la A 10 do C 1 mi E 5
do C 1 mi E 5 sol G 8 sib Bb 11

The F# scale: fa# sol# sib si do# mib fa contains the major chords do# fa# si, the minor chords mib(m) sol#(m) sib(m) and the major7 chord do#7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
do# C# 2 fa F 6 sol# G# 9
fa# F# 7 sib Bb 11 do# C# 2
si B 12 mib Eb 4 fa# F# 7
mib Eb 4 fa# F# 7 sib Bb 11
sol# G# 9 si B 12 mib Eb 4
sib Bb 11 do# C# 2 fa F 6
do# C# 2 fa F 6 sol# G# 9 si B 12

The G scale: sol la si do re mi fa# contains the major chords do re sol, the minor chords mi(m) la(m) si(m) and the major7 chord re7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
do C 1 mi E 5 sol G 8
re D 3 fa# F# 7 la A 10
sol G 8 si B 12 re D 3
mi E 5 sol G 8 si B 12
la A 10 do C 1 mi E 5
si B 12 re D 3 fa# F# 7
re D 3 fa# F# 7 la A 10 do C 1

The G# scale: sol# sib do do# mib fa sol contains the major chords do# mib sol#, the minor chords do(m) fa(m) sib(m) and the major7 chord mib7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
do# C# 2 fa F 6 sol# G# 9
mib Eb 4 sol G 8 sib Bb 11
sol# G# 9 do C 1 mib Eb 4
do C 1 mib Eb 4 sol G 8
fa F 6 sol# G# 9 do C 1
sib Bb 11 do# C# 2 fa F 6
mib Eb 4 sol G 8 sib Bb 11 do# C# 2

The A scale: la si do# re mi fa# sol# contains the major chords re mi la, the minor chords do#(m) fa#(m) si(m) and the major7 chord mi7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
re D 3 fa# F# 7 la A 10
mi E 5 sol# G# 9 si B 12
la A 10 do# C# 2 mi E 5
do# C# 2 mi E 5 sol# G# 9
fa# F# 7 la A 10 do# C# 2
si B 12 re D 3 fa# F# 7
mi E 5 sol# G# 9 si B 12 re D 3

The Bb scale: sib do re mib fa sol la contains the major chords mib fa sib, the minor chords do(m) re(m) sol(m) and the major7 chord fa7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
mib Eb 4 sol G 8 sib Bb 11
fa F 6 la A 10 do C 1
sib Bb 11 re D 3 fa F 6
do C 1 mib Eb 4 sol G 8
re D 3 fa F 6 la A 10
sol G 8 sib Bb 11 re D 3
fa F 6 la A 10 do C 1 mib Eb 4

The B scale: si do# mib mi fa# sol# sib contains the major chords mi fa# si, the minor chords do#(m) mib(m) sol#(m) and the major7 chord fa#7

it1 en1 n1 it2 en2 n2 it3 en3 n3 it4 en4 n4
mi E 5 sol# G# 9 si B 12
fa# F# 7 sib Bb 11 do# C# 2
si B 12 mib Eb 4 fa# F# 7
do# C# 2 mi E 5 sol# G# 9
mib Eb 4 fa# F# 7 sib Bb 11
sol# G# 9 si B 12 mib Eb 4
fa# F# 7 sib Bb 11 do# C# 2 mi E 5

Pentatonic scales

Major pentatonic

Major pentatonic scale

“The major pentatonic scale may be thought of as a gapped or incomplete major scale.[8] However, the pentatonic scale has a unique character and is complete in terms of tonality. One construction takes five consecutive pitches from the circle of fifths;[9] starting on C, these are C, G, D, A, and E. Transposing the pitches to fit into one octave rearranges the pitches into the major pentatonic scale: C, D, E, G, A.”

major_pentatonic <- c(0, 2, 4, 7, 9)
display_scale(major_pentatonic)
0 2 4 7 9
do re mi sol la
re mi fa# la si
mi fa# sol# si do#
fa sol la do re
sol la si re mi
la si do# mi fa#
si do# mib fa# sol#
C D E G A
D E F# A B
E F# G# B C#
F G A C D
G A B D E
A B C# E F#
B C# Eb F# G#

Minor pentatonic

Minor pentatonic scale

” It may also be considered a gapped blues scale. The C minor pentatonic is C, E-flat, F, G, B-flat. The A minor pentatonic, the relative minor of C pentatonic, comprises the same tones as the C major pentatonic, starting on A, giving A, C, D, E, G.”

display_scale(c(0, 3, 5, 7, 10))
0 3 5 7 10
do mib fa sol sib
re fa sol la do
mi sol la si re
fa sol# sib do mib
sol sib do re fa
la do re mi sol
si re mi fa# la
C Eb F G Bb
D F G A C
E G A B D
F G# Bb C Eb
G Bb C D F
A C D E G
B D E F# A

Hexatonic scales

Blues scale Hexatonic

“The hexatonic, or six-note, blues scale consists of the minor pentatonic scale plus the b5th degree of the original heptatonic scale.”

hexatonic <- c(0, 3, 5, 6, 7, 10)
display_scale(hexatonic)
0 3 5 6 7 10
do mib fa fa# sol sib
re fa sol sol# la do
mi sol la sib si re
fa sol# sib si do mib
sol sib do do# re fa
la do re mib mi sol
si re mi fa fa# la
C Eb F F# G Bb
D F G G# A C
E G A Bb B D
F G# Bb B C Eb
G Bb C C# D F
A C D Eb E G
B D E F F# A