Swiftpack.co - AudioKit/Tonic as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AudioKit.
AudioKit/Tonic 1.2.3
Swift library for music theory
⭐️ 129
🕓 5 days ago
.package(url: "https://github.com/AudioKit/Tonic.git", from: "1.2.3")



Swift library for music theory, currently focused on chords/harmony.

Tonic answers musical questions, such as:

  • What's the note for this pitch in this key?

    Note(pitch: Pitch(midiNoteNumber), key: .Bb)

  • What's the name of a chord?

    Chord(notes: notes).description

  • What chords are in this key?


  • What chords in this key contain this note?

    Key.C.chords.filter { $0.noteClasses.contains(.C) }

  • What notes do these keys have in common?


  • What notes don't these keys have in common?


These questions are all tested in our unit tests explicitly.


  • Correctness. Try to be as correct with respect to music theory as possible.
  • Strong typing. Use types to prevent errors (e.g. Pitch instead of UInt8).
  • Good performance. Tonic uses bit sets to represent pitch sets and note sets.


The documentation is host on the AudioKit.io Website. The package includes a demo project as well.


Install using Swift Package Manager.


Stars: 129
Last commit: Yesterday
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Release Notes

New Suspended 2 and 4 chords
4 weeks ago

We're bumping up to 1.1 since "suspended" chords are now "suspendedFourthTriaad" and "SuspendedSecondTriad" chords.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics