• # Lesson 13. Working with Binary Rhythmics

## Annotation

This piece demonstrates the use of binary lists as an ingenious way to create and modify rhythm: 0 is a rest-length, 1 is a note-length.

```(setf bin-rhythm (gen-binary-rnd 5 5 2 1 :seed 41))
=> ((0 1 1 0 0) (1 1 0 0 1) (0 1 1 0 1)
(1 0 0 1 1) (0 1 1 0 1))```

The function GEN-BINARY-RND creates a novel rhythm for the pitches we’ve generated here:

```(setf line-rnd (gen-eval 5 '(rnd-sample 5 line) :seed 41))
=> ((cs4 g4 cs4 c5 cs4) (cs4 c4 c5 c5 g4) (fs4 fs4 c5 fs4 cs4)
(cs4 c5 cs4 fs4 c5) (c5 c5 g4 g4 fs4))```

The function BINARY-MAP maps the binary lists onto the pitch lists with 0 removing any pitch aligned to it.

```(setf line-map (binary-map bin-rhythm line-rnd))
=> ((g4 cs4) (cs4 c4 g4) (fs4 c5 cs4) (cs4 fs4 c5) (c5 g4 fs4))

(setf rhy-mapped (binary-map bin-rhythm '(e)))
=> ((-1/8 1/8 1/8 -1/8 -1/8) (1/8 1/8 -1/8 -1/8 1/8) (-1/8 1/8 1/8 -1/8 1/8)
(1/8 -1/8 -1/8 1/8 1/8) (-1/8 1/8 1/8 -1/8 1/8))```

The output is interesting because the pitches don’t ‘skip’ the rest-lengths but are swallowed by them.

## Score

```(setf line '(c4 cs4 fs4 g4 c5))
(setf bass (pitch-transpose -24 line))

(setf line-rnd (gen-eval 5 '(rnd-sample 5 line) :seed 41))
(setf bin-rhythm (gen-binary-rnd 5 5 2 1 :seed 41))

(setf line-map (binary-map bin-rhythm line-rnd))
(setf rhy-mapped (binary-map bin-rhythm '(e)))

(setf bass-line (gen-repeat 5 (list bass)))
(setf rhythm (span bass-line '(e)))

(setf dynamics (mclist '(f mp f mf ff)))
(setf dyn-spanned (span line-rnd dynamics))

(setf line-1 (make-omn
:length rhy-mapped
:pitch line-map
:velocity dynamics))

(setf bass-1 (make-omn
:length rhythm
:pitch bass-line
:velocity dyn-spanned))

(setf ts-list (get-time-signature line-1 :group '((3 2))))

(def-score lesson-13
(:key-signature 'chromatic
:time-signature ts-list
:tempo 100
:layout (piano-layout 'piano-rh 'piano-lh))

(piano-rh
:omn line-1
:channel 1
:sound 'gm
:program 'acoustic-grand-piano)

(piano-lh
:omn bass-1)
)```

## Notation

Go back to Reference page.

Edited by opmo

• ### Introduction to OMN the language

OMN is designed as a scripting language for musical events. It’s not about sounds themselves, it is about their control and organisation in a musical composition. As a linear script rather than a graphic stave, musical events can be transformed, extended, reorganised by powerful computer algorithms. Some sequencers and score writers provide basic algorithms, but they do not represent the way composers now think about the process of music composition. Composing has become such a multi-faceted pro

opmo
OMN The Language 0
• ### Introduction to Opusmodus

Contents A Contemporary Language for Making Music The Parametric World of Music The Parametric Instrument Learning Opusmodus : A Strategy Important Questions: Necessary Answers

opmo
Tutorial Guide 0
• ### CLM Installation

Contents CLM Installation Command Line Tools Load and Compile Instruments CLM Installation Common Lisp Music, by William Schottstaedt is a powerful sound synthesis language implemented in Lisp and C. CLM is essentiall

opmo
CLM Examples 0
×

• Lessons