I know title is odd right? Quick note i'm on the version of Audiokit before the V5 upgrade. TL:DR - How can I make an AKOperationGenerator producing a control signal work inside another AKOperationGenerator as an AKParameter?
Idea came out of the fact that I have a voice that needs more than 14 Parameters changed at once.
Have a custom FM solution as I find the included AKOperations limiting.
osc = AKOperationGenerator { p in
let modulator = AKOperation.morphincOscillator(frequency:p[2],amplitude:p[3],index:p[1])
let carrier = AKOperation.morphingOscillator(frequency: p[4].midiNoteToFrequency() * (1+moulator), amplitude:1, index: p[0])
return carrier
}
but then I would like to have the ability to assign an Envelope to the output in this sort of style:
ampEnv = AKOperationGenerator { p in
let output = AKOperation.init(1).gatedADSREnvelope(gate:p[0],attack:p[1],decay:p[2],sustain:p[3],release:p[4])
return output
}
Then have something like:
Synthvoice = AKOperationEffect([osc, ampEnv]), {[osc,ampEnv], p in
let output = generator * ampEnv
return output
}
AudioKit.output = output
Essentially using either Multiple inputs to the AKOperationEffect so that you can modulate using several sources or having the ability to use AKBooster/other bits inside the AKOperation.
I have tried creating a custom function to act as the amplitude envelope but can't figure out how to get it as a ComputedParameter to include it in the processing.
I have tried it all in 1 Operation Generator but I have 16 parameters that need to be changed by the user, additionaly I like the idea of the audio signal and control signal being in seperate chunks.
Cheers (BTW i'm fairly new to AudioKit so sorry if any of what i'm asking is just blasphemy) Also should note that I have set outputs and start commands later in the code so shouldn't worry about that. Mainly just a question regarding the interoperbility between AKOperationGenerators and how to get them interacting with eachother.