Prototype Implementation for the
XML Specification modeling Time, Positions and Parts of Audio Waveforms

Some code written in the SuperCollider3 language to demonstrate a subset of the proposed features.

version 0.1

Scope of this Document

The software described here demonstrates some features of the proposed XML Specification modeling Time, Positions and Parts of Audio Waveforms. The prototype implementation is called the 'SFSlice classes', it is written in der SuperCollider3 language and runs on top of the BBCut class library.

Download

1) Download the archive file spec-slices-0_1.zip from http://swiki.hfbk-hamburg.de:8888/MusicTechnology/uploads/786/spec-slices-0_1.zip.

2) The BBCut classes by Nick Collins are available at http://www.cus.cam.ac.uk/%7Enc272/code/bbcut.tar.gz (old version 1.3.1 is required).

Installation

0) Make sure that SuperCollider3 is installed on your system.

1) Uncompress archive spec-slices-0_1.zip into a directory of your choice. This will create the files proposal.html and prototype.html in the directory you have chosen, together with 4 subdirectories:

  1. ./classes/: This directory contains the class files of the prototype, including additional utility classes taken from a current development version of the XML parser classes for SuperCollider.

  2. ./examples/: Example files to run the prototype.

  3. ./uml/: The UML model file for the software (optional, not required for running the prototype). All classes have been developed using a model-based approach with the Unified Modeling Language (UML), see UML templates for SuperCollider.

  4. ./img/: Image files used by file proposal.html.

2) Move both subdirectories sfslice and util from the classes-directory to a location in the SuperCollider class library path (one of the directories specified in ~/.sclang.cfg), or add the full path of the classes-directory to ~/.sclang.cfg.

3) To install the BBCut classes:

This installation procedure has been tested with SuperCollider3, built from CVS on 2005-08-25, running on a 2.6-kernel Debian system.

Running the Prototype

To test whether the installation was successful:

Using the class library without XML

The classes in the SFSlice library also provide functionality that can directly be accessed from the SuperCollider language. This example shows how slices are created from SuperCollider code and are combined in a cuelist to get played:

// --- Usage examples for the prototype implementation of
// --- XML Specification of Time, Positions and Parts of a Waveform 
// Jens Gulden 08/2005, jgulden@cs.tu-berlin.de

// --- start server ---
Server.local.boot;

// -----------------------------------------------------------------

// TEST 1: short form 
//         (SFSliceInstrument plays first Cuelist by default.)

SFSliceInstrument.new("examples/slice.xml").verbose_(true).play;

// or even shorter, without console output:

SFSliceInstrument.new("examples/slice.xml").play;

// -----------------------------------------------------------------

// TEST 2: equal to test 1, but in more detailed steps

i = SFSliceInstrument.new;
i.loadXML("examples/slice.xml");
c = i.getCuelist("song");
c.play(1.0, true);

// -----------------------------------------------------------------

// TEST 3: using the class library from SuperCollider language, 
//         without XML

p = "examples/audio/NosNodOrr.wav";
f = SF3(p, 1000);

s = SFSlice.newMaster(f)
           .slice("start", "20.55839s")   // (each sliceX() returns
           .sliceTo("leer", "27.69878s")  // the parent-slice again)
           .sliceTo("zwischen", "34.83637s")
           .sliceRange("wummer", "33.06s", "34.82s")
           .sliceRange("basis", "34.9s", "49.16338s")
           .sliceRange("funny", "49.19s", "56.33s")
           .sliceRange("melody1", "56.35s", "63.46s")
           .sliceTo("melody2", "70.8s")
           .sliceTo("melody3", "77.8371s")
           .sliceTo("end", 1.0);

c = SFCuelist.new(s)
.cue("start")
.cue("zwischen")
.cue("wummer", 4)
.cue("basis")
.cue("funny")
.cue("melody1", 2)
.cue("melody2")
.cue("basis")
.cue("melody1", 2)
.cue("melody3")
.cue("wummer", 8)
.cue("funny")
.cue("melody1")
.cue("melody2")
.cue("melody3")
.cue("end")
.cue("melody2")
.cue("melody1")
.cue("melody2")
.cue("melody3")
.cue("melody1", 2)
.cue("melody2")
.cue("end")
.play;



Authors so far:
2005-09-16 Jens Gulden, jgulden@cs.tu-berlin.de