Next: , Previous: Configuration Files, Up: Configuration Files


6.1 `.sporch' Initialization File

SPORCH looks for this in the user's home directory. Most of these settings are default values that can be overridden by command options, settings in other files and API calls. Some settings are ignored depending on which program is being run (sporchdb, sporchq or sporch/libsporch.so). The settings with default- prefixes aren't used by sporchdb so that subsequent runs aren't affected by any changes that might be made here—they are used mostly by sporch and libsporch.so.

See `.sporch' Initialization File Example, for an example.

db-dir
(string, default = ‘install/path/share/sporch/db’) This is the default directory in which the sporch database, configuration files and sound samples are to be found. It is set to read SPORCH's sample database by default.
These are all default filenames for other configuration files:
db-name
(string, default = ‘db’) This is the name of the database file, a binary file that contains all of SPORCH's analysis data. sporchdb creates this file in directory db-dir.
inst-conf-name
(string, default = ‘insts’) This is the name of the instrument definition file, which tells sporchdb how to combine sound file analyses and sort them according to different instruments, techniques and tunings. sporchdb looks for this in directory db-dir.
db-conf-name
(string, default = ‘conf’) This is the name of an analysis configuration file, which tells sporchdb how to analyze the sound files that are in the same directory as it. sporchdb looks for files of this name in db-dir and all of its subdirectories.

fft-pow-limit
(integer, default = ‘2’) SPORCH chooses FFT sizes that are powers of two by default. Setting this to a higher number allows FFT sizes that are combinations of different powers. (For example, setting this to ‘5’ would allow FFT sizes that are combinations of powers of 2, 3 and 5). This setting exists because SPORCH uses FFTW to do its spectral analyses and FFTW can efficiently perform FFTs of different sizes. It is used specifically when SPORCH must calculate the FFT size from a time duration and the sample rate of a sound file.
These settings affect how temporary files are created when sporchdb analyzes sound files.
use-tmp-files
(‘yes’ or ‘no’, default = ‘yes’) Tells sporchdb whether or not to use temporary cache files when analyzing sound files.
tmp-file-ext
(string, default = ‘dat’) This is the extension that gets added on to the ends of temporary cache files (created when sporchdb analyzes sound files). These files are also hidden (a dot is placed at the beginning of the filename).
rm-extra-tmp-files
(‘yes’ or ‘no’, default = ‘yes’) Tells sporchdb to remove unused cache files. Only files that end in tmp-file-ext are removed.

These are all default options for sporch and libsporch.so (and not sporchdb).
default-src-file
(string) Specifies a default source file to analyze. This is used by sporch and libsporch.so.
default-tuning
(string) Specifies the name of the default tuning to be used. If none is specified, the default from the insts file is used. This is used by sporch, libsporch.so and sporchq.
default-n-dyns
(integer, default = ‘6’) This setting is only used by sporch and libsporch.so. This changes the range of dynamic levels that appear in the output. Other n-dyns settings that appear elsewhere might refer to the range of levels that are compiled into the database, which is different. The database is compiled only for a fixed range of dynamic levels, so if this number differs from that, SPORCH scales its final output value accordingly.
Default orchestra selection settings:
default-orchfile
(string) Specifies the path to a default orchestra definition file. This setting is only used by sporch and libsporch.so.
default-orch
(string) Specifies the name of the default orchestra (group of instruments) to use. The name must appear in a top-level group of instruments in the orchestra definition file.

