Transcribe! Help : Transferring XSC files between Mac & Windows, and importing XSC files into spreadsheets


Transcribe! uses a comma-delimited text format for its saved XSC transcription files. The content of these files is basically the same whether on Macintosh or Windows.

This means that XSC transcription files can be transferred between the Mac and Windows versions of Transcribe! : if you have placed lots of markers in a transcription you are working on, and then you want to continue work on a different species of computer then you can copy the XSC file to the other machine (and the Sound file too of course) and carry on.

Also, it is possible to import marker position data into other programs such as spreadsheets. I have had communications from people using Transcribe! to analyze timings who find this useful.

Transferring XSC files between Mac & Windows

First you should copy the Sound file to the destination machine (or reload it from audio CD or whatever). It is best if the Sound file is identical on the two machines. Since marker positions are recorded as sample numbers, any difference in length of lead-in will cause misalignment of markers.

Now copy the XSC transcription file to the destination machine. You may need to tweak its name so that Transcribe! can recognise it. You must ensure that the name of the XSC transcription file ends with the four characters ".xsc" (upper or lower case).

From Windows to Mac : the file should already have the extension "xsc" but if it hasn’t, rename the file so the last four characters of its name are ".xsc"

From Mac to Windows : You probably will need to rename the file so the last four characters of its name are ".xsc". Note that in Windows Explorer you should switch OFF "View - Folder Options - View - Hide file extensions for known file types" to enable you to see and change file extensions.

Now start Transcribe! on the destination machine and use "File - Open" to load the XSC file. It is likely that this will get you a dialog saying "Unable to load Sound file". Don’t worry : this means that the transcription file has loaded ok, but Transcribe! has been unable to locate the Sound file which goes with it. The name and location (folder) of the Sound file are recorded in the transcription file but the folder information will not transfer between different machines as the filing system layouts are unlikely to be the same. So Transcribe! will look for a Sound file of the right name in the same folder as the transcription file itself, and if it isn’t there you get the dialog described. All you have to do is use the "Reload Sound File" command to locate the sound file and your markers should now reappear and all is well.

On the Mac it is a good idea now to use "Save As" to save this transcription under a new name or in a new location. This is because the XSC file you copied from Windows does not have the correct Mac ‘type’. If you "Save" to the same file then the wrong type will remain, whereas if you "Save As" then Transcribe! creates a brand new file of the correct type. The correct "creator type" and "file type" for a transcription file should both be ‘7SSt’. Transcribe! on the Mac takes special steps to be able to load files of the wrong ‘type’ as long as their names end with ".xsc". Finder doesn’t know about this though, so you can’t open a wrongly-typed XSC file by double-clicking it, which is a nuisance.

Loading XSC files into Spreadsheets

Some people use Transcribe! for technical analysis of timing and find it useful to load marker timing information into a spreadsheet. The best way to do this will depend on what spreadsheet you are using, but here are a couple of tips:

On Mac : Using Excel, the "File - Open" command has an option to "Show Files of Type - All Files". If you select this then you will be able to load an XSC file directly. In the Text Import Wizard on Step 1 under "Original Data type" ensure "Delimited" is selected, then press "Next". On Step 2 select "Comma" as your "Delimiters Type" and in the text qualifier popup select "None", then press "Next" and "Finish". Alternatively if you have a resource editing tool such as ResEdit or Resourcerer then you can change the file’s type to ‘TEXT’ and its creator to ‘ttxt’. This makes it look like a SimpleText file which you can load into SimpleText by double-clicking.

On Windows : rename the XSC file to give it the extension ".csv" (instead of ".xsc") : this is a standard extension indicating comma-separated text fields (but see the note above about Windows Explorer and file extensions). You may well find that double clicking it will now open it in your spreadsheet. If not, start your spreadsheet and either Open or Import the file. Alternatively you may get a result by opening the file in Notepad or Wordpad, Copy the contents to the clipboard and Paste into your spreadsheet.

XSC File Format

When you load an XSC file into a spreadsheet or text editor you will see its structure which is very simple and uses mnemonic names so is fairly self explanatory. It is divided into sections. We only document here the fields you're likely to be interested in, but if you want to understand any of the others you’ll work them out easily enough.

In the "Main" section you may be interested in the sound file information.
"SoundFileName" give the file name in short and long form.
"SoundFileInfo" gives file type, file size in bytes, sample type, sample rate, sample count, duration in seconds.

Here is a typical (but short) "Markers" section.

SectionStart,Markers
Howmany,8
S,23623,1,A,0
B,38947,1,,0
B,48469,1,,0
B,60249,1,,0
M,71835,1,A2,0
B,83296,1,,0
B,95514,1,,0
B,108719,1,,0
SectionEnd,Markers

It tells you how many markers there are, then the markers themselves, one per line. Each line starts with "S", "M" or "B" indicating Section, Measure or Beat marker, then a number giving the location of the marker (as a sample number - divide by the sample rate to get the time), then a 1 or 0 indicating whether or not the marker label is determined automatically (as opposed to being typed in by the user), then the label text itself. Then there is a number indicating automatic subdivision : 0 means same-as-previous, 1 means no, 2 or more means divide into this many subdivisions.

There is one more issue which you only need to worry about if you type in marker names which use the characters ‘,’ or ‘\’. Clearly Transcribe! cannot allow the ‘,’ character to appear within any field as it would be mistaken for a field delimiter when reading the file. Therefore Transcribe! saves any ‘,’ within a field as the pair ‘\C’ and saves any ‘\’ as the pair ‘\\’. Transcribe! then performs the reverse translation on loading.


Tips for working with transcription (XSC) files in spreadsheets

Once you have loaded an XSC file into a spreadsheet program there are various things you can do with it which might not immediately occur to you if you are not familiar with spreadsheets.
I will give here some examples of the kinds of things you can do, just to stimulate your imagination.
Microsoft Excel is the spreadsheet I will discuss here, but others are similar.
The most powerful way of manipulating spreadsheets is with "macros" which are in fact programs you can write in Visual Basic as part of your spreadsheet. Before starting on these, though, here is an example of the sort of thing you can do without needing macros.

TIP: To remove all markers in one category (e.g. beat markers) while leaving others unaffected.
1. Delete all rows from the spreadsheet except the markers.
2. Select the columns with data in - that is, click on the header of column A and shift-click on the header of the last column with data in (column E, currently).
3. Select "Sort" on the "Data" menu, and tell it to sort on column A - this is the column with "S", "M" or "B" in it, according to marker type. This will sort in alphabetical order so it will group all beat markers together, then all measure markers, then sections.
4. Select and delete the rows containing the category of markers you want to lose (e.g. all beat markers).
5. Select and sort again, but this time sort on column B which contains the sample numbers. This will restore correct order to the remaining markers.

What fun. But for anything more complicated we will need the full power of macros. This is genuine computer programming but don't let that put you off. The water is deep but you don't need to do more than dip your toes in it to get results. Even experts learn a new programming language by starting with examples written by others, then modify the examples to do what they want.

General tips on Excel / Visual Basic macros.
- I'm not sure which versions of Excel support this - whether you need the "Professional" edition or not. Don't ask me - RTFM (Read The Manual).
- You may need to run the Excel "Setup" program again (from the Excel installation disk), do a Custom Setup and tell it to install the Visual Basic Help for Excel. That way, you will be able to access Help about the functions you can call in Visual Basic, which "do things" to your Excel spreadsheet.
- You may need to "unhide" your "Personal Macro Workbook" before Excel will let you edit the macro (this is done by selecting "unhide" in the "Window" menu). I think you can also get to the same point by going directly into Visual Basic Editor from the Tools:Macro:Visual Basic Editor. Then once you are in Visual Basic Editor you select Tools:Macros then select the relevant workbook from those listed in Macros In... (down the bottom of window), select your macro and select edit.
- I am not an expert on Excel or Visual Basic. You are welcome to use the information and example programs here in any way you like, but if you run into trouble using Excel then that is not a Transcribe! issue and I do not offer technical support on Excel. Buy one of the many Excel books you will find in your local bookstore. Please let me know if you spot bugs in these examples, however.

Here's an easy way to create a new macro:
- Select Tools - Macro - Record New Macro. Give it a name corresponding to what you want it to do.
- You are now recording, and there is a little window on top with a square "stop" button. Press it to stop recording.
- Select Tools - Macro - Macros. You should get a window showing a list of macros including this new one (by name). Click once on its name, then hit the Edit button. You should get the Visual Basic editor, showing something like this:
Sub DeleteBeats()
' DeleteBeats Macro
End Sub
Lines beginning with single-blip are comments. The macro is otherwise empty because we didn't type anything while we were recording.
Now you can put whatever VB program you want between "Sub" and "End Sub" to make your macro do what you want. Try copying in the DeleteBeats example below.
- Run your macro by selecting Tools - Macro - Macros and double click the one you want to run.

Now here are some example macros. They all assume that you have first deleted all non-marker lines from your spreadsheet.

' DeleteBeats removes the rows corresponding to beat markers
Sub DeleteBeats()
Dim lineNum As Long
Dim markerType As String
' loop thru the lines. terminate on first one which does not
' start with "S" "M" or "B" (i.e. which is not a marker).
lineNum = 1
Do While True
markerType = Cells(lineNum, 1).Value
If markerType <> "S" And markerType <> "M" And markerType <> "B" Then Exit Do
' so we have a line which is a marker. if it is a beat marker then
' delete the row, and note that in this case we do not increment lineNum
If markerType = "B" Then
Rows(lineNum).Delete
Else
lineNum = lineNum + 1
End If
Loop
End Sub

' GenerateTimecode adds another entry at the end of each marker line,
' giving the timecode in the form hh:mm:ss.00
' It assumes sample rate of 44100 (CD rate), which you would obviously
' need to change if it wasn't right. If you really want to get clever then
' you could work on a complete XSC file and read the sample rate from the
' "SoundFileInfo" line, but then you would also have to write stuff to
' locate the "SectionStart Markers" to find where to start work.
' WARNING : BEFORE RUNNING THIS, SET THE NUMBER FORMAT FOR THE
' DESTINATION COLUMN TO "Text" ELSE EXCEL MAY CRASH!!!
' This is done by select whole column, right click on it, "Format Cells",
' "Number", "Text". I tried to do this within the macro by
' Cells(lineNum, columnNum).NumberFormat = "Text"
' but this causes a runtime error - anyone know the answer? Please tell me.
Sub GenerateTimecode()
Dim lineNum As Long
Dim markerType As String

Dim sampleRate As Double
sampleRate = 44100 ' or so we assume

Dim columnNum As Long
columnNum = 6 ' the column where we will put the timecodes

' loop thru the lines. terminate on first one which does not
' start with "S" "M" or "B" (i.e. which is not a marker).
lineNum = 1
Do While True
markerType = Cells(lineNum, 1).Value
If markerType <> "S" And markerType <> "M" And markerType <> "B" Then Exit Do
' so we have a line which is a marker. add the timecode.
Dim markerPos100 As Long ' marker pos in 100ths of a second
markerPos100 = Int((Cells(lineNum, 2).Value / sampleRate) * 100 + 0.5)
Dim hours, mins, secs As Long
hours = 0
Do While markerPos100 >= 360000
hours = hours + 1
markerPos100 = markerPos100 - 360000
Loop
mins = 0
Do While markerPos100 >= 6000
mins = mins + 1
markerPos100 = markerPos100 - 6000
Loop
secs = 0
Do While markerPos100 >= 100
secs = secs + 1
markerPos100 = markerPos100 - 100
Loop
' and markerPos100 has the remaining 100ths

Cells(lineNum, columnNum).Value = Format(hours, "00") + ":" + Format(mins, "00") _
+ ":" + Format(secs, "00") + "." + Format(markerPos100, "00")

lineNum = lineNum + 1
Loop
End Sub

Return to Contents page