Aurelius Prochazka

2个pods

AudioKit

开源音频合成、处理和分析平台。

许可证: MIT

  • Objective C

MIDISequencer

MIDISequencer

MIDI 序列器,向其他应用程序发送MIDI事件。基于 AudioKit 的 AKSequencer 构建,用于 iOS 和 macOS。通过专注于音符创建智能 MIDI 序列器乐器。

要求

  • Swift 3.0+
  • iOS 9.0+
  • macOS 10.11+

安装

ruby pod 'MIDISequencer'

用法

MIDISequencer 是基于 AudioKit 的 AKSequencer 并使用 MusicTheory 库构建的,专注于音符的多轨道支持功能。

  • 创建一个 MIDISequencer 实例。

swift let sequencer = MIDISequencer(name: "Awesome Sequencer")

  • 创建一个 MIDISequencerTrack 并将其添加到序列器的轨道。

swift let track = MIDISequencerTrack( name: "Track 1", midiChannel: 1)

  • 将一些 MIDISequencerStep 添加到轨道的 steps

swift track.steps = [ MIDISequencerStep( note: Note(type: .c, octave: 4), noteValue: NoteValue(type: .quarter), velocity: .standard(100)), MIDISequencerStep( note: Note(type: .d, octave: 4), noteValue: NoteValue(type: .quarter), velocity: .standard(100)), MIDISequencerStep( note: Note(type: .e, octave: 4), noteValue: NoteValue(type: .quarter), velocity: .standard(100)), MIDISequencerStep( note: Note(type: .f, octave: 4), noteValue: NoteValue(type: .quarter), velocity: .standard(100)), ]

  • 您甚至可以向任何步骤添加和弦、多个音符或两者。

```MIDISequencerStep( chord: Chord(type: .maj, key: .c), octave: 4, noteValue: NoteValue(type: .quarter), velocity: .standard(60))

MIDISequencerStep( notes: [Note(type: .c, octave: 4), Note(type: .d, octave: 4)], octave: 4, noteValue: NoteValue(type: .quarter), velocity: .standard(60))

MIDISequencerStep( notes: Chord(type: .maj, key: .c).notes(octave: 4) + [Note(type: .c, octave: 4), Note(type: .d, octave: 4)], noteValue: NoteValue(type: .quarter), velocity: .standard(60))```

  • isMuted 属性设置为 true 以静音任何 MIDISequencerStep

许可证: MIT

  • Swift