MusicKit is a framework and DSL for creating, analyzing, and transforming music in Swift.

Related tags

Audio MusicKit
Overview

MusicKit

MusicKit is a framework and DSL for creating, analyzing, and transforming music in Swift.

Examples

Functional harmony

let C5 = Pitch(midi: 72)
let neapolitan = Major.bII
print(neapolitan(C5))               // [C♯5, E♯5, G♯5]
let G4 = Chroma.G*4
let plagalCadence = [Major.IV, Major.I]
print(plagalCadence * G4)           // [[C5, E5, G5], [G4, B4, D5]]
let V7ofV = HarmonicFunction.create(Scale.Major, degree: 5, chord: Major.V7)
print(V7ofV(C5))                    // [D6, F♯6, A6, C7]

Chord recognition

let pitchSet: PitchSet = [Chroma.B*0, Chroma.Cs*2, Chroma.F*3, Chroma.G*4]
print(Chord.name(pitchSet))        // G7♭5/B
let descriptor = Chord.descriptor(pitchSet)
print(descriptor)                  // root: G, quality: 7♭5, bass: B

MIDI I/O

let midi = MIDI(name: "WholetoneClusters")
midi.noteHandler = { messages in
    if let first = messages.first {
        midi.send([first, first.transpose(2), first.transpose(3)])
    }
}

Framework Overview

