rserota/wad

connect output of wads (post processing)

Closed this issue · 4 comments

I am building an instructional app which compares students singing/playing with the instructor's pre-recorded take. Wad has been extremely useful.

However now I have realised I need more control of pitch analysis, and would therefore like to connect my existing wads ( I have a bunch of them ) with a separate pitch analysis functionality - after effects processing, so that I can re-use my work so far.

Is there a way to accomplish this, ie with Wad.audioContext / createMediaElementSource, or similar?

Sure, you can have multiple tuners, analyzing the pitch at multiple points in the effects pipeline. It all depends on how your group wads/polywads together, and where you put the pitch analyzers.

So how would I access a wad's analyser node? I need to send it, as well as the sample rate, to a custom updatePitch() function like this:

updatePitch(analyserNode, Wad.audioContext.sampleRate)

I'm not sure if I understand your use case? Every polywad has a list of the wads it contains in an array called nodes. The last node in this list is an analyzer, which is used for pitch detection.

Thanks - it makes more sense to me now, I ended up using a workaround but will test this next time (being a rookie programmer I am still struggling to get my head around js classes etc).