Latest 0.0.2
License MIT
Platforms ios 8.0, requires ARC

Ellis – Swift music library

Join the chat at

Pod Version
Carthage compatible

Ellis is named after Jazz Guitarrist Herb Ellis


Ellis is currently used on LetsComp


These examples are taken from a playground in the project


Example Output Comment
Note.A.Name "A"
Note.A.frequency() 440 Frequency defaults to OneLine Octave
Note.A.frequency(Octave.TwoLine) 880 If required can pass octave for frequency
Note.A.flat() AFlat ASharp
Note.A == Note.A true
Note.A == Note.C false


Example Output
Note.A.intervalWithNote(Note.ASharp) MinorSecond
Note.A.intervalWithNote(Note.B) MajorSecond
Note.A.transpose(Interval.MinorSecond) ASharp
Note.A.transpose(Interval.MajorSecond) B
Note.A.measureAbsoluteSemitones(Note.C) 3
Interval.createIntervalFromDistance(1) MinorSecond


Example Output
Key.CMajor CMajor
Key.CMajor.keyNotes [C, D, E, F, G, A, B]
Key.CMajor.KeyNoteNames ["C", "D", "E", "F", "G", "A", "B"]
Key.CMajor.quality Major
Key.AMinor.quality Minor
Key.CMajor.rootName "C"
Key.CMajor.degreeForNote(Note.A) 6
Key.CMajor.degreeForNote(Note.ASharp) Thows exception
Key.CMajor.relativeKey AMinor
Key.CMajor.i() C


Building chords

let cmaj = ChordBuilder(root: Note.C)
Example Output "CMaj"
cmaj.noteNames ["C", "E", "G"]
let cmaj7 = ChordBuilder(root: Note.C, chordFunction: ChordFunction.Major7)
Example Output "CMaj7"
cmaj7.noteNames ["C", "E", "G", "B"]
cmaj7.functions [Root, Third, Fifth, Seventh]
cmaj7.noteFunctionNames ["R", "3", "5", "7"]
cmaj7.ChordNotes [{C, Root}, {E, Third}, {G, Fifth}, {B, Seventh}]
cmaj7.Inversion Root
cmaj7.bass C
cmaj7.lead B
cmaj7.Shape Closed
cmaj7.noteByFunction(NoteFunction.Fifth) G
cmaj7 == cmaj7 true
cmaj == cmaj7 false

Transposing chords

let gmaj7 = cmaj7.transpose(Note.G)
Example Output "GMaj7"
gmaj7.notes [G, B, D, FSharp]

Inverting chords

let firstInversion = cmaj7.invert()
Example Output
firstInversion.notes [E, G, B, C]
firstInversion.Inversion First
let secondInversion = firstInversion.invert()
Example Output
secondInversion.notes [G, B, C, E]
secondInversion.Inversion Second
let thirdInversion = secondInversion.invert()
Example Output
thirdInversion.notes [B, C, E, G]
thirdInversion.Inversion Third

Drop2 chords

let drop2 = cmaj7.toDrop2()
Example Output
drop2.notes [C, G, B, E]

Drop3 chords

let drop3 = cmaj7.toDrop3()
Example Output
drop3.notes [C, B, E, G]

Voice leading chords

let inversionWithFunctionInLead = cmaj7.voiceForLead(NoteFunction.Third)
Example Output
inversionWithFunctionInLead.notes [G, B, C, E]
inversionWithFunctionInLead.Inversion Second
let inversionWithFunctionInBass = cmaj7.voiceForBass(NoteFunction.Third)
Example Output
inversionWithFunctionInBass.notes [E, G, B, C]
inversionWithFunctionInBass.Inversion First
let invertionWithLeadClosestToNote = cmaj7.invertionWithLeadClosestToNote(Note.F)
Example Output
invertionWithLeadClosestToNote.notes [G, B, C, E]
invertionWithLeadClosestToNote.Inversion Second
let invertionWithLeadClosestToNote1 = cmaj7.invertionWithLeadClosestToNote(Note.GSharp)
Example Output
invertionWithLeadClosestToNote1.notes [B, C, E, G]
invertionWithLeadClosestToNote1.Inversion Third

Key Harmonizers

Triad harmonizer

let triadHarmonizer = TriadsKeyHarmonizer(key: Key.CMajor)
Example Output
triadHarmonizer.i().name "CMaj"
triadHarmonizer.ii().name "DMin"
triadHarmonizer.iii().name "EMin"
triadHarmonizer.iv().name "FMaj"
triadHarmonizer.v().name "GMaj" "AMin"
triadHarmonizer.vii().name "BDim"

Seventh harmonizer

let seventhsHarmonizer = SeventhsKeyHarmonizer(key: Key.CMajor)
Example Output
seventhsHarmonizer.i().name "CMaj7"
seventhsHarmonizer.ii().name "DMin7"
seventhsHarmonizer.iii().name "EMin7"
seventhsHarmonizer.iv().name "FMaj7"
seventhsHarmonizer.v().name "GDom7" "AMin7"
seventhsHarmonizer.vii().name "Bmin7b5"

Minor harmonizer

Scale is a melodic minor but when harmonizing its treated as a harmonic minor.

let seventhsHarmonizerMinor = SeventhsKeyHarmonizer(key: Key.AMinor)
Example Output
seventhsHarmonizerMinor.i().name "AMinMaj7"
seventhsHarmonizerMinor.ii().name "BMin7b5"
seventhsHarmonizerMinor.iii().name "CAug7"
seventhsHarmonizerMinor.iv().name "DMin7"
seventhsHarmonizerMinor.v().name "EDom7" "FMaj7"
seventhsHarmonizerMinor.vii().name "G#Dim7"

Latest podspec

    "name": "Ellis",
    "version": "0.0.2",
    "summary": "Swift music library",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": ""
    "authors": {
        "Pedro Santos": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "0.0.2"
    "source_files": "Ellis/*.{h,swift}",
    "requires_arc": true

Pin It on Pinterest

Share This