Skip to content

Instantly share code, notes, and snippets.

@njtierney
Created September 21, 2020 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njtierney/6156e4d8356803c721498d8808453e71 to your computer and use it in GitHub Desktop.
Save njtierney/6156e4d8356803c721498d8808453e71 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(knitr)

chord_table <- tribble(
  ~number, ~flavour, ~intervals,
  1,       "Major 7",    "1 3 5 7",
  2,       "Minor 7",    "1 b3 5 b7",
  3,       "Minor 7",    "1 b3 5 b7",
  4,       "Major 7",    "1 3 5 7",
  5,       "Dominant 7", "1 3 5 b7",
  6,       "Minor 7",    "1 b3 5 b7",
  7,       "Half-Dim 7", "1 b3 b5 b7"
)

kable(chord_table)
number flavour intervals
1 Major 7 1 3 5 7
2 Minor 7 1 b3 5 b7
3 Minor 7 1 b3 5 b7
4 Major 7 1 3 5 7
5 Dominant 7 1 3 5 b7
6 Minor 7 1 b3 5 b7
7 Half-Dim 7 1 b3 b5 b7
distinct(chord_table, flavour, .keep_all = TRUE) %>% 
  select(flavour:intervals) %>% 
  slice(1, 3, 2, 4) %>% 
  kable()
flavour intervals
Major 7 1 3 5 7
Dominant 7 1 3 5 b7
Minor 7 1 b3 5 b7
Half-Dim 7 1 b3 b5 b7

Created on 2020-09-22 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment