|
Piano Phase - Phrases at
different speeds |
Reload
page to restart example
|
Steve Reich's composition
Piano Phase requires two pianists to play the same phrase together, one
slightly faster than the other at times. This program immitates that by
using two SoundCipher instances that run at different tempi.
The import statement make the SoundCipher classes available to this program.
Two isntances of the SoundCipher class are created; one for each of the piano parts.
The
parts are set to two slightly different speeds - 80 and 82 beats per
minute - and set to repeat 16 times so the phase differences becomes
noticable over time.
The phrase data is created next. The
pitches for the phrase are expicity laid out. Because the dynamic and
durations are similar for each note a for-loop is used to fill the data
arrays for these parameters.
The phrase data is passed to both
parts 1 and 2 for playback. They will start at the same time but
because of the different tempi they will gradually shift out of time
(out of phase) with one another. This creates an interesting effect
widely used by Reich and some other minimalist composers in the latter
half of the 20th century. Here it demonstrates that SoundCipher can
accommodate multiple independent parts, and share data between them. |