scamp package

SCAMP: A Suite for Computer-Assisted Music in Python. SCAMP is an computer-assisted composition framework in Python designed to act as a hub, flexibly connecting the composer-programmer to a wide variety of resources for playback and notation.

Modules:

scamp.instruments

Module containing user-facing playback classes: Ensemble, ScampInstrument, and NoteHandle/ ChordHandle

scamp.note_properties

Module containing the NoteProperties object, which is a dictionary that stores a variety of playback and notation options that affect a given note.

scamp.performance

Module containing the PerformanceNote, PerformancePart, and Performance classes, which represent transcriptions of notes played by a group of ScampInstrument objects.

scamp.playback_adjustments

Module containing classes for defining adjustments to the playback of note parameters, as well as the PlaybackAdjustmentsDictionary, which defines how particular notations should be played back.

scamp.playback_implementations

Module containing the abstract base class PlaybackImplementation, as well as several of its concrete subclasses: SoundfontPlaybackImplementation, MidiPlaybackImplementations, and OSCPlaybackImplementation.

scamp.quantization

Module containing classes and functions related to the quantization of performances.

scamp.score

Module containing classes that deal with music notation.

scamp.session

Module containing the Session class, which is the central hub through which nearly all of SCAMP's functionality flows.

scamp.settings

Module containing the main settings classes: PlaybackSettings, QuantizationSettings, and EngravingSettings, as well as TempoSettings and GlissandiSettings, which are part of EngravingSettings.

scamp.spanners

Module containing start and stop spanner objects in SCAMP, such as StartHairpin, StopHairpin, StartSlur and StopSlur.

scamp.spelling

Module containing the SpellingPolicy class, which describes how pitches should be spelled.

scamp.test_run

Simple module with a play() function that can be used to verify that SCAMP is installed successfully.

scamp.text

Module containing utilities for representing text in SCAMP, currently containing the StaffText class.

scamp.transcriber

Module containing the Transcriber class which records the playback of a group of ScampInstrument objects to create a Performance

scamp.utilities

Various and sundry utility functions used by SCAMP.

Public-Facing API (result of import *):

Clock([name, parent, initial_rate, ...])

Recursively nestable clock class.

MetricPhaseTarget(phase_or_phases[, ...])

Class representing a particular point in a (beat or measure) cycle.

TempoEnvelope([levels, durations, ...])

A subclass of Envelope that is specifically designed for representing changing tempo curves.

current_clock()

Get the Clock active on the current thread (or None if none is active)

fork(process_function[, args, kwargs, name, ...])

Spawns a parallel process running on a child clock of the currently active clock.

fork_unsynchronized(process_function[, ...])

Spawns a parallel process, but as an asynchronous thread, not on a child clock.

wait(dt[, units])

Calls wait() on the clock that is currently active on the thread.

wait_for_children_to_finish()

Calls wait_for_children_to_finish() on the clock that is currently active on the thread; generally, this is called when there are child clocks running and we want to keep the main script alive while the action takes place on the child clocks.

wait_forever()

Calls wait_forever() on the clock that is currently active on the thread; generally, this is called when there are child clocks running and we want to keep the main script alive while the action takes place on the child clocks.

Envelope([levels, durations, curve_shapes, ...])

Class representing a piece-wise exponential function.

EnvelopeSegment(start_time, end_time, ...)

A segment of an envelope, with the ability to perform interpolation and integration.

get_available_midi_input_devices()

Probes the available devices for midi input or output

get_available_midi_output_devices()

Probes the available devices for midi input or output

get_port_number_of_midi_device(device_name, ...)

Get the port number of a given device based on its a fuzzy string match of its name.

print_available_midi_input_devices()

Prints a list of available ports and devices for midi input or output

print_available_midi_output_devices()

Prints a list of available ports and devices for midi input or output

ChordHandle(note_handles, intervals)

