New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better audio analysis #8
Comments
got a start over here, going to dive in with some more improvements once I understand the UI side a bit more :) cale-bradbury@e2b213b |
Awesome, this is exactly the sort of stuff we need. @netgrind do you think it would be useful to have MIDI control over these new values? If so, this is the approach:
|
|
Yeah, getting a texture of audio data that can be passed to any THREEjs scenes that have the proper markup/metadata, very handy to passing through to vert/frag shaders for reactive effects. I personally like having it so X is the frequency, and Y is the history over time. Might be a good idea to have an option to send one that is similar to shadertoys (I think it is currently just a 2 or 5 pixel high left/right channel..?) so people can just pop their shaders right into a template |
So my first thought on this that this should be some kind of new input that is assignable to any parameter. However I don't know if that really makes sense as it's quite a specific data type that only makes sense in certain contexts. One very simple approach to doing this would be to pass the audio analyser object to each sketch class upon construction. Inside the analyser object could be useful pre-calculated things such as the texture you're talking about or anything else. So you'd create sketches like this: class MySketch {
constructor (scene, meta, extras) {
const analyser = extras.audioAnalyser
this.texture = analyser.dataTexture
this.frequencies = analyser.frequencies
this.someOtherUsefulThing = analyser.fooThing
}
...
update () {
// can use this.texture here
}
} Does that approach make sense? Inside the |
Currently it is quite primitive. Would be good to have some "decay" options and more. Not totally clued up on this one!
The text was updated successfully, but these errors were encountered: