Skip to content

Commit

Permalink
heptads
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Guo committed May 18, 2015
1 parent 640ad7f commit 4eb6fb1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Examples/ChaosHarmonizer/ChaosHarmonizer/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ class ViewController: NSViewController {
if let first = messages.first {
if first.on {
let possibleChords = [
ChordQuality.Major,
ChordQuality.Sus2,
ChordQuality.Sus4,
ChordQuality.Minor,
]
// ChordQuality.Major,
// ChordQuality.Minor,
// ChordQuality.Sus2,
// ChordQuality.Sus4,
// ChordQuality.DominantSeventh,
// ChordQuality.DominantEleventhFlatNineFlatThirteen,
// ChordQuality.DominantEleventhFlatNineFlatThirteen,
// ChordQuality.DominantNinthSharpElevenFlatThirteen,
// ChordQuality.DominantThirteenthSharpEleven,
] + ChordQuality.Heptads
let index = arc4random_uniform(UInt32(possibleChords.count))
let quality = possibleChords[Int(index)]
let intervals = quality.intervals
let indices = MKUtil.semitoneIndices(intervals)
let transposition = indices[indices.count - 1]*(-2)
let transposition = indices[indices.count - 1]*(-1)
let harmonizer = Harmony.transpose(Harmony.create(intervals), semitones: transposition)
let pitch = Pitch(midi: Float(first.noteNumber))
var pitchSet = harmonizer(pitch)
Expand Down

0 comments on commit 4eb6fb1

Please sign in to comment.