Some code written in the SuperCollider3 language to demonstrate a subset of the proposed features.
version 0.1
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.
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).
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:
./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.
./examples/
: Example
files to run the prototype.
./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.
./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
), or add the full path of the
~
/.sclang.cfgclasses
-directory to ~/.sclang.cfg
.
3) To install the BBCut classes:
Uncompress the files from archive
bbcut.tar.gz
into a temporary directory.
Copy the subfolder BBCut
Classes
, which has been created during uncompressing, to a
location in the SuperCollider class library path, or add the BBCut
Classes
directory to ~/.sclang.cfg
(as above).
With a current versions of SuperCollider3 (CVS from
2005-08-25) and BBCut 1.3.1 on Linux it turns out to be necessary to
slighly modify the original BBCut code in order to get it run
without error:
In file BBCut Classes/auxiliary/SF3.sc
,
method 'load
', change line no. 117 from soundFilePath
= Sample.standardizePath(path);
to soundFilePath
= path.standardizePath;
This installation procedure has been tested with SuperCollider3, built from CVS on 2005-08-25, running on a 2.6-kernel Debian system.
To test whether the installation was successful:
Copy the examples
-directory
with all its contents to your home directory.
cd
to your home
directory.
Start emacs with SuperCollider3
extension and a test file:
'emacs -sclang
examples/sfslicetest.sc
'.
Start the JACK audio daemon on your system, if it doesn't run yet.
Move the cursor to the line
'Server.local.boot' and choose SC Lang / Evaluate Line
from the menu.
Highlight a test-section with the
mouse and choose SC Lang / Evaluate Region
from the
menu.
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