I’ve been looking at Jeff’s fantastic code for the Music Sequencer V2 & V3 and I would like help extracting the code for the tempo detection and then using it to do the following:
1: affect the brightness
2: shift the hue
Any suggestions or help would be greatly appreciated.
This should definitely be possible, but the main question is “how” you’d like to affect the hue and brightness. Also wanted to see if you meant beat detection - tempo detection gives you something like “120 BPM” but beat detection lets you do something on each beat.
There’s a minimal version that only has the tempo+beat detection and one pattern uploaded to the patterns library (currently on page 2) - look for “Flash Posterize + Music Sequencer framework”; Replace the function flashPosterize() { part with other pattern code and that should work.
Based on your description, I meant beat detection - doing something on each beat.
Taking your advise, I downloaded “Flash Posterize + Music Sequencer framework" and I believe that I can use this as a model. This will be extremely helpful.
Hi, @Jeff, I have been trying to add beat/tempo detection to the Kitt pattern and not having any luck. I tried adding the Kitt code to the “Flash Posterize + Music Sequencer framework” at the point suggested in the above post and received a " Runtime error: invalid function call" on line 104 “renderer (index, x, y, z);”. (I have a very low coding ability so the chances of figuring out where I went wrong is a number far less than zero!)
What I would like is a Kitt pattern that responds to the kick drum (80 to 200 Hz?) by changing direction with each beat. Most of the music I like is 4/4 and around 120 to 130 bpm if that helps at all…
What I don’t know is whether to try to add Kitt to the music sequencer pattern or if it would be easier (or better) to add beat detection to Kitt?
Any help that you, or anyone else, could provide would be greatly appreciated.
Thank you!
Hey! I’m pretty busy with client work right now, but I think you’d want to put KITT into the framework like you started doing, or, start from scratch and only bring in the parts you need to KITT. Both are valid, and the best approach depends on how much of the framework you need. If it’s only switching directions on beat, start from KITT. If you might change patterns or need the other audio/tempo features, start from the framework.
Your error suggests you might need to assign a renderer in the beforeRender replacement. There should be an example in both the FlashPosterize part as well as the comments at the top. I do agree it’s a little complicated if you don’t code often - have you tried working with ChatGPT for it?
Thanks @Jeff! I appreciate you taking the time to respond to my questions and for pointing me in the right direction. I haven’t coded since I wrote a math game for my Commodore 64 that featured sprites!
I think modifying code seems to be easier than writing it, and if I get stuck ChatGPT sounds quite helpful.
Thanks again!