Music

Constraint Programming Using Screamer

Written by on May 17, 2016 in LISP, Music, Programming with 0 Comments
Constraint Programming Using Screamer

A few years I ago I had briefly experimented with the Screamer library in the context of automatic test case generation from specification. I felt it was a useful utility for doing simple constraint programming tasks. Recently while going through some of the past articles in the Opusmodus forum, I was pleasantly surprised to find references to constraint programming […]

Continue Reading

Generating Melody to Fit Harmony

Written by on May 10, 2016 in LISP, Music, Programming with 0 Comments
Generating Melody to Fit Harmony

There are two common approaches to composing music. One involves synthesizing a suitable chord progression first and then layering melody over it. The other is to start with melody and then harmonize it by applying chords. Of course, you can mix both approaches – use one technique for a portion of the song and then […]

Continue Reading

Reading and Transforming a MIDI File

Written by on April 27, 2016 in LISP, Music, Programming with 0 Comments
Reading and Transforming a MIDI File

Sometimes it can be interesting to take a MIDI file and transform the score it represents. For example, you can change the tempo, alter the instruments, or even modify the pitches and rhythm. To do something like this, it is helpful to build a convenient framework. In today’s post, I am outlining one approach that […]

Continue Reading

Motifs and Transformations

Written by on April 19, 2016 in LISP, Music, Programming with 0 Comments
Motifs and Transformations

One of the creative approaches to synthesizing music is to start with a short melodic motif and then apply various transformations on it. The motif is usually (but not necessarily) of 1 bar duration. What are some possible transformations? This depends on one’s creativity, but here is a simple list: 1) Identity transformation: Do nothing […]

Continue Reading

Rhythmically Odd Rhythms

Written by on April 12, 2016 in LISP, Music, Programming with 0 Comments
Rhythmically Odd Rhythms

In the excellent book The Geometry of Musical Rhythm – What Makes a ‘Good’ Rhythm Good? by Godfried T.Toussaint, there is an interesting discussion of Rhythmic Oddity in Chapter 15. A rhythm has this property if no two of its onsets divide the rhythmic cycle into two half-cycles, that is, two segments of equal duration. […]

Continue Reading

User-defined Literals in C++

Written by on March 27, 2016 in C++, Music, Programming with 0 Comments
User-defined Literals in C++

C++11 introduced user-defined literals, allowing programmers to define special suffixes that can be associated with the built-in literal types: character, integer, float, boolean, and pointer. When designed and used properly, these provide nice syntactic sugar facilitating readability and at the same time, increasing type safety. For example, I can define an operator _kg that can be […]

Continue Reading

Converting Text to Music

Written by on March 12, 2016 in LISP, Music, Programming with 0 Comments
Converting Text to Music

Converting text to music can be fun. Opusmodus has a few built-in functions to work with text. Look up the description of text-to-pitch, for example. As described in its documentation, (text-to-pitch ‘(“To be, or not to be, that is the question”)) => (((g5 d5) (cs4 e4) (d5 f5) (cs5 d5 g5) (g5 d5)     (cs4 […]

Continue Reading

A GUI Front-end for Cellular Automata Generator

Written by on March 4, 2016 in LISP, Music, Programming with 0 Comments
A GUI Front-end for Cellular Automata Generator

In my last post, I explained how we can use Cellular Automata (CA) in Opusmodus to create music. For today’s post, I wanted to build a simple UI to control the parameters used in the CA example. This posed a practical difficulty. Opusmodus does not yet provide a GUI library. Even Clozure CL, on which Opusmodus […]

Continue Reading

Using Cellular Automata to Generate Music

Written by on February 28, 2016 in LISP, Music, Programming with 0 Comments
Using Cellular Automata to Generate Music

Cellular automata are a powerful computational formalism. Stephen Wolfram’s book A New Kind of Science provides a thorough study of these devices. Not surprisingly, Wolfram Mathematica has great support for working with them. For example, the following figure shows the evolution of Rule 30 over 50 steps, plotted using ArrayPlot function (in Mathematica): Using cellular automata for […]

Continue Reading

Organum in Music

Written by on February 6, 2016 in LISP, Music, Programming with 0 Comments
Organum in Music

When two or more voices in a song follow the same rhythm and move by the same interval, thus causing a parallel motion of the voices, it is referred to as Organum. Depending on the intervals between the voices, this can give rise to a rich and interesting effect. For today’s experiment, I decided to […]

Continue Reading

Top