# A hypnotic, music-reactive Techno visuals show designed for staring at at a party (Part 2)

**URL:** <https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140>\
**Category:** Gallery\
**Created:** [October 4, 2018, 7:07pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140 "2018-10-04T19:07:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shallowed](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Shallowed](https://discourse.processing.org/u/Shallowed)\
**Post date:** [October 4, 2018, 7:07pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/1 "2018-10-04T19:07:21Z")

</div>

Hi everyone,

[https://www.youtube.com/watch?v=j7a22PSjxfE&t=17m53s](https://www.youtube.com/watch?v=j7a22PSjxfE&t=17m53s)

Just sharing my work here again. I made a post on the old Processing forum and it seemed to go down reasonably well. I’ve made some updates now and thought it would be cool to share them!

As the first post said:  
‘I coded this system for minimal techno visuals in Processing. It involves 3D graphics, beat detection and other techniques! Been working on it on and off for a long time. I have used it live at a clubnight [a few times] too!’

Updates this time:

- Movie Playback (frame accurate)
- Gentle fade in, fade out of sphere
- Small tweaks to visuals routine

[Here](https://www.youtube.com/watch?v=j7a22PSjxfE&t=17m53s), it is reacting to a new hour long techno mix I made. Any questions about any elements of the system, let me know and I’ll help you out!

Thanks for looking 🙂

---

<div class="post-metadata">

**Author:** ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)\
**Post date:** [October 4, 2018, 8:09pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/2 "2018-10-04T20:09:14Z")

</div>

Left you a message on YT. Wd love to see the code that reacts to the music in Processing and generates visuals…

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 12, 2018, 3:12pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/3 "2018-10-12T15:12:53Z")

</div>

Thanks for sharing this, @Shallowed.

---

<div class="post-metadata">

**Author:** ![Shallowed](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Shallowed](https://discourse.processing.org/u/Shallowed)\
**Post date:** [October 16, 2018, 9:00pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/4 "2018-10-16T21:00:25Z")

</div>

Hey! Ah cool, think I saw that one. For sure, I can let you know a bit about the code.

First and foremost, I would say that the software’s most important feature is the detection and analysis of beats within a provided audio source. Most things in the software make use of these beats in some way. For example, the spinning sphere flashes on the beat usually.

My beat detection system is a kind of custom simplistic one I wrote myself. I’ll quote you what I wrote last time, perhaps it’ll help you 🙂

> I used a FFT (Fast Fourier Transform) object ([docs](http://code.compartmental.net/minim/index_analysis.html)). This allows you to split the audio into a spectrum (multiple bouncing frequency bands, like you might see on a graphic equalizer).
> 
> Since my music has a pretty constant pulsing bassy beat, I simply access the value for the lowest band of the FFT (number 0), then set a threshold for what constitutes a beat on that band. I also have a sensitivity value that I can change on the fly, so that 2 beats aren’t detected too close together. This works reasonably well, and is something I can quickly mess with at live shows if the beat detection goes wrong (I have threshold and sensitivity mapped to the arrow keys).
> 
> Here’s some code for that last bit:
> 
> `if (frameCount >= mostRecentBeatFrameCount + sensitivity) {`  
> `if (selectedAverageBandLevel > chosenThreshold) {`  
> `mostRecentBeatFrameCount = frameCount;`  
> `}`  
> ` }`
> 
> So yeah, pretty simple solution, works well for live situations with 4x4 bass heavy music. There’s definitely, definitely better ways to approach it though. You can find scientific papers and other writings online about better beat detection methods, I would like to implement one one day!

One you are detecting beats, it’s should be straightforward to create some visuals. For example: when you detect a beat, flash a colour up on screen for a few frames (that’s one I use). Then you’ll have a pulsing effect, in time with music. Any parameter that processing allows you access to, you can manipulate in time with your detected bits, and create cool music reactive effects. That part is all about experimentation, to see what works well!

Hope that helps, cheers!

---

<div class="post-metadata">

**Author:** ![Shallowed](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Shallowed](https://discourse.processing.org/u/Shallowed)\
**Post date:** [October 16, 2018, 9:01pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/5 "2018-10-16T21:01:13Z")

</div>

More than happy to, Cheers Jeremy

---

<div class="post-metadata">

**Author:** ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)\
**Post date:** [October 31, 2018, 1:54pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/6 "2018-10-31T13:54:19Z")

</div>

Thanks so much! I’ll play with it. Can you answer further questions should they arise?

---

<div class="post-metadata">

**Author:** ![CrouchingPython](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/crouchingpython/32/1690_2.png) [@CrouchingPython](https://discourse.processing.org/u/CrouchingPython)\
**Post date:** [October 31, 2018, 2:04pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/7 "2018-10-31T14:04:35Z")

</div>

Do you have this whole code on Github or somewhere?

---

<div class="post-metadata">

**Author:** ![Shallowed](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Shallowed](https://discourse.processing.org/u/Shallowed)\
**Post date:** [November 4, 2018, 6:59pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/8 "2018-11-04T18:59:32Z")

</div>

You’re welcome! Don’t have the code available on GitHub or anything, can probably answer more questions though.

---

<div class="post-metadata">

**Author:** ![poboyd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/poboyd/32/8908_2.png) [@poboyd](https://discourse.processing.org/u/poboyd)\
**Post date:** [April 10, 2020, 12:37pm UTC](https://discourse.processing.org/t/a-hypnotic-music-reactive-techno-visuals-show-designed-for-staring-at-at-a-party-part-2/4140/9 "2020-04-10T12:37:40Z")

</div>

Couldnt you use minim for beat detection? also if youre looking to record your graphics with something like VideoExport you should try do any sound analysis of your whole song first and store some Low, Med, High averages an a array. That way when recording the video you can keep in time with your song otherwise it gets out of sync if you try to do FFT on the fly and frame record at the same time.

I did this on my software PoShowTube which makes YouTube videos.
