Skip to content

A swift package that provides an easy-to-use API for music related developments.

License

Notifications You must be signed in to change notification settings

sh3l6orrr/swift-music

Repository files navigation

🎼 swift-music

CI Chords DocMusicTheory

Introduction

swift-music is a swift package that provides an easy-to-use API for music related developments.

Currently available module:

  • MusicTheory: Notes, chords, scales.

MusicTheory

import MusicTheory

Interval Arithmetic

Note.D - Note.E  // Interval.m7

Create a Chord

// Create with notes contained.
let Esus4 = Chord(.E, notes: [.E, .A, .B]) 

// Create with root and quality.
let Abm = Chord(.A_flat, .minorTriad)

Get triad in a scale

Scale(.B, .major).triad(degree: 6) // G#m

Other API

  • Consonance and dissonance of interval, notes, or chord
  • Checking if a note in a chord
  • Create chord with both sharps and flats
  • Support for 20+ chord qualities
  • Support for both major and minor mode

Installation

Xcode Project

File - Add Packages - https://github.com/sh3l6orrr/swift-music.git

Swift Package Manager

Inside Package.swift, add the followings:

dependencies: [
    .package(url: "https://github.com/sh3l6orrr/swift-music.git", .upToNextMajor(from: "1.0.0"))
]
targets: [
    .target(
        name: "YourTarget",
        dependencies: [.product(name: "MusicTheory", package: "swift-music")]
    )
]

Documentation

Click on the badge in the front of this README, or build in Xcode:

Product - Build Documentation

About

A swift package that provides an easy-to-use API for music related developments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages