Table Of Contents

XStick(TM) File Format

XStick(TM) uses a plain ASCII file format, with the default extension of ".stk". This is probably not the most efficient storage method, but the files are not that big, and it make cross-platform use easier.

The beginning of the file summarizes a number of state variables of the saved XStick(TM) session. The first line has a standardized identifying line with the date the file was created. The next line lists the version of XStick(TM). The next line identifies the platform the file was created on, allowing the program to fine tune things when moving from one platform to another.

The next 8 lines describe the state of the "virtual fretboard" when the file was created: the tuning, "cheat" dots, key, chord/scale, what notes were activated, the display mode, and the "TapToStaff" mode (not functional). A sample of these lines is displayed below:


XStick(TM) Data File copyright 1998, Stew Benedict - 01/02/2000
Version: 0.95 BETA
Source Platform: unix
Tname: MelodyHalfBari
Tunings: A3 E3 B2 F#/Gb2 C#/Db2 C1 G1 D2 A2 E3
DotState: 0 1 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0
Fretboard Key: C
Fretboard Chord/Scale: major
Fretboard Notes: 1 0 1 0 1 1 0 1 0 1 0 1
Fretboard Display: Note
TapToStaff: 0

The next 12 lines describe the status of the notation canvas: the key, the highlight color, the staff titles, the time signature, the number of staffs, the current note, rest, and bar numbers, the current index of the free text, and the canvas scroll range. Again an example is illustrated below:


Staff Key: C Major/A Minor
Placement Color: Red
Title 1: Jesu, Joy Of Man's Desiring
Title 2: J.S. Bach, Arranged By Emmett Chapman -1978,1980
Time Signature: 9 8
Number Of Staffs: 4
Current Note: 138
Current Rest: 1
Current Tie: 3
Current Bar: 9
Current Text: 0
Staff Scroll Range: 1060

From here things get real ugly, but it contains all the information necessary to re-create the notation on screen as it was when the file was saved. The notation staff is composed of drawing primitives such as lines and arcs, with text, using both the XStick(TM) font and Helvetica. Here's a small sample:



Staff Components
line 20.0 100.0 835.0 100.0 -fill black -width 0 -tags {stafft0}
text 10.0 100.0 -fill black -anchor center -font "Helvetica 10" -text "1" -tags {stafft0 sfont Hs10 Hp10}
line 20.0 218.0 835.0 218.0 -fill black -width 0 -tags {staffb0}
text 10.0 218.0 -fill black -anchor center -font "Helvetica 10" -text "6" -tags {staffb0 sfont Hs10 Hp10}
line 20.0 109.0 835.0 109.0 -fill black -width 0 -tags {stafft0}
text 10.0 109.0 -fill black -anchor center -font "Helvetica 10" -text "2" -tags {stafft0 sfont Hs10 Hp10}
line 20.0 227.0 835.0 227.0 -fill black -width 0 -tags {staffb0}
text 10.0 227.0 -fill black -anchor center -font "Helvetica 10" -text "7" -tags {staffb0 sfont Hs10 Hp10}
line 20.0 118.0 835.0 118.0 -fill black -width 0 -tags {stafft0}
text 10.0 118.0 -fill black -anchor center -font "Helvetica 10" -text "3" -tags {stafft0 sfont Hs10 Hp10}
line 20.0 236.0 835.0 236.0 -fill black -width 0 -tags {staffb0}
text 10.0 236.0 -fill black -anchor center -font "Helvetica 10" -text "8" -tags {staffb0 sfont Hs10 Hp10}
line 20.0 127.0 835.0 127.0 -fill black -width 0 -tags {stafft0}
text 10.0 127.0 -fill black -anchor center -font "Helvetica 10" -text "4" -tags {stafft0 sfont Hs10 Hp10} line 20.0 245.0 835.0 245.0 -fill black -width 0 -tags {staffb0}
text 10.0 245.0 -fill black -anchor center -font "Helvetica 10" -text "9" -tags {staffb0 sfont Hs10 Hp10}
line 20.0 136.0 835.0 136.0 -fill black -width 0 -tags {stafft0}
text 10.0 136.0 -fill black -anchor center -font "Helvetica 10" -text "5" -tags {stafft0 sfont Hs10 Hp10}
line 20.0 254.0 835.0 254.0 -fill black -width 0 -tags {staffb0}
text 10.0 254.0 -fill black -anchor center -font "Helvetica 10" -text "10" -tags {staffb0 sfont Hs10 Hp10}
text 30.0 90.0 -fill black -anchor center -font "Helvetica 10" -text "1" -tags {stafft0 sfont Hs10 Hp10}
line 20.0 100.0 20.0 254.0 -fill black -width 0 -tags {staffb0}
text 40.0 126.0 -fill black -anchor center -font "Xstick 32" -text "&" -tags {stafft0 sfontXs32 Xp32}
text 40.0 227.0 -fill black -anchor center -font "Xstick 32" -text "?" -tags {staffb0 sfont Xs32 Xp32}
text 65.0 109.0 -fill black -anchor center -font "Xstick 26" -text "9" -tags {timesign0 sfont Xs26 Xp26}
text 65.0 127.0 -fill black -anchor center -font "Xstick 26" -text "8" -tags {timesigd0 sfont Xs26 Xp26}
text 65.0 227.0 -fill black -anchor center -font "Xstick 26" -text "9" -tags {timesign0 sfont Xs26 Xp26}
text 65.0 245.0 -fill black -anchor center -font "Xstick 26" -text "8" -tags {timesigd0 sfont Xs26 Xp26}
line 835.0 100.0 835.0 254.0 -fill black -width 0 -tags {stafft0 bar1}
line 457.0 100.0 457.0 254.0 -fill black -width 0 -tags {stafft0 bar2}
line 20.0 350.0 835.0 350.0 -fill black -width 0 -tags {stafft1}

I could have done it in a more compact form to save space, but this format does lend it self to pretty fast reading and writing. Heck, I'm still nowhere near the size of some of the "large software company in Redmond, WA" stuff! If you are mailing files etc., pkzip et.al. will pack these files down tremendously:

omnibook:~/XStick/files$ zip xstick xstick.stk
adding: xstick.stk (deflated 88%)
omnibook:~/XStick/files$ ls -l
total 34
-rw-r--r-- 1 stew users 29321 Jun 5 08:07 xstick.stk
-rw-r--r-- 1 stew users 3611 Jun 17 15:08 xstick.zip


<< Previous Next >>