Getting started in music programming – a simple browser is enough for beginners

We continue our series posts about music programming… In it, we talk about languages, utilities and other tools that turn functions and attributes into melodic [в зависимости от уровня автора] compositions. Today we are talking about the virtual environment Klangmeister. It does not require the installation of specialized software.

Photo: Brandon Erlinger-Ford.  Source: Unsplash.com
Photo: Brandon Erlinger-Ford. Source: Unsplash.com

Music programming is the process of writing tracks using specialized software, synthesizers and sequencers. There are a huge number of services that allow you to “join” this topic. We have already talked about some of them – for example, Openmusic and ORCA… With their help, you can write music in different genres, however, they require installation and configuration on a computer. Composer and developer Chris Ford considered this fact limiting the creativity of novice musicians and decided to remedy the situation.

He has developed a tool that allows you to create “without problems”. So it appeared Klangmeister – translated from German as “sound master“- working directly from the browser

What’s under the hood

For writing music, Klangmeister suggests using Clojurescript. It is a compiled JavaScript implementation of the LISP language. The functions necessary for the work are stored in the library Leipzigwritten by the author of the project. He also prepared quite detailed documentation… The application uses the Web Audio API to play tracks.

The interface allows you to compile programs on the fly – actually write and play music in real time. A range of features Chris Ford demonstrated at the flatMap technology conference in Oslo a few years ago. For example, to write a melody, you need to create an array that includes the duration and pitch of each individual note.

(phrase [3/3 3/3 2/3 1/3 3/3]
        [ 72  72  72  74  76])

Klangmeister also allows you to combine multiple tunes into one:

(->>
  (phrase [3/3 3/3 2/3 1/3 3/3] 
          [ 72  72  72  74  76])
  (then
    (phrase [2/3 1/3 2/3 1/3 3/3]
            [ 76  74  76  77  79])))

On the official site there is a guide with code examples for more complex music writing techniques – looping tracks and adjusting BPM.

In general, the Klangmeister tool is quite simple, which is both its advantage and disadvantage. It allows you to take an easy start in music programming, but the Web Audio API involved is poorly suited for writing deep and complex compositions. Also author notesthat Klangmeister works best in Chrome. The synthesis functions it uses may not (or may be poorly supported) supported in other browsers. Everyone can evaluate the “insides” of the project on their own – its source code is posted in repository on GitHub

What are the alternatives

One of the famous virtual environments for real-time audio synthesis is Supercollider… We briefly mentioned her in one from previous materials… It has existed since 1996, and during this time a large community of fans has formed around it. SuperCollider is a more complex tool than Klangmeister and can take a long time to master, but it also offers wider possibilities.

The composer works with the instrument Chris Brown (do not confuse with singer and actor) from San Francisco. With his help, he wrote an album Branches… Eli Fieldsteel, professor of composition theory at the University of Illinois, uses SuperCollider for analyzing individual pieces in lectures.

Photo: Valentin Müller.  Source: Unsplash.com
Photo: Valentin Müller. Source: Unsplash.com

Another analogue of Klangmeister, which Chris Ford himself mentions, is the platform Extempore… It includes two programming languages ​​- Scheme and Extempore of the same name. Their capabilities are combined with a compiler based on LLVM, which allows processing digital signals in real time. How it works, system author told at the OSCON open source conference.


What else do we write about in Hi-Fi World:


Our reviews in the blog on Habré:

  • Arslab, DALI and Monitor Audio – “floorboards” in the range of 60-80 thousand rubles

  • Reviews of audio equipment and thematic guides from the “World of Hi-Fi”

  • Shelf acoustics in the region of 50 thousand rubles


Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *