< Back to IRCAM Forum

Steve Reich Grace/Scheme

Hello,

(new on OpenMusic, maybe the code already exists somewhere or the question has already been asked)

In OpenMusic I would like to reproduce the 1st example found in Grace/Scheme tutorial (Common Music http://commonmusic.sourceforge.net/ by Heinrich TAUBE):

; Steve Reich’s Piano Phase

(define (piano-phase endtime keys rate)
(process
with pat = (make-cycle keys)
while (< (elapsed) endtime)
do
(mp:midi :key (next pat) :dur rate)
(wait rate)
)
)

(let
(
(keynums (keynum '(e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5)))
(stoptime 20)
)
(sprout
(list
(piano-phase stoptime keynums .167)
(piano-phase stoptime keynums .170)
)
)
)

There are several elements that I can’t reproduce (I don’t know if it’s possible anyway):

1- The musical notation “(e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5)” instead of (6400 6600…)
2- Time management in a loop " while (< (elapsed) endtime "
3- Patterns with infinite repetition “(make-cycle keys)”
4- Launching tasks (“sprout” in Grace) with time shift “(piano-phase stoptime keynums .167)” followed by “(piano-phase stoptime keynums .170)” which is fundamental in the Reich’s piece.
5- Calling midi functions with various parameters “(mp:midi :key (next pat) :dur rate :amp 0.8 )”

In Grace (Scheme), it’s really very very simple (a lot of things are missing, but the language remains very concise).

Looking forward to your answers.
Thanks in advance.

Translated from french with www.DeepL.com/Translator (free version)

This is cool: the music, ways to approach things in OM, showcase for the Patterns lib :+1:
Luckily it’s corona time, so here we go:

… (I don’t know if it’s possible anyway) …

… is always a great way to provoke some work :wink: … Of course it’s possible! Attached is one possible approach, rather close to the example in reich.cm.

1- The musical notation “(e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5)” instead of (6400 6600…)

#'n->mc

2- Time management in a loop " while (< (elapsed) endtime "

This issue needs “re-phrasing” in OM, as OM doesn’t have the automatic time management CM provides (ie #'now, wait…), but baring infinite compositions it’s easy to precompute values.

3- Patterns with infinite repetition “(make-cycle keys)”

OMs Patterns lib provides the same features (based on CMs item-streams)

4- Launching tasks (“sprout” in Grace) with time shift “(piano-phase stoptime keynums .167)” followed by “(piano-phase stoptime keynums .170)” which is fundamental in the Reich’s piece.

not restricting to/providing real-time, CMs #'sprout would be the same as listing things together

5- Calling midi functions with various parameters “(mp:midi :key (next pat) :dur rate :amp 0.8 )”

OM supports anything midi. However, i find using OMs built in classes directly: note, chord-seq… - much more ‘musical’, having OM translate to MIDI.

Have fun!
reich - piano phase.omp (199.8 KB)

Anders, very impressive, thanks ever so much !

I need some time to understand your code, but it’s very exciting.

I’ll certainly have fun.