Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glassonion1/r9midisequencer
MidiSequencer for iOS on swift
https://github.com/glassonion1/r9midisequencer
coremidi ios midi sampler sequencer swift
Last synced: 6 days ago
JSON representation
MidiSequencer for iOS on swift
- Host: GitHub
- URL: https://github.com/glassonion1/r9midisequencer
- Owner: glassonion1
- License: mit
- Created: 2016-05-23T15:12:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-09T04:50:39.000Z (almost 4 years ago)
- Last Synced: 2024-11-01T15:44:08.034Z (13 days ago)
- Topics: coremidi, ios, midi, sampler, sequencer, swift
- Language: Swift
- Size: 75.2 KB
- Stars: 32
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# R9MIDISequencer
MIDI Sequencer for iOS on swift.
# Feature
## Sequencing
R9MIDISequencer now features a full MIDI Sequencer with EXS24 and SoundFont samplers which can be tied to your instruments for awesome, accurate playback.
## Example Code
Play note using the sampler:
```swift
import R9MIDISequencerlet url = Bundle.main.url(forResource: “Sound Font File Name”,
withExtension: "sf2",
subdirectory: "Sounds")
let sampler = Sampler(bankURL: url!, program: 0, bankMSB: 0x79, bankLSB: 0, channelNumber: 1)// Play the note C
sampler.startNoteWithNumber(36)
// Play the note G
sampler.startNoteWithNumber(43)
```Play MIDI file using the Sequencer:
```swift
let sequencer = Sequencer(sampler: sampler, enableLooping: true)let midiUrl = Bundle.main.url(forResource: “MIDI File",
withExtension: "mid")
sequencer.playWithMidiURL(midiUrl)
```Callback from MIDI message
```swift
class GameScene: SKScene, MIDIMessageListener {
override func didMoveToView(view: SKView) {
...Initialize sampler
let sequencer = Sequencer(sampler: sampler, enableLooping: true)
sequencer.addListener(self)
...Play MIDI
}
func midiNoteOn(note: UInt32, velocity: UInt32, channel: UInt32) {
// Call back of note on message.
}
func midiNoteOff(note: UInt32, channel: UInt32) {
// Call back of note off message.
}
func midiSequenceDidFinish() {
// Call back of finish MIDI sequence.
}
}
```## Installation
### Swift Package Manager
Create a Package.swift file.
```swift
import PackageDescriptionlet package = Package(
name: "RxTestProject",
dependencies: [
.package(url: "https://github.com/glassonion1/R9MIDISequencer.git", from: "1.5.1")
],
targets: [
.target(name: "RxTestProject", dependencies: ["R9MIDISequencer"])
]
)
```## License
R9MIDISequencer is available under the MIT license. See the LICENSE file for more info.