ScratchML, like GML, is an XML-based format for storing information about the position of the record and crossfader during a scratch performance.
This is a “beta” release of the .SML file format, with sample data for 1 turntable and 1 crossfader. The format is designed to accomodate multiple turntables and crossfaders and a wide variety of data capture techniques, but we’ve only field-tested it against the basic 1 deck + 1 mixer scratch setup, which is what we were working with this weekend.
The two most important fields are:
Sample data produced by LM4K, mostly baby scratches and flares: XML / JSON
Spec + commentary:
ScratchML r6 beta spec:
<sml> | |
<!-- | |
# SCRATCH MARKUP LANGUAGE, WORKING DRAFT | |
http://scratchml.com | |
* version -- minor versions for small changes, major for incompatibilities | |
* info -- general file metadata: author info, client info etc. | |
* turntable - hardware metadata | |
* mixer -- hardware metadata | |
* audio -- info + raw data for audio recording, or links to external files | |
* transcription -- turntable markup (TTM)-style notation of fader cuts & record movements | |
* performance -- actual recorded fader/hand event data | |
most fields are optional. you can have a performance without a transcription, and vice versa. | |
no xml attributes are used, to aid in json/xml conversion. | |
all times are in milliseconds. | |
todo: pitch, per-channel volume, fader contour | |
--> | |
<version> | |
<major>0</major> | |
<minor>6</minor> | |
</version> | |
<info> | |
<client>Cutcapture 9000 version 1.1</client> <!-- sml generator --> | |
<author> | |
<name>Qbert</name> | |
<url>http://www.djqbert.com</url> | |
<location> | |
<description>San Francisco, CA</description> | |
<latlon>32.44, 22.34</latlon> | |
</location> | |
</author> | |
<description>Crab/flare combo, 1998</description> <!-- title/commentary --> | |
<tags>crab, flare, old</tags> <!-- comma-separated keywords --> | |
<created>2012-07-17T09:24:17Z</created> <!-- ISO-8601 --> | |
<url>http://scratchml.com/data/340923</url> <!-- added on upload if not present --> | |
</info> | |
<audio> | |
<sample> | |
<filename>samples/fresh.wav</filename> <!-- can be a local file, or a URL --> | |
<description></description> <!-- artist + title, break, or sample name --> | |
<!-- the following are used when working with multiple samples over a set --> | |
<deck>left</deck> <!-- which turntable --> | |
<start></start> <!-- when it starts during the performance --> | |
<stop></stop> <!-- when it stops during the performance --> | |
</sample> | |
</audio> | |
<!-- this is the raw version --> | |
<performance> | |
<turntable> | |
<!-- | |
record movement is stored as a list of floats. | |
a 15 second performance at 375 Hz samplerate should be ~85KB | |
a record spinning at 33 1/3 rpm takes 1800 ms to do one rotation | |
so if you store a maximum of two decimal points, that's 500 samples per degree | |
which should be more than enough precision. | |
--> | |
<deck>left</deck> | |
<samplerate>375</samplerate> <!-- in samples per second. every 128 samples @ 48KHz = 375 samples/second --> | |
<data><p>1000.02</p><p>1010.32</p><p>1020.34</p><p>1030.23</p></data> | |
</turntable> | |
<mixer> | |
<fader> | |
<hamster>true</hamster> | |
<data> | |
<!-- | |
0 means the fader is completely to the left | |
1 means the fader is completely to the right | |
normally 0 means that you can hear the left turntable | |
when hamster is true, 0 means you can hear the right turntable | |
--> | |
<event> | |
<t>0</t> | |
<p>0</p> | |
</event> | |
<event> | |
<t>1736</t> | |
<p>.5</p> | |
</event> | |
<event> | |
<t>2362</t> | |
<p>1</p> | |
</event> | |
<event> | |
<t>3034</t> | |
<p>.5</p> | |
</event> | |
</data> | |
</fader> | |
</mixer> | |
</performance> | |
<!-- this is transcribed version --> | |
<transcription> | |
<turntable> | |
<deck>left</deck> | |
<!-- there are multiple labelled scratches --> | |
<scratch> | |
<name>flare</name> | |
<curve> <!-- curve: baby, scribble, etc (derivative = 0) --> | |
<t>0</t> | |
<p>0</p> | |
</curve> | |
<line> <!-- lines: transformer, chirps (derivative = (next-cur)/length) --> | |
<t>1000</t> | |
<p>1000</p> | |
</curve> | |
</scratch> | |
</turntable> | |
<mixer> | |
<fader> | |
<!-- move means the fader is cutting in or out --> | |
<move> | |
<t>1000</t> | |
<p>center</p> | |
</move> | |
<!-- a click is a very short, temporary move --> | |
<click> | |
<t>1500</t> | |
<p>right</p> | |
</click> | |
<!-- a crab is a sequence of evenly spaced clicks --> | |
<crab> | |
<p>right</p> | |
<clicks>3</clicks> | |
<t> | |
<start>3000</start> | |
<end>3400</end> | |
</t> | |
</crab> | |
</fader> | |
</mixer> | |
</transcription> | |
</scratch> |
The ScratchML.com database can also automatically convert from XML to JSON for use in javascript visualizations. Change the .xml file extension to .json, and optionally pass a JSONp ?callback= parameter, like this.
During Art Hack Day we converted SML to OSC and broadcast it over the wifi for realtime visualizations — more info to come about that.
COMMENTS
The expressions published in this site are all in the public domain. You may enjoy, use, modify, snipe about and republish all F.A.T. media and technologies as you see fit.
[…] ScratchML Data Spec @ F.A.T.. ScratchML, like GML, is an XML-based format for storing information about the position of the record and crossfader during a scratch performance. […]