Class: GapSound

Environment: Siren
Superclass: Siren.VirtualSound
Category: Music-Sound
Instance variables: cutList
Indexed variables: objects

An instance of GapSound can be used to represent a sound with samples deleted from it (i.e., a gap).
It uses its cut list instance variable to maintain sample ranges that have been deleted from the sound that comprises it (the source).
It responds to sampleAt: and sampleAt:put: just like other sounds, but stores only its cut list on files unless explicitly told to store samples.

Instance Variables:
cutList the list of deleted sections by sample index i.e., pointers denoting sections that have been deleted. For example, having a cutList of (1000 2000) means that samples (1000, 2000] have been virtually cut.

private

mapSampleIndex: index
Map the given sample index according to the cut list (i.e., deleted sections) of the receiver.

testing

hasGaps
Answer whether the receiver has any gaps.

accessing

allocateData
no-op

cutFrom: startSample to: stopSample
Cut the designated section from the receiver.

samples

MetaClass: GapSound class

instance creation

on: source cutFrom: start to: stop
Answer a CompositeSound derived from the argument missing the given range.

examples

exampleView
Open a sound view on a ramp with a chunk cut out of it.