Stereo for brown, pink and white noise generators
PeterkoPetris opened this issue · 6 comments
Description
I would like to see noise generators with option to generate stereo noise. I think they are now mono.
Proposed Solution
It would be nice to have an option to switch from mono to stereo. I would be happy if I can simply say for example whiteNoise.stereo = true to get stereo or whiteNoise.stereo = false to get mono. Default value can be false because of implementations in existing projects.
Describe Alternatives You've Considered
I've tried to create two separated generator nodes, I panned one of them left and other one right and then I connected them to mixer, but that does not feel like stereo because they are the same.
Additional Context
No response
Hmmm, I would have tried your alternative approach and expected that to work. If the white noise wave is always generated the same, you could use the Variable Delay on one of them.
Oh yeah thank you, I was just now thinking about similar approach with Delay, as I was going through this tutorial: https://www.raywenderlich.com/835-audiokit-tutorial-getting-started . This way is probably less complicated. Here is graphical representation from tutorial above (only replacing player with generator, so there is no need to use two generators):
I didn't try that yet, but I will let know here.
But it would be nice to include this as option, as I mentioned in first comment.
I'd like to see the alternate approach implementation because I'm pretty sure that would work.
Put one side through a delay and you'll never notice that's its a delay, it will just feel like stereo. also converting the code to stereo is not difficult, but I have no reason to do that.
Here is implementation I've tried with single generator and it works, so if you don't want to add option for stereo/mono I am closing feature request with this comment. Thank you guys you're awesome!
let delay = Delay(brownNoise)
let brownLeft = Panner(brownNoise, pan: -1)
let brownRight = Panner(delay, pan: 1)
brownMixer = Mixer(brownLeft, brownRight)
engine.output = brownMixer
delay.time = 0.1
delay.feedback = 0
delay.dryWetMix = 100