Welcome

SFPack is the ultimate solution in SoundFont packing, unrivaled in compression ratio and easiness of use. It beats hands down any other product (like sfArk, WaveZip, WinRar or WinZip).

Best lossless compression available

SFPack uses a so called lossless compression scheme to save diskspace or transmission time when sending a soundfont via email or ftp. Lossless means that the original quality of the sounds is preserved. There are so called lossy compression schemes (like MP3 or RealAudio) that can produce much higher compression ratios, but because they loose information during compression, are unusable for digital samples.
SFPack generally compresses files between 30% and 70% of the original file size, depending on the nature of the sound data stored in the soundfont. But this compression ratio is much better than can be achieved with any other program, cause SFPack uses it's own highly optimized compression routines for digital sound data (Comparison Chart).

It's fast and friendly!

SFPack is about 3 times faster as sfArc V1.18 and about 1.5 times faster as WinZip V7.0. Also SFPack adapts itself to your current system load, so you can compress Gigs of samples in the background without bringing your system to a halt.

Easy user interface

With its explorer like interface it's very easy to compress and inflate files the way you want. For further information read here.

Tight integration with the windows shell

SFPack is tightly integrated with the windows shell. With special commands in the popup menus for SFPack and SF2 files it's a snap to compress and expand files. Read the shell chapter for further information.

Special features for distributing soundfonts

You can add text information and a license agreement to a SFPack archive. SFPack archives can also be encrypted via a password. This feature is intended for situations where a SFPack archive can be downloaded freely, but the password is given with email etc. (e.g. when selling soundfonts).

Direct use of packed SoundFont files

With the integration of the SFPack compression technology into AweVBank 98, you can directly load SFPack archives to your soundcards without having to unpack them first.

Write your own programs using the SFPack technology

Because SFPack is also a COM automation server, you can use the SFPack technology in your own programs (like Visual basic). There's a full reference of all methods and objects available.

SFPack, program and documentation
Copyright © 1999 Megota Software
All rights reserved.

SFPack, the SFPack logo and the Megota Software logo are trademarks of Megota Software.
Sound Blaster is a trademark of Creative Technology Ltd.
E-mu Systems and SoundFont are registered trademarks of E-mu Systems, Inc. Cambridge
All other trademarks acknowledged.

This freeware version of SFPack is not licensed for commercial use. Commercial use would include but is not limited to use or distribution of SFPack with SoundFonts or similar products that you sell or rent or using the SFPack technology in your own commercial products. A license for commercial use may be granted on payment of license fees to Megota Software. Please contact software@megota.com for further information.


Software License

This freeware version of SFPack is not licensed for commercial use. Commercial use would include but is not limited to use or distribution of SFPack with SoundFonts or similar products that you sell or rent or using the SFPack technology in your own commercial products. A license for commercial use may be granted on payment of license fees to Megota Software. Please contact software@megota.com for

LICENSE AGREEMENT AND DISCLAIMER OF WARRANTY

IMPORTANT

THIS IS A LEGAL AGREEMENT BETWEEN YOU, THE LICENSEE, AND MEGOTA SOFTWARE PLEASE READ THE AGREEMENT CAREFULLY BEFORE CONTINUING TO USE THE SOFTWARE. BY CONTINUING THE INSTALLATION AND USE OF THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE WITH THESE TERMS AND CONDITIONS, PROMPTLY CEASE ALL FURTHER INSTALLATION OR USE OF THE SOFTWARE AND, IF ALREADY INSTALLED, REMOVE THE SOFTWARE FROM YOUR COMPUTER.

1. SOFTWARE

The term "Software" as used in this Agreement shall mean SFPACK SoundFont Compression Software (freeware version) operating in the environment of Microsoft Windows, including any technology licensed by MEGOTA SOFTWARE from the developers and owners thereof to MEGOTA SOFTWARE, together with all accompanying Documentation.

2. RIGHTS GRANTED

In consideration of your agreement to abide by the terms of this license, MEGOTA SOFTWARE hereby grants to you, THE LICENSEE, for an indefinite period a non-exclusive, non-transferable license to use the Software in personal non profit making activities. Use in any business or commercial activity is expressly prohibited. Use of the Software shall be defined for the purposes of this license as the loading of the Software into RAM or the permanent memory of a computer. Title to and ownership of the Software and all intellectual property rights therein shall at all times remain the property of MEGOTA SOFTWARE and/or its licensers.

3. COPYRIGHT

THE LICENSEE acknowledges that the Software is protected by copyright. Pursuant to relevant national and international copyright laws, THE LICENSEE may not copy, photocopy, reproduce, translate, modify, adapt or create derivative works based on the Software or Documentation or any portion thereof except that THE LICENSEE may copy the Software in its original form onto any computer for the purpose of use of the software as described by this license.

THE LICENSEE will use its best efforts to reproduce and preserve MEGOTA SOFTWARE'S copyright notices and copyrights in the Software and will promptly report to MEGOTA SOFTWARE any apparent infringement of such copyright that comes to the attention of THE LICENSEE. THE LICENSEE shall not make a copy or copies of the Software or any part thereof available to any third party, nor allow any other person acting on THE LICENSEE'S behalf to do so. THE LICENSEE will be held legally responsible for any copyright infringement which is caused or made possible by THE LICENSEE'S failure to abide by the terms of this Agreement.

4. PROPRIETARY INFORMATION & TRADE SECRETS

THE LICENSEE recognizes and understands that the Software, Documentation and all other materials and knowledge related thereto are proprietary to MEGOTA SOFTWARE and/or its licensor(s) and contain confidential and proprietary information and trade secrets. THE LICENSEE agrees not to disclose such information to any third party other than MEGOTA SOFTWARE'S employees or authorized agents without MEGOTA SOFTWARE'S prior written consent. This obligation of confidentiality includes any confidential information which is obtained by THE LICENSEE as a result of any analysis or decompilation permitted under Articles 5(3) and 6 of the EU Software Directive (91/250/EEC). THE LICENSEE acknowledges that, as between MEGOTA SOFTWARE and THE LICENSEE, the Software and its Documentation and all copyrights, trade secret rights and other intellectual property rights with respect thereto, are and will at all times be the property of MEGOTA SOFTWARE. THE LICENSEE agrees not to cause or permit any attempts to determine the source code of the Software, including but not limited to reverse engineering, disassembly or decompilation of the Software, except as permitted by Article 6 of the EU Software Directive, and agrees not to cause or permit any modification, adaptation or reprogramming of the Software. The obligations of this paragraph shall survive the expiration or termination of this Agreement.

5. DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY

THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR OF ANY OTHER TYPE, WHETHER EXPRESS OR IMPLIED, AND TO ANY REMEDY AGAINST MEGOTA SOFTWARE AND/OR ITS LICENSERS, WHETHER IN CONTRACT, TORT OR OTHERWISE. THE LICENSEE AGREES THAT NEITHER MEGOTA SOFTWARE NOR ITS EMPLOYEES, MANAGEMENT OR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO, LOSS OF ANTICIPATED PROFIT, REVENUE, DATA OR USE) INCURRED BY THE LICENSEE OR ANY THIRD PARTY IN CONNECTION WITH OR ARISING OUT OF USE OF THE SOFTWARE, EVEN IF MEGOTA SOFTWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. NOTHING IN THIS CLAUSE LIMITS MEGOTA SOFTWARE'S LIABILITY TO THE LICENSEE IN THE EVENT OF DEATH OR PERSONAL INJURY RESULTING FROM MEGOTA SOFTWARE'S NEGLIGENCE.

6. TERMINATION OF LICENSE

This license will terminate automatically if THE LICENSEE fails to comply with any provision of this license. In any case MEGOTA SOFTWARE may terminate this license at any time at their discretion. In the event of termination of the license, THE LICENSEE agrees to immediately cease using the Software, and within ten (10) days of the termination certify to MEGOTA SOFTWARE that all copies of the Software have been destroyed. This requirement will apply to all copies in any form, whether partial or complete, and whether or not modified or merged into other program materials.

7. GOVERNING LAW

This Agreement shall be governed in all respects by the laws of Austria.

8. EXPORT CONTROLS

THE LICENSEE agrees that THE LICENSEE will not directly or indirectly transfer the Software or Documentation to any country to which such transfer would be prohibited by any applicable export control law.

9. ACKNOWLEDGMENT

THE LICENSEE acknowledges that THE LICENSEE has read this Agreement in full, has fully understood its terms and agrees to be bound thereby. This Agreement contains the complete and exclusive agreement between the parties and supersedes all proposals or prior agreements, oral or written, and any other communications between the parties and supersedes all proposals or prior agreements, oral and written, and any other communications between the parties relating to the subject matter of this Agreement.

Copyright ©1999, Megota Software


Install and Uninstall

SFPack does not come with a setup program (this is for the reason that a setup program would add about 500 KB to the package size).

System Requirements

SFPack runs on Win95/WinNT 4 (with at least Internet Explorer 4 installed) or Win98. A video card running either in HiColor or TrueColor mode is recommended.

Installation

To install SFPack, simply extract sfpack.zip to any folder on your system (preferable you should create a folder in your program files tree). Then just start SFPack.exe and everything is done!

Uninstall

To completely remove SFPack from your system, open the Add/Remove programs dialog in your Control Panel, select SFPack from the list and press the Add/Remove button. Now you can delete all the files of the SFPack package.


How To

This How To explains the most common procedures in SFPack.

Procedure

Step by Step

Pack a SF2 file or a group of files

From within SFPack
Run SFPack and add the SF2 files with the Add Files,,, command to the list. You can also Drag & Drop files or whole directories from the explorer to SFPack. If you want to pack the files to a different location you must first select a target folder. Then just hit the Go! button or press <SPACE>. To open a SF2 file directly with SFPack you can also use the open command in the SF2 explorer context menu.

From within explorer
Select the SF2 files in the explorer and right lick one of the items. Select the compress command to save the compressed files to the same folder or the compress to... command to select the target folder.

Unpack a SFPack file or a group of files

From within SFPack
Run SFPack and add the SFPack files with the Add Files,,, command to the list. You can also Drag & Drop files or whole directories from the explorer to SFPack. If you want to unpack the files to a different location you must first select a target folder. Then just hit the Go! button or press <SPACE>. To open a SFPack file directly with SFPack just double click the file in explorer.

From within explorer
Select the SFPack files in the explorer and right lick one of the items. Select the Expand command to save the SF2 files to the same folder or the Expand to... command to select the target folder.

Add a License or Text file to SFPack archives

In SFPack open the Preferences Dialog and select the compression tab. Here you can specify the Text files you want to use as a License or Text attachment.

Tip: Check one of the Search for... options in the compression settings and do not specify a text or license file. This way SFPack will only add a Text or License if there is a file with the same base name as the SF2 file (e.g. C:\SF\V.SF2 will only add a Text or License file if there exists a file named C:\SF\V.TXT or C:\SF\V.LIC)

Encrypting SFPack files

To encrypt SFPack archives you need to check the Encrypt SFPack Files option. You will be asked for a password when you try to pack a SF2 file.

Pack/unpack a whole directory tree to a different location

You can pack/unpack a whole directory tree to a new location by selecting a Target Folder and checking the Keep Directory Structure option.

For example you have the files

C:\MUSIC\SOUNDFONTS\WEB\LOOPS\L1.SF2 and C:\MUSIC\SOUNDFONTS\OWN\PADS\STRANGE.SF2

in the file list. If you check the Keep Directory Structure option in the preferences and set the Target Folder to

C:\MUSIC\SFPACKED

the packed soundfont files will be written to

C:\MUSIC\SFPACKED\WEB\LOOPS\L1.SF2 and C:\MUSIC\SFPACKED\OWN\PADS\STRANGE.SF2.


Reference

This chapter is the reference of all commands/windows/options etc. of SFPack.


Overview

Commands

Many commands can be issued by either selecting it in the Menu Bar, clicking a button on the Tool Bar, pressing a shortcut key or by popping up the item menu (right click on an item) or the listview menu (right click on any empty space in the File List).

Groups of Commands:

Group | Description
File Commands | Commands for adding/deleting/packing files
Edit Commands | Commands for working with the File List
Help Commands | Help and Documentation


File Commands

Command | Toolbar | Keyboard | Alternate
Add Files... Opens up the Add Files Dialog to select SF2, SFPack or SFList files to add to the current list. |  | Ins | List Menu
Save File List Opens the the Save List Dialog to save the current list to a file. You can later recall all the files in the list by adding the file list with the Add Files command. |  | Ctrl-S |
Go/Stop Starts/Stops the packing/unpacking. Please note that the processing is done in background, so you can still work with all the items/commands while the processing is running. Which items are processed depends on the Process only selected Files setting. |  | Space |
Choose Target Folder... Allows you to choose the target folder for the packing/unpacking of all the files in the list. If you do not specify a target folder, the files are packed/unpacked to the same location as the source file. |  | Ctrl-F |
Delete selected Files Deletes the selected files from the disk. |  |  | Item Menu
Preferences... Opens up the Preferences Dialog. |  | Ctrl-O |
Exit Closes SFPack |  | Ctrl-X |


Edit Commands

Command | Toolbar | Keyboard | Alternate
Select by Type Selects the items in the File List based on their type (SF2 or SFPack) |  |  | List Menu
Select by Status Selects the items in the File List based on their processing status. |  |  | List Menu
Invert Selection Inverts the selection in the File List. |  | Ctrl-I | List Menu
Select All Selects all the items in the File List |  | Ctrl-A | List Menu
Paste Pastes any files copyied to the clipboard (with the explorer) into the list |  | Ctrl-V | List Menu
Remove Selected Removes all selected items from the File List (but does not delete them). |  | Del | Item Menu
Remove All Removes all items from the File List (but does not delete them) |  |  |
Reset Selected Resets the status of all selected files to not processed |  | Ctrl-R | Item Menu


Help Commands

