I am a beginner with Audiokit. I am trying to implement Overtone Series Effect on harmonies using Audiokit. I am using Midi Sampler along with AKappleSequencer to play different notes. As in the overtone series I will be required to change or adjust the frequencies or pitches of the sounds in cents at different positions so I am not sure and struggling to find how to achieve that.
for mid in arrbeats{
var midi = Double(mid["note"] ?? 0)
var adj = Double(mid["adj"] ?? 0)
adj = adj / 100 // adjustment in cents
midi = midi + adj
sequencer.tracks[0].add(noteNumber: MIDINoteNumber(exactly: midi) ?? MIDINoteNumber(midi), velocity: 60, position: AKDuration(beats: pos), duration:AKDuration(beats: chord.mNote.raw()))
setUpCallback(position: pos,type: 2)
}
There are so many ways to achieve this type of thing, but they are not trivial to implement. Here are some ideas for you:
Learn about AudioKit's built in microtonal scales. We have an AKTuningTable that you can load with your own array of frequencies to map midi notes to: This technique is used to create the hundreds of interesting retuning in AudioKit Synth One:
Use oscillators instead. Oscillators frequencies can be set directly. To sequence them, use the sequencer triggering an AKCallbackInstrument that then triggers your oscillators with the appropriate logic.