Latest 1.1.1
Homepage https://github.com/danielbreves/MusicTheory
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Authors

A music theory library for Swift OS X and iOS apps.

MusicTheory provides objects to work with musical keys, notes, scales and chords. It can be used to generate a scale from a key or note symbol, or a chord from a key and a chord degree for example. You can also use it to translate a sequence of notes to a sequence of MIDI values.

Installation

CocoaPods

Put this in your Podfile:

pod "MusicTheory", "~> 1.1"

Usage:

let cFlat = Note(name: "C♭")

let cFlatMinorScale = cFlat.scale("minor")

cFlatMinorScale.names // ["C♭", "D♭", "E♭♭", "F♭", "G♭", "A♭♭", "B♭♭"]
cFlatMinorScale.values // [59, 61, 62, 64, 66, 67, 69]

let cFlatMinChord = Chord(root: cFlat, type: "min") // or cFlat.chord("min")

cFlatMinChord.names // ["C♭", "E♭♭", "G♭"]
cFlatMinChord.values // [59, 62, 66]

let cFlatMajor = Key(note: cFlat, quality: "major")
let cFlatV7 = cFlatMajor.chord("V", type: "7")!

cFlatV7.name // "G♭7"
cFlatV7.notes.map { $0.name } // ["G♭", "B♭", "D♭", "F♭"]

For a list of all supported chord types see: Sources/Music.swift

For more usage examples see: Tests/MusicTheoryTests.swift

Contributing

Improvements are always welcome. Please follow these steps to contribute:

  1. Submit a Pull Request with a detailed explanation of changes and tests
  2. Receive a :+1: from a core team member
  3. Core team will merge your changes

License

See LICENSE.

Latest podspec

{
    "name": "MusicTheory",
    "version": "1.1.1",
    "summary": "A music theory library for Swift OS X and iOS apps",
    "description": "MusicTheory provides objects to work with musical keys, notes, scales and chords. It can be used to generate a scale from a key or note symbol, or a chord from a key and a chord degree for example. You can also use it to translate a sequence of notes to a sequence of MIDI values.",
    "homepage": "https://github.com/danielbreves/MusicTheory",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Daniel Breves": "[email protected]"
    },
    "social_media_url": "http://twitter.com/danielbreves",
    "source": {
        "git": "https://github.com/danielbreves/MusicTheory.git",
        "tag": "v1.1.1"
    },
    "source_files": "Sources/**/*.swift",
    "module_name": "MusicTheory",
    "swift_version": "4.0",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    }
}

Pin It on Pinterest

Share This