Command | Toolbar
Contents... Displays the on-line documentation. |
Visit megota.com Connects you to www.megota.com |
Get Free SoundFonts Go to 5thFloor and download some free SoundFonts |
About... Displays the copyright information |


Overview

Main Window

The Main Window of SFPack consists of the Menu Bar, the Tool Bar, the List of all Files and the Status Bar.


File List

The File List displays all files that are currently in the list.

Item Properties:

Name | Description
File | This is the name of the file
Path | The path of the file
Size | The size of the file.
Status | Displays the status of the file. This can be either 'not processed', the statistics for a successful processing, or if something goes wrong, an error message.

Working with the List:

This lists only actions not covered in the Commands Reference.

Action | Description
Sort | You can sort the list by clicking on a column header.
Drag & Drop | You can add files by dragging them from the explorer into the list.
Item Popup Menu | Each item (file) has it's own popup menu. You get it by right clicking on the item.
Item Properties | You can display the properties of a file by selecting the Properties command in the Item Popup Menu or by making a double click on the item.
List Popup Menu | The List Popup Menu is displayed by a right click on any empty space in the List.


Dialogs

Dialogs are windows that open up above the Main Window when some commands are issued.

Dialog | Issued by | Description
Preferences | Preferences... Command | Here you can change the way SFPack operates.
About | About... Command | Display copyright information of SFPack
Select Target Folder | Choose Target Folder... Command | Select the target folder for file operations.
Password | When a file is packed with the Encryption Option enabled, or a SFPack file with encryption is being unpacked. | Enter the password for encryption or decryption.


About

About Dialog

This dialog displays copyright and license information.


Add Files

Add Files Dialog

Here you can select files you want to add to the current File List. Valid files are SFPack archives, SoundFont 2 files and SFPack File Lists.


Attach Text

Attach Text Dialog

Here you can select a text or license file you want to attach to packed SoundFont files.


Password

Password Dialog

This dialog is displayed either when you've checked the Encryption Option in the in the General Preferences or you are trying to unpack a SFPack file that has been compressed with encryption.

Name | Description
Password | Enter the password for either compressing or uncompressing a file.
Same for all Files | If you check this, the same password is used for all the files that are about to processed.


Preferences Overview

Preferences Dialog

In the Preferences Dialog you can change the way how SFPack operates and how files are compressed.

Tab | Description
General | Here you can change the general operation of SFPack.
Compression | On this tab you can adjust how SF2 files are compressed.


General

Here you can define how SFPack generally operates:

Name | Description
Process only selected Files | When checked, only selected files will be processed when you hit the GO button. If no file is selected, all will be processed.
Delete Source File | Delete the source file after successful processing. e.g. delete the SF2 file after it has been converted to a SFPack file.
Save Delete | Moves the files into the Recycle Bin instead of really deleting them. This way you can undo the deletion process later (if needed).
Confirm Overwrite | You need to confirm any overwriting of existing files.
Keep Directory Structure | When you pack/unpack to a target folder and this option is checked, the common path of all files is preserved and rebuilt in the target folder.
Continue after error | If there's an error in the processing of a list of files, continue if there are still unprocessed files in the list. If this is unchecked, SFPack stops the processing after any error.
Hide when invoked from shell | When SFPack is started via the special commands added by the shell extension (see Shell) and this is checked, SFPack only displays dialog showing the compression status, otherwise SFPack is started in normal mode (showing the Main Window)
Display Errors (shell) | Display errors when run in "silent mode". If this is unchecked, errors during compression or inflation are ignored.


Compression

Here you can change the options for compressing SF2 files.

Name

Description

Compression Method

This allows you to change the compression method.

Encrypt SFPack Files

If checked you will be ask for a password when you compress a SF2 file. You can only uncompress the SFPack archive with the same password.

Attached Text

If you want to attach a Text to the SFPack file, check the "Attach Text File" option and browse for a Text File with the Attach Text Dialog.
You can also check the "Search for Text File" Option. This will automatically look if there's a Text file with the same base name as the SF2 file available (e.g. test.sf2 will use test.txt). Such a found file will replace the default text file.

The Text File will be displayed before the unpacking of the SFPack File starts.

Attached License

Basically the same as "Attached Text" except that the "Search for License File" Options will search for a file with the extension ".lic".

The License File will be displayed before the unpacking of the SFPAck File starts. The user has to click "Agree" to unpack the file.


Save List

Save List Dialog

Here you can save the current File List for later use.


Select Target Folder

Select Target Folder Dialog

In this dialog you can select the target folder of SFPack. All files created from an pack/unpack operation are written to the target folder. If no target folder is selected, the files are written to the same location as the source file.


Shell

SFPack is tightly integrated with the explorer shell.

With the Custom Context Menu you can quickly expand and compress SF2 and SFPack files.

The Custom Property Sheet displays informations about a SFPack file.

Also when you move the mouse cursor above a SFPack file, you will get a Tooltip displaying the packing info of the file.


Shell Context Menu

You can open the custom context menu when you right click a SF2 or SFPack file in the Windows Explorer.

Available Commands:

Command | Description
Open | Opens the SF2 file(s) with SFPack.
Compress | Compress the SF2 file(s) with the current compression settings to the current folder.
Compress to... | Display the Target Path Selection Dialog and compress the SF2 files(s) with the current compression settings to the selected folder.
Expand | Expand the SFPack file(s) to the current folder.
Expand to... | Display the Target Path Selection Dialog and expand the SFPack files(s) to the selected folder.


Shell Property Page

When you display the file properties of a SFPack file from within the explorer you will get a new tab called "Pack Info".

This Property Page displays following information:

Name | Description
Archive | Her you can select the SFPack file, if the Property Page displays information for multiple files
Info | General information about the file (like version, size etc.)
Text | Attached Text of the SFPack File (if any)
License | License of the SFPack File (if any)
Total | Only visible if multiple files have been selected. This entry displays a combined statistic for all the files.
Expand | Expand the file(s) to the same folder
Expand... | Expand the file(s) to a different folder


Automation

Automation allows you to use some of the functionality of SFPack in your own programs (Visual Basic, VB Script, etc.)

The API documentation uses the Visual Basic 6 syntax for methods, properties and events.

In addition [R], [W] and [RW] are used for properties, to indicate if the property has read, write or full access.

Interfaces/Classes | Description
Engine | Main Class. You can only create the other classes via methods of this class
SF2File | Class for packing a SF2 file
SFPackFile | Class for inflating (uncompressing) a SFPack file

Please refer to this page for some short examples on how to use the library from within Visual Basic.


Engine Class

The Engine Class is the basic Creator class. You always need to create at least one Engine Object in your program.

Methods:

Methods/Properties | Description
Error As SFPackErrorConst [R] | Get the current Error status of the object.
ErrorStr As String [R] | Returns the current Error status as a descriptive text.
OpenSF2 (cFile as String) As SF2File | Opens a SF2 file and returns an SF2 file object. If there's an error Nothing is returned (to get further information use the Engine.Error property). cFile can be any path including a network path.
OpenSFPack (cFile as String) As SFPackFile | Opens a SFPack file and returns an SFPack file object. If there's an error Nothing is returned (to get further information use the Engine.Error property). cFile can be any path including a network path.

Events:

Event

Description

Progress (ByVal nPercent As Integer)

This event is triggered either by the SF2File.Pack or the SFPackFile.Inflate method.

This event can be used to update a progress bar with the completion percent of the current file processing.

You can also cancel the current packing or inflation by calling the SF2File.Cancel or SFPackFile.Cancel method.

Visual Basic Source Example


SF2File Class

The SF2File class is used to pack a SF2 file to a SFPack file. You can create a SF2File Object with the Engine.OpenSF2 method.

Methods and Properties:

Method/Property | Description
Cancel () | Call from within the Event.Progress event to cancel the current packing.
Error As SFPackErrorConst [R] | Get the current Error status of the object.
ErrorStr As String [R] | Returns the current Error status as a descriptive text.
File As String [R] | Returns the file the SF2File Object has been opened for (via Engine.OpenSF2). This is also the default property.
License As String [RW] | Allows you to set or read the License Text that should be attached to the SFPack File.
Pack (cFile as String, [ptType As SFPackTypeConst = ptMaximum]) As Long | Pack the SF2 file to a SFPack file and specify optional the compression method. Returns 0 on failure (you can use the Error, ErrorStr properties to get further information). Visual Basic Source Example
Password As String [RW] | Returns or sets the encryption password.
Size As Long [R] | Returns the size of the SF2 File in bytes.
Text As String [RW] | Allows you to set or read the Text information that should be attached to the SFPack file.


SFPackFile Class

The SFPackFile class is used to unpack a SFPack file to a SF2 file. You can create a SF2PackFile Object with the Engine.OpenSFPack method.

Methods and Properties:

Method/Property | Description
AgreeLicense () | If the SFPack file includes a License, you need to call this method before any call to SFPackFile.Inflate.
Cancel () | Call from within the Event.Progress event to cancel the current packing.
Error As SFPackErrorConst [R] | Get the current Error status of the object.
ErrorStr As String [R] | Returns the current Error status as a descriptive text.
File As String [R] | Returns the file the SFPackFile Object has been opened for (via Engine.OpenSFPack). This is also the default property.
GetSampleData (nSample As Long) As Integer() | Returns an 0-based Integer array with all the sample data points of the specified sample. nSample is in the range of 0 to SampleCount-1.
GetSampleSize (nSample As Long) As Long | Returns the size of the specified sample in sample points. nSample is in the range of 0 to SampleCount-1.
HasLicense As Long [R] | Returns a non zero value if the SFPack archive has a License file attached.
HasText as Long [R] | Returns a non zero value if the SFPack archive has a Text file attached.
IsEncrypted As Long [R] | Returns a non zero value if the SFPack archive is encrypted. If this is the case, you must set the proper password before calling the Inflate method.
IsNonCommercial As Long | Returns a non zero value if the SFPack archive has been packed with the freeware version.
License As String [R] | The License that is attached to the SFPack file.
Inflate (cFile as String) As Long | Inflate the SFPack file to a SF2 file. During processing multiple Event.Progress events are triggered. Returns 0 on failure (you can use the Error, ErrorStr properties to get further information). Visual Basic Source Example
InfoData As Byte() [R] | Returns a 0-based byte array that contains the original Info-List chunk of the packed SF2 files.
OriginalSize As Long [R] | Returns the original (unpacked) size of the file in bytes.
Password as String [W] | Sets the password for unpacking an encrypted archive
PresetData as Byte() [R] | Returns a 0-based byte array that contains the original Pdta-List chunk of the packed SF2 file.
SampleCount as Long | Total count of samples in the SFPack archive.
Size As Long [R] | Returns the size of the SFPack File in bytes.
Text As String [R] | The Text that is attached to the SFPack file.
VersionMajor As Short [R] | Major part of the SFPack file version (currently 1)
VersionMinor As Short [R] | Minor part of the SFPack file version (currently 0)


Constants

This lists all the Constants defined by the Automation Library.

SFPackErrConst:

Name | Description
peOK | Everything is OK
peInvalidFile | File is not supported
peNoPackFile | File is no valid SFPack archive
pePackFileUnsound | SFPack archive is unsound
peLicenseNotAccepted | License has not been accepted for the SFPack File
peOutputFileExists | The output file already exists
peCanNotOpenOutput | Can not open output file
peWriteFailed | The write operation to the output file failed
peCanNotOpenFile | Could not open input file
peCanceled | SF2File.Pack or SF2File.Inflate has been canceled with wither SF2File.Cancel or SFPackFile.Cancel
peFileIO | General File Input/Output error
peWrongPassword | You tried to unpack an encrypted archive and specified no or the wrong password
peNoSF2File | Input file is not a valid SF2 file

SFPackTypeConst:

Name | Description
ptFast | Fast compression
ptNormal | Normal compression
ptMaximum | Maximum compression


Visual Basic Examples

To use the SFPack Library in your Visual Basic program you must first add a reference to the library. Open the References Dialog and check Megota Software SFPack Library (1.0).

Packing a SF2 File

This code sample shows how you can pack a SF2 file to a SFPack File.

Private WithEvents e As Engine
Private sf As SF2File
Sub CompressFile (cSF2File As String, cSFPackFile As String, _
                  cText As String, cLicense As String, cPassword as String)
    Set e = new Engine
    Set sf = e.OpenSF2 (cSF2File)
    ' Check if everything is OK
    If sf Is Nothing Then
        MsgBox e.ErrorStr
        Exit Sub
    End If

    With sf
        ' Now set the properties for the SFPack File
        .Text = cText
        .License = cLicense
        .Password = cPassword

        ' Compress to SFPack File
        if Not .Pack (cSFPackFile) Then
            MsgBox .ErrorStr
        End If

    End With

End Sub

Unpacking a SFPack File

This sample shows how to unpack a SFPack File

Private WithEvents e As Engine
Private sp As SFPackFile
Sub InflateFile (cSFPackFile As String, cSF2File As String)
    Set e = new Engine
    Set sp = e.OpenSFPack (cSFPackFile)
    ' Check if everything is OK
    If sp Is Nothing Then
        MsgBox e.ErrorStr
        Exit Sub
    End If

    With sp
        ' Display the Text (if any)
        If .Text <> "" Then
            MsgBox .Text
        Endif

        ' Display the License (if any)
        If .License <> "" Then
            If MsgBox (.License, vbYesNo, "Do you agree?") = vbYes Then
                .AgreeLicense
            End If
        End If
        If .IsEncrypted Then
            .Password = InputLine ("Password", "File is encrypted!")
        End If
        ' Inflate to SF2 File
        if Not .Inflate (cSF2File) Then
            MsgBox .ErrorStr
        End If

    End With

End Sub

Using the Progress event

With the help of the progress event you can do background processing while the Inflate or Pack method is running. In this example it is assumed that a dialog box is displayed, which has a ProgressBar pb and a Button btCancel. Note also the declaration of e with the WithEvents keyword.

Private WithEvents e As Engine
Private sp As SFPackFile
Private bCancel As Boolean
Private Sub btCancel_Click()
    bCancel = TRUE
End Sub
Private Sub e_Progress (ByVal nPercent As Integer)
    ' Update the progress bar display
    pb.Value = nPercent

    ' Cancel the operation if somebody changed bCancel
    ' sp.Error will return peCanceled after a sp.Cancel
    if bCancel Then
        sp.Cancel
    End If

    DoEvents

End Sub


Command Line

SFPack supports various command line options when started. The basic command line looks like this:

SFPACK.EXE [/Switch] [Files] [Directory]

You can specify multiple options, multiple files (including wildcards) and directories. If you specify a directory, all SF2 and SFPack files from that folder will be added to the File List.

This is a brief list of all useful command line switches (switches start with a '-' or '/' character):

Switch | Description
/a | Automatically start processing of all the files specified in the command line.
/License | Displays the software license on start up.
/Install | Installs SFPack on your system (register COM server, create Shortcut in startup menu, register shell extension and document type).
/Uninstall | Removes SFPack from the system (unregister COM server, delete Shortcut in startup menu, unregister shell extension and document type). After this you can safely delete all files from the SFPack package.
/RegServer | Registers the COM server for Automation (from Visual Basic, VB Script etc.). This is a standard switch supported by all Out Of Process COM servers.
/UnregServer | Unregisters the COM server. Automation Clients will not be able to use the SFPack objects any more. This is a standard switch supported by all Out Of Process COM servers.


FAQ

This tries to answer some Frequently Asked Questions:

How does it come that when I unpack a SFPack archive, the resulting SF2 file may be slightly smaller or larger compared to the original SF2 file?

SFPack is not a "give me all the bytes" compression program. Instead it analyzes the SF2 file and packs all the information in the it, but during this process also removes all the unneeded SF2 overhead. When you unpack a SFPack archive, the original SF2 file format is reconstructed.

Now, emu's SF2 "bible" is quite clear how a SF2 file should look like. But most SF2 editor/writes are not following all the specifications to the last point. SFPack does.

For example after each sample block in a SF2 file there should be exactly 46 padding bytes before the next sample block starts. Now some editors do not write any padding bytes, some editors write 256. SFPack writes 46.

This is the reason why there can be slight size differences compared to the original SF2 file.


Version History

This is a list of changes to SFPack.

SFPack RV 1.0.0.4

If a different target folder was chosen AND the Keep Directory Structure option was turned on AND the the source files resided in a root folder (e.g. C:\), the first letter of the file name was missing in the written files.

It seems sometimes I forget to turn my brain on. 1.0.0.3 made it impossible to expand/compress from the shell. I changed the shell code in 1.0.0.3 to have no limit in the amount of files compressed/expanded in one call. During this change I introduced a bug that totally broke the whole thing. I'm still wondering how this could make it into the release package.

Anyway, fixed it now.

There was an error in the Automation documentation. The compression constants have the prefix pt and not pe.

SFPack RV 1.0.0.3

Corrected the Automation compression constants (now ptFast, ptNormal, ptMaximum).

Some documentation errors in the SFPackFile Class where corrected.

Context sensitive help did not work correctly for class methods from within Visual Basic.

When Drag & Drop of a folder occurs, this folder and all sub folders are searched for SFPack for SF2 files.

The total size of all files displayed in the statusbar is now correct even if all files combined exceed 4GB.

Added new Keep Directory structure option for packing/unpacking with a target folder.

Removed a reference to SHGetSpecialFolderPath. This caused an error when the shell integration of IE4 was not installed. I hope this fixes this issue.

Added online help support for Add Files, Save File List and Attach Text dialogs.

Selection by file type (SF2 or SFPack) did not work in the File List.

Added the Reset Selected command.

Added the Paste command

The Shell Property Sheet now updates the display in a background thread. This eliminates the need to wait, if you display a LONG list of files.

SFPack RV 1.0.0.2

Initial Release


AweVBank 98

AweVBank is the explorer to your AWE32/64, SBLive or Emu APS sound card. Everything you can do in the Explorer with files, can be done in AweVBank with patches. You can copy/paste/drag them. This gives you a very intuitive way of working with patches on your sound card and hard disk/CD-ROM.

The basic idea for using a computer to make music is to have all your sound data at your fingertip. If you need a sound, you want to use it without much work. If you need to change the characteristics of a sound (or patch) you just want to change it and not go through all the trouble of creating a new sound file.

For this purpose AweVBank introduces so called Virtual SoundFonts. With Virtual SoundFonts you can save all your data on a per song basis. Only the information about patches is saved. The sample data of the patch still stays in its original place, ready to use for your next song.

Think about the following scenario:

You want to compose your own song and need a set of strings and a good brass-section. The strings are in a file called 'classic1.sf2', the brass section is located in 'brass.sf2'. Also you would like to have a very long release time for the Volume Envelope of the brass section. And there is a MOD file that has exactly the rock-organ you need ...

The normal way of doing this would be creating a new SF2 file with your favorite editor and put all the instruments into that file. Also you would very likely need a good conversion program to get the MOD sample into your SF2-bank. After this process you would load the file into the Awe and use it. But then you note that the Release time does not fit exactly for your song and the MOD-piano is a little to bright ...

How would this example look with AweVBank?

Well, you would select your source-files ('classic1.sf2', 'brass.sf2' and the MOD-file) and simply drag the patches you need directly into your sound card. Then you would simply change some of the Envelope Parameters in the built in editor and ...

That's it!

The best is that you can do all this while you're sequencer is still running. So if the brass section you chose is not the right one, just select another SF2 (or mod or wav or ...) file and get this patch. You can even let your sequencer play a loop and choose the patches you need.

Also you can save those Virtual SoundFonts and use them later, when you again edit this song. You have then again exactly the same patches, FX etc. for your project. And when your song is finished you can export your Virtual SoundFont to one single SF2 file (including all the WAVs, MODs etc.).

There are still more goodies:

As the sample-data is still in it's original place you can edit them with the best tools you have. AweVBank has an option that it always looks if any of the used files has been changed and reloads those patches automatically.

Parameters you change do not effect the original patch source. So you can use the same SF2 file for more then one song, without having to create new SoundFont file for each new flavor.

You don't need those 16 MB anymore on your AWE soundcard, cause you are able to load just those patches you really need, and don't have to load a full SoundFont only to use one patch.

Via it's unique plugin interface you can load sample data directly from a various list of sound formats.

With the DSP properties of each patch you can quickly adjust frequencies, volumes etc.

With automatic tempo adjustment you can easily fit all your loops into as song that uses a different tempo.

If you want to find out more about AweVBank 98 visit www.megota.com and download your free trial copy.


Compression Comparison

This chart compares the compression ratios of various packing programs with SFPack. The used files cover all the different aspects of soundfont files (many samples, long samples, short samples, melodic samples, drum samples). The best values for each soundfont file are bold.

SoundFont | Original [KB] | WinZip1 [KB/%] | WinRar2 [KB/%] | sfArk3 [KB/%] | SFPack4 [KB/%]
Heavenly Music's classic3.sf2 | 503 | 339/67% | 357/71% | 303/60% | 219/44%
Sonido's Flute.sf2 | 925 | 598/65% | 735/79% | 483/52% | 296/32%
5thFloor's TripHop.sf2 | 1592 | 1435/90% | 1184/74% | 1194/75% | 1060/67%
Melody Machine's MM Big Synth demo.sf2 | 1826 | 1628/89% | 863/47% | 654/36% | 499/27%
Warren Trachtman's wstmfstein.sf2 | 2581 | 2199/85% | 1554/60% | 1410/55% | 1115/43%
5thFloor's Wavestation.sf2 | 6057 | 5360/89% | 3560/59% | 3057/51% | 2601/43%
SB Live! 8 MB 8mbgmsfx.sf2 | 7394 | 6834/92% | 5546/75% | 5552/75% | 4821/65%
Emu's Phatt Presets.sf2 | 8351 | 7607/91% | 6023/72% | 6017/72% | 5322/64%
5thFloors's 100-Real Captain.sf2 | 20814 | 17434/84% | 13754/66% | 13859/67% | 11868/57%
Totals | 50043 | 43434/87% | 33576/67% | 32529/65% | 27805/56%
Average Percentage |  | 84% | 67% | 60% | 49%

1 WinZip Version 7.0 SR-1: Maxmimum Compression turned on
2 WinRar Version 2.05: Best Compression and Multimedia Compression turned on
3 sfArk Version 1.18: Faster Compression turned off
4 SFPack Version 1.0.0.2: Maximum Compression selected


Some Thanks

SFPack was inspired by sfArk from Melody Machine. It showed that it makes sense to write a SoundFont only compression program. I also enjoyed a lively and interresting discussion with the maker of sfArk. We just pushed those compression ratios to regions both us thought where not reachable.


AboutDlg

SFPack, program and documentation
Copyright © 1999 Megota Software. All rights reserved.

SFPack, the SFPack logo and the Megota Software logo are trademarks of Megota Software.
Sound Blaster is a trademark of Creative Technology Ltd.
E-mu Systems and SoundFont are registered trademarks of E-mu Systems, Inc. Cambridge
All other trademarks acknowledged.

Software License