Skip to content

Instantly share code, notes, and snippets.

@raym
Created June 17, 2020 04:53
Show Gist options
  • Save raym/f1e082a89c7f9830a4890d26fea5e121 to your computer and use it in GitHub Desktop.
Save raym/f1e082a89c7f9830a4890d26fea5e121 to your computer and use it in GitHub Desktop.
finding all combinations of musical things using Ramda
const chars = [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
];
//const notes = [ '', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ]
const chords = [ 'I', 'ii', 'iii', 'IV', 'V', 'vi', 'vii+']
//const combine2 = (a, b) => `${a} ${b}`;
//const combine3 = (a, b, c) => `${a} ${b} ${c}`;
const combine4 = (a, b, c, d) => `${a} ${b} ${c} ${d}`;
const cards = pipe(
lift(combine4),
map(trim),
uniq,
//length
)(...repeat(chords, 4))
cards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment