Shorten Guide

what is it
how to
advanced
file naming
md5

A PCP Guide to Shorten for those who hate DOS
BASICS:

What is>  SHN | how it works
--------- Shorten
--------- PCP.exe
--------- md5

How to> Decompress a SHN with a double click in windows | how to use it:
--------- Compress a WAV file to SHN with a Right click in windows | how to use it:
--------- Check  MD5 signatures  with a right click in windows | how to use it:
--------- Generate MD5 signatures associated with SHN'd CD layouts | how to use it:

TAKING IT A STEP FURTHER

How to> Decompress multiple SHN with a right click in Windows. | how to use it:
--------- Compress multiple WAV's with a right click in Windows. | how to use it:
--------- Compress multiple WAV files to SHN in sequence and
           delete the original WAVs to conserve hard drive space, in Windows. | how to use it:
--------- Properly name SHN in sequence, for trading.
--------- Generate MD5 signatures for SHN/WAV's with a right click in Windows. | how to use it:



A COMPILATION:
Shorten for Dummies (Using shortn32.exe in Windows 95/98)

This is a guide to decompressing shorten files and compressing
wav files in Win 95/98 using Shorten (shortn32.exe) without having
to mess with DOS on a regular basis.  If you do not already have it,
you can download the PCP copy of shortn32.exe here (hold down
the shift key and click on the link).  This guide is for use with the
older, DOS based version of Shorten, not Shorten for Windows which is
currently available to download from Softsound.

[Win 95 & 98 (were used) as guides, so I hope any differences
between 98 and 95 won't confuse anyone.  Some of the file commands
might have slightly different  names.]  Before you begin, you'll
need to create a folder called "Shorten" in your C: directory.  If
you insist on storing the shortn32.exe somewhere else, alter all
the paths accordingly.

As far as I know, Shorten has not yet been ported for Mac.  Stand-alone
CDR units are able to duplicate SHN discs, but are unable to decompress
them in order to burn 'redbook' audio copies.

Special thanks to the following people who contributed a great
deal of this information:
Mike Masse (mail@mikemasse.com)
Chris Tweedy (chris@piebald.com)
Mike Monacella (mmonacel@pivotpoint.com)
Jeremy Clark (RubyBroom@Bigfoot.com)

BASICS:
----------
What is>  SHN
----------
SHN is a file extension (like .doc, .wav, etc.) used for a compressed WAV
file.  The SHN is created by a program called Shorten.  It uses a loss-less
compression scheme (kinda like WinZip) that essentially compresses the WAV
file without any loss to quality.  The ratio of compression is dependent
upon how "noisy" the WAV is.  A loud and out of control BBFCM would
probably be a larger file than a soft and quiet Waste even if they were the
same length.  We originally used SHNs to efficiently transfer shows over
the Internet to different servers.  We later found that trading SHNs would
be much better at preserving the quality of the recording over time and
trades because many people with burners who can not do perfect DAE (digital
audio extraction) start to introduce pops and clicks through the lineage.
By trading SHNs, each person not only has a backup of the entire show (on
less discs) that they can uncompress later if need be, but they also know
the quality is much more "insured" than if they were to trade audio "red
book" CDs.

how it works:
----------
Here's what happens:  you receive SHN discs in a vine, trade, B+P, etc.
You take the SHNs and copy them to your hard drive.  Use Shorten to
uncompress the SHNs to WAV files.  Burn the WAV files to disc.  Done.
(People have also extracted straight from the SHN discs to HD, but that's a
little more complicated).

----------
What is>  Shorten
----------
Shorten is the DOS-based program that creates SHN files (read above).  The
original Shorten program (distributed by Softsound) was modified by Eric
Beaupre I believe.  Some of the modifications, to the best of my knowledge,
were to make sure that lossless compression was the default compression
scheme.  I think it already was, but he changed something or other to make
sure, etc. etc.  There are other changes that were done, but I'm not the
person to ask.  What I do know however, is that you should use the PCP copy
of Shorten for your compression and uncompression needs.  I believe the
list of modifications can be found within the PCP version by using the
command -h or -help.

----------
What is>  PCP.exe
----------
PCP.exe was a program designed by Eric Beaupre to automate all the
necessary tasks of SHNing shows.  I'm not sure if it was ever completed but
it orginally was supposed to:

*md5check all the files for d1, extract them all, delete the .shns
*as it goes along for those low on disk space, create a cue sheet,
*and invoke dao to burn the disk.

The link on Eric's page seems to be misplaced, however I believe the
last known version of pcp.exe (v1.04) can be downloaded here:

Pcp-Etree-Util-v104.zip (hold down the shift key and click on the link)
Will someone please check it out and let me know if it does work?


----------
How to> Decompress a SHN with a double click in windows
----------

1.  In Windows Explorer and click on "View", then select
"Folder Options," then "File Types."  

2.  Click "New Type."  Under the "Add New File Type" dialog box,
enter "Shorten" under "Description of type" and "shn" under
"Associated extension."

3.  Under Actions, click "New." In the New Action dialog box, type
"Open" under Action, and, in the "Application used to perform action"
type (or cut and paste) the following:

C:\Shorten\shortn32.exe -x "%1" "%1.wav"

(and yes, include the quotation marks)

----------
Now you've set up your system to automatically handle Shorten
files on an individual basis. 

If you have the shn icon that floated around a while ago, you
can tie that in too, with the "Change icon" option. 


how to use it:
----------
Right click the Shorten file you wish to decompress, and choose
"Open."  This will automatically open a DOS window.  When  the DOS
window closes, your wav file has successfully been recreated.


----------
How to> Compress a WAV file to SHN with a Right click in windows
----------
To add the "Compress" action to the wav file list, much like SHN
files mentioned above:

1.  In Windows Explorer and click on "View", then select "Folder
Options," then "File Types."

2.  Find "Wave Sound" (or something equivalent) on the "Registered
file types" list.  Click "Edit."

3.  Under "Actions," click "Edit."

4.  In the "New Action" dialog box, enter "Compress" in the "Action"
box, and, in the "Application used to perform action" box, type (or
cut and paste) the following:

C:\Shorten\shortn32.exe "%1" "%1.shn"

----------
Now you've set up your system to automatically handle Shorten files
on an individual basis.  


how to use it:
----------
Right click the WAV file you wish to shorten, and choose "Compress".
This will automatically open a DOS window.  When  the DOS window
closes, your SHN file has successfully been created.
----------


TAKING IT A STEP FURTHER:
----------
How to> Decompress multiple SHN with a right click in windows
----------
Automatically unshorten ALL the files in a directory, and put the
.wav files in a directory you specify in the batch file.

1.  Create the following batch file:

---cut here---
cls
lfnfor on
for %%f in (*.shn) do c:\shortn32.exe -x %%f e:\wherever\%%f.wav
lfnfor off
---cut here---

Make the following changes:
line 3: [replace c:\shortn32.exe with path/filename information
to the shorten executable]
line 3: [replace e:\wherever\ with where you want the uncompressed
files to end up]

        For the DOS impaired:
        a. Select the four lines below and above --cut here-- and
           copy them.
        b. Start Notepad and paste the four lines.
        c. File, Save As to c:\windows\unshort_E.bat (put it
           wherever you want and call it whatever you want).

2.  In Windows Explorer and click on "View", then select "Folder
Options," then "File Types."

3.  Find "Shorten" on the "Registered file types" list.  
Click "Edit."

3.  Under "Actions," click "Edit."

4.  In the "New Action" dialog box, enter "UNSHN_E" in the "Action"
box, and, in the 
"Application used to perform action" box, type (or cut and paste)
the following:

C:\windows\unshort_E.bat  (replace with appropriate path/filename
information for the batch file you created above)

----------
Now you've set up your system to automatically unshorten all the
SHN files in a directory. 


how to use it:
----------
Right on ONE of the SHN files in a directory, and select UNSHN_E.
This will automatically open a DOS window.  When  the DOS window
closes, your wav files will have successfully been recreated in
e:\wherever.  If you have a partitioned hard drive (as many of
us do) and use both partitions to store your WAV files, you can
also create a similar batch file and file association for each
partition of your HD.  For example, if your hard drive is
partitioned into E:\ and F:\ then you could create a separate
BAT file and change the path from e:\wherever to f:\wherever and
name your file association UNSHN_F. 

----------
How to> Compress multiple WAV's with a right click in windows
----------
Automatically shorten ALL the WAV files in a directory, and put the
.shn files in a directory you specify in the batch file.

1.  Create the following batch file:

---cut here---
cls
lfnfor on
for %%f in (*.wav) do c:\shortn32.exe  %%f e:\wherever\%%f.shn
lfnfor off
---cut here---

Make the following changes:
line 3: [replace c:\shortn32.exe with path/filename information
to the shorten executable]
line 3: [replace e:\wherever\ with where you want the compressed
files to end up]

        For the DOS impaired:
        a. Select the four lines below and above --cut here-- and
           copy them.
        b. Start Notepad and paste the four lines.
        c. File, Save As to c:\windows\shortn_E.bat (put it
           wherever you want and call it whatever you want).

2.  In Windows Explorer and click on "View", then select "Folder
Options," then "File Types."

3.  Find "Shorten" on the "Registered file types" list.  
Click "Edit."

3.  Under "Actions," click "Edit."

4.  In the "New Action" dialog box, enter "SHORTN_E" in the "Action"
box, and, in the 
"Application used to perform action" box, type (or cut and paste)
the following:

C:\windows\shortn_E.bat  (replace with appropriate path/filename
information for the batch file you created above)

----------
Now you've set up your system to automatically shorten all the
WAV files in a directory, to the location specified in the BAT file.


how to use it:
----------
Right on ONE of the WAV files in a directory, and select SHORTN_E.
This will automatically open a DOS window.  When  the DOS window
closes, your SHN files will have successfully been recreated in
e:\wherever.  If you have a partitioned hard drive (as many of
us do) and use both partitions to store your SHN files, you can
also create a similar batch file and file association for each
partition of your HD.  For example, if your hard drive is
partitioned into E:\ and F:\ then you could create a separate
BAT file and change the path from e:\wherever to f:\wherever and
name your file association SHORTN_F. 


----------
How to> Compress multiple WAV files to SHN in sequence and delete
the original WAVs to conserve hard drive space, in Windows.
----------
The following is some useful info on generating your own BAT files
to work with Shorten and MD5.
You may have to modify the WAV file names and change disc numbers
where appropriate.  This is for a sample 8 track disc:

1.  Create the following batch file:

---cut here---
shortn32 track01.wav dXt01.shn
del track01.wav
shortn32 track02.wav dXt02.shn
del trac0k2.wav
shortn32 track03.wav dXt03.shn
del track03.wav
shortn32 track04.wav dXt04.shn
del track04.wav
shortn32 track05.wav dXt05.shn
del track05.wav
shortn32 track06.wav dXt06.shn
del track06.wav
shortn32 track07.wav dXt07.shn
del track07.wav
shortn32 track08.wav dXt08.shn
del track08.wav
---cut here---

Make the following changes:
Replace filenames [track01.wav - track08.wav] where necissary to
reflect the names of the WAV files you wish to compress.  You can
add/remove lines to accomodate the number of tracks you are
working with.

Replace the 'X' ['dXt01.shn - dXt08.shn] to reflect the disc number.
You can read more about the appropriate naming in the following
section.

For the DOS impaired:
        a. Select the lines of text below and above --cut here--
and copy them.
        b. Start Notepad and paste the text.
        c. File, Save As to shndiscX.bat [where X is the disc number]
        (be sure to put it in the same directory as the WAV's
you wish to compress.

----------
Now you've created a batch file to automatically compress the WAV
files (track1.wav - track8.wav) in SHN format, and delete the original
WAV files as it goes along, to conserve hard drive space.. 


how to use it:
----------
Make sure the BAT file you created is in the same directory as the
WAV's you are working with, and your copy of shortn32.exe.
Double-click the shndiscX.bat icon. This will automatically open a
DOS window.
When  the DOS window closes, your wav files have successfully been
compressed into SHN's, and the original WAV's will have been deleted.


----------
How to> Properly name SHN in sequence, for trading.
----------

The following file naming conventions should be used when generating
and either uploading, hosting, or trading SHN data files. 

a) Show name: 

The show and all files and directories associated with it should have
a name which starts like this: 

       bbyy-mm-dd
       ^^^^ ^^ ^^
       |||| || \\___ Day
       |||| ||
       |||| \\______ Month
       ||||
       ||\\_________ Year
       ||
       \\___________ Band   (e.g. ph = Phish)

      e.g.: ph98-04-22

Rationale: Having the year first instead of last ensures that files
sort in chronological order. Admittedly, this doesn't sound very
important, but it is nice to have IMHO. 

Also, hyphens in the date and leading zeros eliminate the chance of
ambiguities such as 98112 (is it 98-01-12 or 98-11-02?)

b) Disc names: 

Discs for a show shall be named as in a), but with 'dn' appended,
where 'n' is the disc number, for example: 

     ph98-04-22d3 

Each disc shall have its own directory. 

Rationale: Why not just, e.g., 'd2'? It makes sure that if, for some
reason, the directory gets separated from its parent, you still
know exactly what it is. 

c) Track names: 

Tracks shall start with the same names as the discs belong to, but
with 'tnn.shn' appended, where 'nn' is the track number, with
leading zero if nessecary, for example: 

     ph98-04-22d3t04.shn 

Each track shall be in the directory for the disc that it belongs to. 

Rationale: The leading zero in single-digit track numbers is important,
because otherwise it is too easy to burn tracks in the
wrong order, e.g. t1, t10, t11, t2, t3, t4... 

As mentioned in d), it's nice to have the ph98-04-22d3 prefix on the
beginning of the files, just in case they get separated from
their soul-mates.

----------
What is>  MD5Sum
----------
MD5Sum is a program that insures the quality of SHNs when transferred
across the Internet.  Say we have John and Pat.  John just encoded a show
to SHNs and wants to upload the show to Pat's server.  John uses md5sum on
the SHNs which creates a file (filename.md5) that lists unique signitures
given to each SHN.  John includes the md5 file when transferring the show
to Pat.  After Pat receives the files, he runs the MD5Sum program to read
the md5 file and make sure that every single last bit was received in
perfect condition from John.  Once the check verifies the files, Pat can
then uncompress the shows and burn for himself knowing he has the EXACT
same copy (quality and all) that John has.

----------
How to> check  MD5 signatures  with a right click in windows
----------


1.  In Windows Explorer and click on "View", then select "Folder
Options," then "File Types."  

2.  Click "New Type."  Under the "Add New File Type" dialog box,
enter "MD5" under "Description of type" and "md5" under
"Associated extension."

3.  Under Actions, click "New." In the New Action dialog box,
type "Open" under Action, and, in the "Application used to
perform action" type (or cut and paste) the following:

C:\Shorten\util\md5sum.exe -c

----------
Now you've set up your system to automatically handle MD5 files,
using md5sum.exe, which you should have located in
C:\Shorten\util\md5sum.exe.  If you insist on storing the
md5sum.exe somewhere else, alter all the paths accordingly.
 


how to use it:
----------
Make sure the MD5 signature you wish to check is in the proper
directory, containing all the associated SHN files in the CD
layout.  Double click the MD5 file you wish to check.  This
will automatically open a DOS window.  When  the DOS window
closes, md5sum.exe will have made sure that the data has
retained its integrity, or stated otherwise.  All tracks for
that disc must be present in their original SHN format for a
successful MD5 check. 


----------
How to> Generate MD5 signatures associated with SHN'd CD layouts
----------


1.  Create the following batch file:

---cut here---
md5sum --binary *.shn > > discX.md5
---cut here---

Make the following change:

Replace the 'X' ['discX.md5] to reflect the disc number.  You can
read more about the appropriate naming in the above section.

For the DOS impaired:
        a. Select the line of text below and above --cut here--
and copy them.
        b. Start Notepad and paste the text.
        c. File, Save As to md5discX.bat [where X is the disc
number] (be sure to put it in the same directory as the SHN's you
wish to make a signature for.

----------
Now you've created a batch file to automatically analyze the SHN
files in the working directory, and generate a MD5 signature that
can be used later, to verify the integrity of the SHN files, if
ever stored for long periods of time, or transferred over the
internet.

how to use it:
----------
Make sure the BAT file you created is in the same directory as the
SHN's you are working with, and your copy of md5sum.exe.
Double-click the md5discX.bat icon. This will automatically open a
DOS window.  When  the DOS window closes all SHN files in the
current directory will have successfully analyzed.   It will have
generate an MD5 sum for all, and named it discX.md5 [where X is
the disc number].  To use this, be sure to only have SHN files
you want included in the quere in the working folder.

----------
How to> Generate MD5 signatures for SHN/WAV's with a right click in Windows
----------
To add the "generate MD5" action to either/both SHN or WAV files
mentioned above:
(for both, you'll have to do this twice, once for each file type):

1.  In Windows Explorer and click on "View", then select "Folder
Options," then "File Types."

2.  Find "Wave Sound" (or something equivalent) or "Shorten File" 
on the "Registered file types" list.  Click "Edit."

3.  Under "Actions," click "Edit."

4.  In the "New Action" dialog box, enter "generate MD5" in the "Action"
box, and, in the "Application used to perform action" box, type (or
cut and paste) the following:

(for Shorten files)
---cut here---
C:\Shorten\util\md5sum.exe --binary *.shn > > shndiscX.md5
---cut here---

(for WAV files)
---cut here---
C:\Shorten\util\md5sum.exe --binary *.wav > >  wavdiscX.md5
---cut here---

----------
Now you've set up your system to automatically generate MD5 signatures,
for SHN or WAV files, using md5sum.exe, which you should have located in
C:\Shorten\util\md5sum.exe.  If you insist on storing the
md5sum.exe somewhere else, alter all the paths accordingly.
 


how to use it:
----------
Make sure that you have all of the SHN or WAV files you wish
included in the MD5 sigature in a directory together.
Right click one of the SHN or WAV files you wish to generate a
signature for.  This will automatically open a DOS window.
When  the DOS window closes, md5sum.exe will have created a 
MD5 signature for all the SHN or WAV files contained in that
directory.  All tracks for that disc must now be present 
in this original SHN format for a successful MD5 check. 
----


I hope this proves helpful.  Good luck!

Enjoy the music!

Adam Fox (fox@pigsfeet.net)