University of York: Music Technology Group: Postgraduate study

York University Music Technology Group


The BF package - Ambisonics for Snack

Making the BF Ambisonic commands for Snack York University Music Technology Group

NOTE

The software is currently all in a pre-release stage and must be regarded as such by all users. Options, operating parameters and modes of use are all subject to change so please treat this as a trial version only.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reading further, compiling or using any portion of this code will be deemed as acceptance of these conditions in full.


How to the install the B format extensions to Snack

Windows Version

First, download the code. This is a Windows .zip file of around 200kB

For Windows users, simply unzip the archive to the top level of a drive and edit the paths in the test files in bformext/tests/ so that in the line

load ../bfpan1.0/libbfpan[info sharedlibext]

 ../bfpan1.0/libbfpan has to be changed to point to the dll in the correct directory, usually c:/bformext/win/bfpan/libbfpan.dll. If the directory structure is retained on unzipping and the test files are run from the test directory, change to the following instead..

load ../win/bfpan/libbfpan.dll

The same sort of thing will need to be done on the decoder test files. Examples of windows specific versions of the test files are prefixed win, as in wintest.tcl. Note that you will need to provide an ex1.wav mono .wav audio file (16bit and 48kHz). You can use any similar file, provided it is 500,000 samples or more long.


Unix users

Download the code then ungzip and untar it
% gunzip bformext.tar.gz

% tar -xvf bformext.tar
This will create a bformext directory with everything in it. Note that if you do not already have it available, make and install a recent version of Tcl/Tk (say 8.3) with stubs enabled.

Also, if necessary, make and install Snack with stubs enabled. If for some reason you want to use Snack version 1 (NOT ADVISED), don't forget to edit the following line in bfpan.c and bfdec.c

if (Snack_InitStubs(interp, "2", 0) == NULL) {
to read

if (Snack_InitStubs(interp, "1", 0) == NULL) {

now go into the the sub-directory bfpan

% cd bfpan/
and configure using
% ./configure --with-snack=DIR
where DIR is your local Snack directory, typically /usr/local/bin/snack2.0.6

then build with

% make
Note: do not worry about warnings about unreferenced variables - they are place holder for later additions - or that "so-and-so is not used for resolving any symbol".

Now install with

% make install

Note: to remove the library files after a failed make, do
% make clean
and to go right back to before the configure stage and start again, do
% make distclean

Test it using the test.tcl script which is in the 'tests' directory. The file ex1.wav mentioned in the script is a mono .wav audio file (16bit and 48kHz). You should replace it with any similar file, of 500,000 samples or longer, by either cp or changing the ex1.wav file name in test.tcl You will probably have to set the environment variable LD_LIBRARY_PATH to point to the build directory.
% setenv LD_LIBRARY_PATH `pwd`
and you will also need to
% setenv TCLLIBPATH /usr/local/bin/snack2.0.6/unix
(this should really go in your .login file)
 % cd ../tests/
Run the Snack extension using
% ./test.tcl
and several testmix*.wav multichannel; files will be generated. Note that you may also need to edit the script so that the line

load ../bfpan1.0/libbfpan[info sharedlibext]

points to the correct directory.

Now cd to the bfdec folder

% cd ../bfdec/
and repeat the process for bfdec.

The decoder can be tested with testdec8.tcl, which will decode to a cubic array, generating an 8 channel file called testdec8.wav or testdec4.tcl, which decodes to a square array

********** NOTA BENE ************************

Only .wav files seem to work properly in the current Snack on SGI's.

*****************writing new code************************

Please keep it simple, with NO fancy programmer's tricks. Use lots of comments, especially where pointers start to get nested. AVOID going further than pointers to pointers if at all possible - avoid even that if you can. Please use verbose naming conventions - no obscure acronyms! Use the tcl style, as in thisIsTheTclStyle, lower case first letter, word boundaries indicated by capitals at the start of each word.

D.G.M. 1st March 2001