Guido Kramann


by Guido Kramann 05/2020

ComposingWithSpheres is an application in the field of computational music. The application is primarily intended to give children access to composing and thus, is also a contribution to "Ubiquitous Music", see e.g. Ubiquitous Music 2007-2012 (summary) by Damian Keller General information about the library ComposingForEveryone (including ComposingWithSpheres as an example) can be found here:

You can find ComposingWithSpheres as example in the Processing library ComposingForEveryone, see

Setup for "ComposingWithSpheres".

What you can do with this sketch is best seen in this video:

Children can make the balls shown here themselves and have the experience of composing music without any knowledge about harmonic theory nor about counterpoint.

Decorating balls.

The balls can be designed according to compositional considerations. For example, there is a ball in which a pompom is pasted with coloured areas. When ever the pompom flips, a new variant of the musical structure appears.

Examples for decorated spheres.

You can try out the composition technique used here yourself, with some limitations, quite easily using the following Android app:

Another variant where formulas are entered directly can be found here:

KIBA is an older example that also allows real-time composing:

With this sketch I try to check out the limits, so to speak, what is feasible in terms of sound quality and haptic user interaction. As an introduction to the technique used here, I recommend a look at BASIC_Sound_of_N_simplified and ComposingWithCamera, which are also delivered with the library ComposingForEveryone.

You can see in the film that in addition to a computer, a certain amount of hardware setup is also necessary: an external webcam must be connected to the computer and placed in a rack above the scene. A carrier consisting of two slowly running DC gear motors and a slide bearing ensure that inserted balls rotate slowly around two axes. To increase the friction between the motor axes and the balls, the motor axes were covered with a layer of hot glue. To avoid color artifacts in the camera image, the motors and their power lines were covered with white crepe adhesive tape.

DC gear motors.

Carrier with sphere.

This sketch is meant as a kind of reference, which runs directly with the current settings, but in the original mode physical modeling instruments are controlled via Midi.

This Midi mode can be activated by setting the variable MIDI_ACTIVE to true (see below, about line 210). Therefore this sketch requires the library TheMidiBus besides the additional libraries Video and Ketai.

As phyical modeling instruments the clarinet and double bass of the company AudioModeling (SWAM, ) and vibraphone and marimba of the company Modartt (pianoteq, ) were used. As a sequencer in which the instruments run as a VST-plugin Camelot ( ) was used. To connect processing with Camelot loopMidi ( ) was used. Everything was implemented under Windows 10. Please refer to the screenshots included in the sketch for the configurations of the individual software components.

As said before: This sketch can only be made to work in its original form with more effort. Its purpose is to serve as a reference for ComposingWithSpheres and to show in which way it is possible to achieve further improvements in sound when other third party software is used together with Processing.

Some more impressions

Screenshots of the configurations of the third-party software used


Camelot / SWAM

Camelot / Pianoteq