I am also interested in implementing microtonal tunings with AK and very happy that someone else is too.
Before finding AudioKit I was experimenting with iOS apps and micro tunings using the PureData library. PDLib represents a midi note number as a float so if you wanted a standard equal tempered C3 you played note 60. Since there are 100 cents between each tempered interval it is fairly easy to detune a note to within one cent.
AK has defined MIDINoteNumber as UInt8 and it is used as an index into the noteStates array in the various AKxxOscillatorBankDSPKernel objects and the respective noteOn() methods calculate the frequency by a call to noteToHz(). From there on down it looks like audio unit magic, smoke and mirrors to me - precisely the reason why I am using AK instead of AU! (Thank you, Aure!)
So, how can you detune a note in AK without redefining MIDINoteNumber as a float?
I don’t claim to be a microtonal tuning expert by any means but it seems to me that the OscilatorBank objects could be modified to be instantiated with a simple tuning table and a generator root tone. Standard midi is equal temperament with A=440 Hz. What if you want a Ptolemy just intonation in the key of A=432 Hz?
For example, the Ptolemy 7 note scale is:
7
9/8
5/4
4/3
3/2
5/3
15/8
2/1
The 12 note equal tempered scale is
12
100.0
200.0
300.0
400.0
500.0
600.0
700.0
800.0
900.0
1000.0
1100.0
2/1
Marcus, your sample play() code is passing a frequency parameter to the AKxxOscillatorBankDSPKernel startNote method. Is this an absolute frequency or a detune adjustment to be applied in noteOn() to the equal tempered frequency of the MIDINoteNumber?
-Allan