This handle, returned by instrument.start_chord, allows us to manipulate a chord that we have started, (i.e.

Ensemble([default_soundfont, ...])

Host for multiple ScampInstrument objects, keeping shared resources, and shared default settings.

NoteHandle(note_id, instrument)

This handle, which is returned by instrument.start_note, allows us to manipulate the note that we have started, (i.e.

ScampInstrument([name, ensemble, ...])

Instrument class that does the playing of the notes.

NoteProperties(*args, **kwargs)

Class that holds information about any and all playback or notational details for a note or chord aside from its pitch, volume and duration.

Performance([parts, tempo_envelope])

Representation of note playback events, usually a transcription of the notes played by an Ensemble.

PerformanceNote(start_beat, length, pitch, ...)

Represents a single note played by a ScampInstrument.

PerformancePart([instrument, name, voices, ...])

Transcription of the notes played by a single ScampInstrument.

NotePlaybackAdjustment([pitch_adjustment, ...])

Represents an adjustment to the pitch, volume and/or length of the playback of a single note

ParamPlaybackAdjustment([multiply, add])

Represents a multiply/add playback adjustment to a single parameter.

MIDIStreamPlaybackImplementation([...])

Playback implementation that sends an outgoing MIDI stream to an external synthesizer / program

OSCPlaybackImplementation(port[, ...])

Playback implementation that sends outgoing OSC messages to an external synthesizer / program

PlaybackImplementation()

Abstract base class for playback implementations, which do the actual work of playback, either by playing sounds or by sending messages to external synthesizers to play sounds.

SoundfontPlaybackImplementation([...])

Playback implementation that does Soundfont playback, via the MIDI protocol.

BeatQuantizationScheme(length, divisors[, ...])

Scheme for making a decision about which divisor to use to quantize a beat

MeasureQuantizationScheme(beat_schemes, ...)

Scheme for quantizing a measure, including beat lengths and which beat divisors to allow.

QuantizationScheme(measure_schemes[, loop])

Scheme for quantizing a PerformancePart or Performance

TimeSignature(numerator, denominator[, ...])

Class representing the time signature of a measure

Measure(voices, time_signature[, ...])

Representation of a single measure within in a Staff

NoteLike(pitch, volume, written_length, ...)

Represents a note, chord, or rest that can be notated without ties

Score([parts, title, composer, tempo_envelope])

Representation of a score in traditional western notation.

Staff(measures[, name])

Representation of a single staff of a western-notated score

StaffGroup(staves[, name, clef_choices])

Representation of a StaffGroup (used for the multiple staves of a single instrument)

Tuplet(tuplet_divisions, normal_divisions, ...)

Representation of a Tuplet object within a single voice of music.

Voice(contents, time_signature)

Representation of a single voice within a single measure of a single staff of music.

Session([tempo, default_soundfont, ...])

A Session combines the functionality of a master Clock, an Ensemble, and a Transcriber.

engraving_settings

Instance of EngravingSettings containing the actual engraving defaults to be consulted

playback_settings

Instance of PlaybackSettings containing the actual playback defaults to be consulted

quantization_settings

Instance of QuantizationSettings containing the actual quantization defaults to be consulted

ChangePedal([label])

Change piano pedal spanner.

StartBracket([label])

Start bracket spanner (e.g.

StartDashes([label])

Start dashes spanner.

StartHairpin([label])

Start hairpin spanner.

StartPedal([label])

Start piano pedal spanner.

StartPhrasingSlur([label])

Phrasing slurs are an additional type of slur available in LilyPond useful for creating long, overarching slurs that can have smaller, regular slurs inside of them.

StartSlur([label])

Start slur spanner type.

StartTrill([label])

Start trill spanner.

StopBracket([label])

Stop bracket spanner.

StopDashes([label])

Stop dashes spanner.

StopHairpin([label])

Stop hairpin spanner.

StopPedal([label])

Stop piano pedal spanner.

StopPhrasingSlur([label])

Stop spanner for a phrasing slur.

StopSlur([label])

Stop slur spanner type.

StopTrill([label])

Stop trill spanner.

SpellingPolicy([step_alteration_pairs])

Object that translates pitches or pitch classes to the actual spelling used in a score

StaffText(text[, italic, bold, placement])

Represents text that will be attached to the staff at a given note.

Transcriber()

Class responsible for transcribing notes played by instruments into a Performance.