Closed ythecombinator closed 7 years ago
Yeah, it's a limitation on playground books, that you can't use anything but standard libraries or swift files. Since a lot of AudioKit is built with lightweight, fast, and audio-safe C processing, those parts are missing from the playground book. That includes the oscillators unfortunately. Now, we all hope that Apple will allow us to add C libraries to playground books someday, we're not exactly holding our breaths.
Hey @aure, thanks for the amazingly fast feedback–and sorry for the delay in answering as well.
I was really excited about using AudioKit in my .playgroundbook
–shame on you, Apple.
As a workaround, I thought about using some set of audio stream generation + stream waveform drawing JavaScript libs–which I've used before in other projects–inside a WKWebView
–but it seems that webviews can't actually play sounds in .playgroundbook
s.
Anyway, I'm gonna study other alternatives–and, if you're interested, I'll tell you what I've discovered.
Definitely, I'd love to know what you discover. Good luck!
Well, I've just started playing with AudioKit's APIs–and I'm lovin' them all–aiming to implement a
.playgroundbook
project which consists of allowing readers to design and visualize–e.g. through { sine, square, sawtooth }waves form plots– musical algorithms making use of audio streams generated with math functions–e.g. the following code:where the second returned function gets run
44000
times per second and returns aDouble
between-1
and1
which represents the wave amplitude.After reading the APIs–and observing a few regular
playground
s of yours–I noticed I should use a few classes–mainly responsible foroscillators
–e.g.:Just like you did in awesome exemples here:
But, what you said here scared me a bit:
My point is: is there any known issues related to using the APIs used here in
.playgroundbook
s? WouldAKOscillator
,AKPlaygroundView
,AKOutputWaveformPlot
–and others–be suitable in such special kind of playground? Have you tried anything like this before? Any suggestions?Thanks!