Tutorial

Work through these in order for a guided tour of the framework.

  1. Hello World — Plays a C major arpeggio.

  2. Tempo Change — Same as Hello World example, but repeatedly, with changing tempi.

  3. Blocking False — By default play_note blocks execution until the note is done playing.

  4. 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.

  5. Random Durations and Rests — Loops a C major arpeggio twice, but with random, floating-point durations.

  6. Generating Notation — Plays a simple C Major arpeggio, and generates notation for it.

  7. 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

  8. Quantization of Random Floating-Point Durations — Similar to the “Random Durations and Rests” example, except that now we generate notation.

  9. 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.

  10. Multi-Part Music — Plays two coordinated but independent parallel parts, one for oboe and one for bassoon.

  11. 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.

  12. Envelopes (basic) — Create and plot two simple envelopes, one with evenly-spaced linear segments, and one with uneven, curved segments.

  13. Envelopes (advanced) — A more comprehensive list of ways to construct and modify Envelopes.

  14. Glissando from Envelope — Plays a glissando by passing an Envelope to the pitch parameter of play_note.

  15. Envelope Shorthand — Plays two glissandi by passing lists instead of envelopes to the pitch argument of play_note.

  16. 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”.

  17. Volume Envelope — Plots an envelope representing a forte-piano-crescendo dynamic, and then uses it to affect the dynamics of a note’s playback.

  18. Microtonal Playback and Notation — Plays a few microtonal chords and notates them, turning on exact microtonal annotations.

  19. Playback Implementations — Shows how to create parts that use different implementations for playback.

  20. 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.

  21. Pitch Spelling — Demonstrates the ability to define note pitch spelling using the optional properties argument to “play_note”.

  22. Staff Text — Demonstrates various ways of adding text annotations to notes that are played.

  23. Special Notations — Ornaments, tremolo and other single-note notations.

  24. OSC to SuperCollider — Playing back notes by sending OSC messages to the SuperCollider, which receives them and spawns Synths in response.

  25. Live MIDI input and output — Demonstration of receiving and sending live midi input to and from a midi keyboard.

  26. Computer Keyboard Input — Demonstration of receiving computer keyboard events and using them to play notes based on the key number.

  27. Mouse Input — Demonstration of receiving computer mouse events and using them to play notes based on x and y position.

  28. 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.

  29. Spanners — Demonstration of starting and stopping various spanners, such as slurs, hairpins, trills, brackets, and pedal lines.