Comments
  • Swift 3 Migration

    Swift 3 Migration

    ping @benzguo

    Migrated the Framework to Swift 3. Might be worth having a more in-depth look at the changes, but it now compiles without warnings and runs all tests, although I had to do a minor change to the PitchSetTest which might be worth looking at more closely.

    opened by mfk-ableton 4
  • iOS keyboard

    iOS keyboard

    • scrollable (bottom/top scrollbar)
    • stretchable (within octaves)
    • xy vibrato-able
    • force-touchable

    https://medium.com/@rknla/exploring-apple-s-3d-touch-f5980ef45af5

    opened by benzguo 3
  • Cleanup: Add unused pragmas where needed

    Cleanup: Add unused pragmas where needed

    ping @benzguo

    This doesnt build with Warnings as Errors and a higher than default setting of warnings due to unused variables. Thus we need to insert pragmas where needed.

    opened by sieren 2
  • Added temperament (just, equal, pytha)

    Added temperament (just, equal, pytha)

    Hi,

    I've added 3 temperaments that can be easily expanded to more if needed (one only needs the ratios). I decided to put the temperament as global var (similar to concertA) since it seems to me it's not something related to any other context but the global context.

    opened by valentinradu 1
  • how to play a midi with Chord ..

    how to play a midi with Chord ..

    the chaosHarmonizer example don't run everything..

    let midi = MIDI(name: "ChaosHarmonizer")
            midi.noteHandler = { messages in
                if let first = messages.first {
                    if first.on {
                        let possibleChords = [
                            ChordQuality.Major,
                            ChordQuality.Minor,
                            ChordQuality.Sus2,
                            ChordQuality.Sus4,
                        ]
    
    '''
    
    opened by laidingqing 1
  • Improve PitchClass

    Improve PitchClass

    Initing a pitch with PitchClass should be more concise.

    Also, the correct term seems to be Chroma. a pitch class is the set of all pitches with the same chroma.

    Pitch(pitchClass: .Gs, octave: 4) or even PitchClass.Gs_4

    opened by benzguo 0
  • Swift 5 ready. Migrated to SPM (without breaking the Xcode-based build system)

    Swift 5 ready. Migrated to SPM (without breaking the Xcode-based build system)

    Hey. I've updated the code to compile under Swift 5. All the tests are passing. Can you please have a look and maybe we push a new version? :) Cheers!

    opened by valentinradu 1
  • Sharps only

    Sharps only

    Hi, I've been having a look at this great resource and was wondering how we would go about making sure when you print the scale like A Major it prints --> [A4, B4, C♯5, D5, E5, F♯5, A♭5] Though A major only has sharps. So the A♭5 should be G#5. I'm looking in the Pitch.swift file and wondering would this be the place to assign the Note and Sharp type if it is a sharp key? Thanks in advance for your help. I look forward to talking with you. Regards Gerard

    opened by Ged2323 0
  • iOS example project with AudioKit

    iOS example project with AudioKit

    The flagship example project should:

    • run on iOS
    • not require a MIDI keyboard
      • keyboard on screen (use keyboard from Taptone)
    • produce sound (using AudioKit)
    opened by benzguo 0
Releases(0.2.0)
Owner
Ben Guo
vagabond of dreams
Ben Guo
A pure Swift Spotify Music App in Apple Music style

HBMusic A pure Swift Spotify Music App in Apple Music style. How to run pod inst

haoboxuxu 6 Dec 29, 2021
Classical music front-end for Apple Music: iOS app

concertino_ios Concertino is a classical music front-end for Apple Music. It's splitted in several projects. This one provides only the iOS app. (Ther

Open Opus 107 Dec 22, 2022
iOS music player app that downloads music from the internet, even YouTube

About YouTag is an iOS music player app that downloads music from the internet, even YouTube, and manages it in a local library. Music videos can also

null 263 Jan 8, 2023
🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.

Made by Applikey Solutions Find this project on Dribbble Table of Contents Purpose Features Supported OS & SDK Versions Installation Usage Demo Releas

Applikey Solutions 1.1k Dec 26, 2022
MusicScore - A music score library with MusicPart, Measure, Note, Pitch and Tempo representations in swift structs

MusicScore A music score library with MusicPart, Measure, Note, Pitch and Tempo

null 7 Sep 19, 2022
Cool Animated music indicator view written in Swift

Cool Animated music indicator view written in Swift. ESTMusicIndicator is an implementation of NAKPlaybackIndicatorView in Swift for iOS 8. 本人著作的书籍《La

Aufree 465 Nov 28, 2022
Analyser BPM in Swift for your music/sounds/records, whatever..

BPM-Analyser Analyser BPM in Swift for your music/sounds/records, whatever.. Powered with Superpowered Preview: How To: Copy theese files to your proj

Gleb Karpushkin 71 Dec 24, 2022
Music Player NBC With Swift

MusicPlayer Xcode command + shift + Y -> Debug 창 띄우기 command + R -> App 실행 command + . -> App 중지 ctrl + option + commadn + return(enter) -> Assistant

davidyoon891122 0 Nov 27, 2021
MusicTheoryKit: a swift module that provides an easy-to-use API for most commonly used music terms

MusicTheoryKit Introduction MusicTheoryKit is a Swift framework that provides an easy-to-use API for most commonly used music terms. Create notes, ass

Jin Zhang 4 Feb 8, 2022
Fully functional music player which is written in swift programming language

Music Player Source Code Fully functional Music Player Application Source code that is written in Swift 4.1, Xcode 9.3 Introduction Music Player for i

bpolat 243 Nov 9, 2022
Beautiful Music Player app built using SwiftUI to demonstrate Neumorphic design pattern and MVVM architecture.

Beautiful Music Player app built using SwiftUI to demonstrate Neumorphic design pattern ?? and MVVM architecture ?? . Made with love ❤️ by Sameer Nawaz

Sameer Nawaz 120 Jan 4, 2023
A real-time, votable, democratized music queue on iPad and iPhone using Spotify

Queue'd Music Queue'd is the best way to enjoy music with your friends. Add your favorite songs to a shared music queue at your favorite bars, restaur

Ryan Daulton 88 Dec 2, 2022
YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos.

YiVideoEditor YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos. YiVideoE

coderyi 97 Dec 14, 2022
macOS app that allows the control of Spotify and AppleMusic/iTunes music playback from the menu bar.

PlayStatus is a simple macOS app that allows the control of Spotify, Apple Music(macOS 10.15+) and iTunes including iTunes Radio/Beats1 playback from

Nikhil Bolar 114 Dec 28, 2022
A charmful decade with many colors patterns, disco music, and other cultural expressions that we refer to as vintage

MontyHallProblem Welcome to the 70s! ?? That is a charmful decade with many colors patterns, disco music, and other cultural expressions that we refer

Diogo Infante 2 Dec 28, 2021
App for searching music and films in iTunes

inMovies App description: This is an app for searching contnent such as films and music in iTunes. Running the app brings you to page with following c

Egor 0 Nov 7, 2021
SleepingBaby - Track your kids activity and allow them sleep soundly with relaxing music in ONE app

Sleeping Baby Скачать в AppStore. Ключевые используемые технологии: UIKit, MVVM,

Egor Kostyukhin 0 Jan 7, 2022
MusicPlayer - Beautiful Music Player app built using SwiftUI to demonstrate Neumorphic design pattern and MVVM architecture

Skailer ?? Beautiful Music Player app built using SwiftUI to demonstrate Neumorp

null 23 Dec 10, 2022
Music Player for iOS which looks & feels like classic player

Prodigal Music Player APP looks and feels like a classic device. Bring back the good old player to life. Screenshots Home Page Album Gallery Home Page

bob.sun 40 Nov 11, 2022