The Pendulum Sequencer

Download: https://github.com/silveirago/The-Pendulum-Sequencer

The Pendulum Sequencer is an interactive audiovisual application where the physics of pendulums are used to create a MIDI sequencer. It consists of a series of pendulums initially arranged to produce a pendulum wave effect. Each pendulum swings back and forth accordingly to the amount of gravity and resistance chosen by the participant. Triggers can be placed in the canvas, and every time a pendulum hits a trigger a MIDI note related to that pendulum is sent to an external synthesizer. The intensity, or velocity, of each note is a product of the momentum when the pendulum hits a trigger and the mass of its sphere. The participant can choose between different scales; change the amount of gravity and resistance; change the length of each pendulum and the radius of its “sphere”; drag and drop pendulums as desired.

A few months ago I decided to dive into the visuals world. Although we are Nerd Musicians, we can always expand our world through technology, and and have some fun in the realm of our other senses.

There are many tools out there that allow you to create interesting visual algorithmic pieces using familiar programming languages. From the many that there are out there, the ones that I had some experience with is Max (using Jitter), Openframeworks and Processing. Max uses its easier to understand visual patching blocks system, which makes your life easier a lot of times, making it easy to prototype some things. However, Max may make you take more time than you should in more complex projects, and it’s the less efficient in terms of speed. Openframeworks is based on C++, which is a low-level language, so, on the other hand, is extremely fast. OF is probably the best for creating standalone applications. Processing is based in Java and it’s similar to Openframeorks. Although it’s not as efficient, it’s easier to learn, IMHO, being the in the middle of ease to use and flexibility.

One of the reasons I chose to work with Processing, for now, is a Youtube channel called The Coding Train, lead by Dan Shiffman. Shiffman is a legend in the Processing and other visual languages world, an amazing teacher, and my actual hero! :p Shiffman has a really interesting series of videos and a book called The Nature of Code, where he teaches you how to simulate many aspects of physical life in code, mostly using Processing or p5.js.

A couple of months ago a friend of mine posted a video of the pendulum effect. This effect is achieved when several pendulums are dropped at the same time, where each pendulum has a length with a certain ratio from the previous pendulum. Each pendulum has to have a length that will do x-1 cycles per minute than the last pendulum. For example, the first pendulum will do 15 cycles per minute, next will do 14 cycles, etc. Then, you have to figure out the math, which will depend on how many pendulums you have, how long one whole cycle will last, and how long is the first pendulum. Figuring this out was one of the hardest parts, but after you figure out the math and the code for that, you just type the values for your pendulum system and the code will generate everything for you.

The pendulum eave effect:

After seeing many videos of the Nature of Code, I saw one where Shiffman teaches us how to make one pendulum on Processing. Since I was inspired by the pendulum wave I decided to create my own pendulum wave. After I got mine done I thought that would be interesting to explore its musical qualities. What if I built a sequencer from that? I could place triggers and when the sphere of a pendulums hits a trigger it sends a MIDI note! I had to turn the Nerd Musician mode on. The Pendulum Sequencer worked great and I loved the result. I even made some experiments using the Leap Motion and a Kinect to control it with gestures the movement of the Pendulums. Although it’s pretty cool, it takes too much of the CPU and it’s not as precise, at least for now. But, if you want to try it out, it’s there commented in the code.

So, how do you use it? If you watch the video (on the top of the post), it’s pretty self-explanatory. You start the engine, drag a few triggers and watch the magic happens! However, since it’s a MIDI sequencer you need to have a synthesizer opened somewhere and route the MIDI using the MIDI_out tab. You can also change the scale, click on the spheres and drop them somewhere else, change the length of each pendulum, change the size of the sphere, change the air resistance and the amount of gravity! You can read the instructions on the left bottom corner of the app for more info on how to use it.

I can say that I got really happy with the results! One can achieve some pretty hypnotic visuals and unusual rhythmic patterns, all based on mother nature’s physics laws! Which can be totally bent on a computer software…

The Pendulum Sequencer is free and open source! It can be downloaded here. I hope you can have a good time with it! And, please, send me videos, and comments if you use it. Have any suggestions? Leave your comments on the Youtube video!

And if you want to learn how to make your own hardware MIDI controllers, don’t forget to check my free DIY MIDI Controller Workshop and my full Making Music with Arduino course!

DIY MIDI Controller Workshop: https://www.musiconerd.com/4-1-diy-midi-controller-workshop
Making Music with Arduino: https://www.musiconerd.com/making-music-with-arduino

Fazendo Música com Arduino (português)
Curso gratuito: https://www.musiconerd.com/fmca-landing-page
Curso completo: https://www.musiconerd.com/curso-completo-b