Tutorial
Work through these in order for a guided tour of the framework.
Hello World — Plays a C major arpeggio.
Tempo Change — Same as Hello World example, but repeatedly, with changing tempi.
Blocking False — By default play_note blocks execution until the note is done playing.
Play Chord — Demonstrates ScampInstrument.play_chord by playing a famous progression, and then playing it a few more times randomly up and down the keyboard.
Random Durations and Rests — Loops a C major arpeggio twice, but with random, floating-point durations.
Generating Notation — Plays a simple C Major arpeggio, and generates notation for it.
Time Signatures — Plays a simple C Major arpeggio, and generates notation for it in three different ways: - with a 3/8 time signature - with a 3/8 time signature for the first measure followed by 2/4 - with alternating 3/8 and 2/4 time signatures - with a list of bar lengths determining time signatures
Quantization of Random Floating-Point Durations — Similar to the “Random Durations and Rests” example, except that now we generate notation.
Simplified Quantization — Same as last example except that we see two different levers for simplifying the notation: max_divisor (which defaults to 8) sets a hard cap on how finely we can divide the beat.
Multi-Part Music — Plays two coordinated but independent parallel parts, one for oboe and one for bassoon.
Nested Tempi — Music running with nested tempi: a trombone plays a cyclic quarter-note pattern on the session’s accelerating pulse, while a trumpet, forked onto a child clock, plays a similar eighth-note pattern.
Envelopes (basic) — Create and plot two simple envelopes, one with evenly-spaced linear segments, and one with uneven, curved segments.
Envelopes (advanced) — A more comprehensive list of ways to construct and modify Envelopes.
Glissando from Envelope — Plays a glissando by passing an Envelope to the pitch parameter of play_note.
Envelope Shorthand — Plays two glissandi by passing lists instead of envelopes to the pitch argument of play_note.
Start and End Note — Plays notes by calling start_note (or start_chord) and then manipulating them afterward, instead of defining the course of the note from the beginning with “play_note”.
Volume Envelope — Plots an envelope representing a forte-piano-crescendo dynamic, and then uses it to affect the dynamics of a note’s playback.
Microtonal Playback and Notation — Plays a few microtonal chords and notates them, turning on exact microtonal annotations.
Playback Implementations — Shows how to create parts that use different implementations for playback.
Note Properties — Shows how the fourth (optional) properties argument to “play_note” can be used to affect other aspects of playback and notation, such as articulation and noteheads.
Pitch Spelling — Demonstrates the ability to define note pitch spelling using the optional properties argument to “play_note”.
Staff Text — Demonstrates various ways of adding text annotations to notes that are played.
Special Notations — Ornaments, tremolo and other single-note notations.
OSC to SuperCollider — Playing back notes by sending OSC messages to the SuperCollider, which receives them and spawns Synths in response.
Live MIDI input and output — Demonstration of receiving and sending live midi input to and from a midi keyboard.
Computer Keyboard Input — Demonstration of receiving computer keyboard events and using them to play notes based on the key number.
Mouse Input — Demonstration of receiving computer mouse events and using them to play notes based on x and y position.
OSC Listening — Run osc_listener.py first, which uses Session.register_osc_listener to listen for OSC messages and play back notes and horrific bagpipe clusters.
Spanners — Demonstration of starting and stopping various spanners, such as slurs, hairpins, trills, brackets, and pedal lines.