These default options define a segment within a sound file. They are useful when one sound file contains several or many samples or recordings. The analysis location (loc) is relative to the beginning and end of this segment.
default-off1
(float or ‘none’, secs.) This setting is only used by sporch and libsporch.so. If specified, indicates the beginning of the analysis segment. If not set, the beginning of the analysis segment defaults to the beginning of the sound file. The location given by loc is relative to this setting.
default-off2
(float or ‘none’, secs.) This setting is only used by sporch and libsporch.so. If specified, indicates the end of the analysis segment. If not set (and dur isn't set), the end of the analysis segment defaults to the end of the sound file. The location given by loc is relative to this setting.
default-dur
(float or ‘none’, secs.) This setting is only used by sporch and libsporch.so. Specifies that the end of the analysis segment is off1 plus this value. If not set (and off2 isn't set), indicates that the end of the analysis segment is the end of the sound file. The location given by loc is relative to this setting.

Analysis location default options:
default-loc
(‘begin’, ‘middle’, ‘end’ or ‘peak’, default = ‘begin’) This is only used by sporch and libsporch.so (also, the default for loc in conf files is ‘peak’). This plus off is the point in the file where the FFT (or first FFT if there are more than one) is centered. If off1 and off2 or dur are set, this location is relative to those values.
default-off
(float, secs., default = ‘0’) This setting is only used by sporch and libsporch.so. The value is relative to the location indicated by loc. It is the point in the file where the FFT (or first FFT if there are more than one) is centered.

FFT options:
default-fft-size
(float, secs. or integer in sample frames, default = ‘0.05’) This setting is only used by sporch and libsporch.so. Specifies the default FFT size used when analyzing sound files. If a floating point value is given, SPORCH uses the sound file's sample rate and calculates the lowest number of frames that fits that duration. The resulting FFT size is a power of 2 by default or whatever powers are specified in fft-pow-limit.
default-fft-n
(integer, default = ‘1’) This setting is only used by sporch and libsporch.so. It specifies how many total FFT analyses are taken (over the duration given by fft-span.
default-fft-span
(float, secs., default = ‘1’) This setting is only used by sporch and libsporch.so. Specifies the duration over which the number of FFTs specified in default-fft-n are taken. The segment should represent a sustained portion of the sound since the FFTs taken are pruned and then averaged before peaks are extracted from them.
default-fft-ave
(integer, default = ‘1’) This setting is only used by sporch and libsporch.so. Specifies the number of FFT analyses that are averaged together before peaks are extracted. These FFTs are chosen from the total number specified in fft-n and represent the ones that deviate the least from the norm (in terms of mean-squared error calculation between pairs of FFTs).

Settings affecting peak extraction:
default-amp
(float or ‘none’, dB) This setting is only used by sporch and libsporch.so. If set, amplifies or attenuates the magnitude of each FFT bin by some amount before peaks are extracted.
default-thresh
(float, dB, default = ‘-120’) This setting is only used by sporch and libsporch.so. It is a required threshold value that specifies the lowest amplitude allowable when extracting peaks from an FFT analysis.
default-tune
(float or ‘none’, cents) This setting is only used by sporch and libsporch.so. If given, specifies that all frequencies of peaks extracted from an FFT analysis be adjusted by the specified amount.

Search depth options:
default-max-branch
(integer, default = ‘1’) This constrains the number of branches that can occur at any search node. It can be used to prevent SPORCH from expanding its depth-first search to the point where it takes forever to return a solution. SPORCH only expands nodes when the scores of the best choices are sufficiently close to each other (this is controlled by search-inc). Although the size of each expansion is usually only 1 or a small number, this setting prevents the algorithm from occasionally expanding a node by some drastic amount and adding a huge amount of unwanted complexity to the search.
default-search-inc
(float, default = ‘0’) This is a floating point number (between 0 and 1 or higher) which effectively increases the depth of SPORCH's search. Technically, it is the maximum difference between the best score and another score which can exist for a branch to occur at a search node. If this value is increased then max-branch should be increased too. ‘0’ is the fastest setting and corresponds to linear matching (instruments are added to the solution sequentially one after the other—no branches ever occur in the search unless two or more matches have the exact same score and max-branch is greater than 1). An extremely high value (greater than 1) causes SPORCH to execute an exhaustive depth-first search. Setting this to something reasonable (close to 0) causes SPORCH to branch only when alternate solutions have scores that are close. Increasing this setting by a small amount causes more branches to occur and the search depth to increase.

The following settings affect how sporchdb uses gnuplot to create graphs:
gnuplot-hdr
(list of strings, default = ‘("set terminal $term" "set xlabel $x" "set ylabel $y" "$plot title $title with $style")’) This is the header text that is sent to gnuplot before sporchq sends plot data to it. You can change this to customize your plots if you want. Several dollar-sign variables need to appear in the header and are replaced by various things: ‘$term’ is replaced by the terminal type (setting gnuplot-term), ‘$x’ by the X-axis label, ‘$y’ by the Y-axis label, ‘$plot’ by the plot command, ‘$title’ by the plot title and ‘$style’ by the line style.
gnuplot-term
(string, default = ‘dumb 119 36’) This specifies a gnuplot terminal. The default tells gnuplot to create a 119x36 ASCII graph. Terminal strings such as ‘x11 persist’ create pop-up windows that look better (the ‘persist’ string insures that the window still exists when sporchq exits).
gnuplot-exe
(string, default = ‘/path/to/gnuplot’) This is the path to the gnuplot executable.
gnuplot-style-norm
(string, default = ‘lines’) This is the gnuplot line style used when plotting everything except amplitude peaks.
gnuplot-style-peaks
(string, default = ‘linespoints’) This line style is used by gnuplot when plotting amplitude peaks.