0

An App I'm working on is kinda like an appear-as-you-touch piano.

Using AudioKit and the gesture recognizing I have my app set up to:

  • make a new button appear when the user touches the screen

(Essentially, I have my ViewController.swift which makes new CircularKeys every time the user taps.)

  • turn on an oscillator and get it going in the ViewController via a UIButton

Now I'm trying to get some more dynamic functionality: I want to start an oscillator for each new key that exists on the screen, and I'm wondering how I can keep track of them. AudioKit wants to know all the outputs before it will feed them out with AudioKit.start() and I am thinking about using NSMutableSet to keep track of the oscillators.

Basically: I want to couple together Oscillators and CircularKeys. What are some design strategies that play nice with iOS philosophy?

Robert Harvey
201k55 gold badges470 silver badges682 bronze badges
asked Apr 18, 2016 at 16:05

1 Answer 1

1

What you probably want to do is use an AKPolyphonicInstrument. This will allow you to play as many simultaneous notes as you like* using the same oscillator type.

If you need separate oscillator types for each note, then you will have to decide how many oscillators you want to set up ahead of time, and limit the number of notes played simultaneously to the number of oscillators you have running.

*Note that most polyphonic instruments actually have some limit on the number of notes that can play simultaneously.

answered Apr 18, 2016 at 21:33
2
  • thanks for your input, do you know of any good tutorials or explanations that show how the AK nodes and stuff link together? I'm not sure how I'd tie a bunch of frequencies into one AKPolyphonicInstr. Commented Apr 19, 2016 at 0:38
  • All of the good stuff appears to be on audiokit.io -- Check out the Playgrounds. Commented Apr 19, 2016 at 1:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.