Demo batch files¶
The content of the demo batch file :
@echo off melfeature -c ../config/melfeature/all_features_solo_level.yml start %MELOSPY_PATH%analysis\features_solo_level.csv
With the first line most MS-DOS batch files start. It supresses all output of the issued commands. Without this line, the functionality would be still the same.
The next line starts melfeature using the configuration file
../config/melfeature/all_features_solo_level.yml, which is contained in the
MS-DOS normally uses the Backslash
\\ as a file separator, but the forward slash
/ works perfectly as well, as can be seen in the example above. The advantage of using forward slashes
is that they work cross-platform, so we will mostly stick to using them.
-c option here, tells melfeature to use a configuration file for all program control specifications, which is typically much more convenient than doing the same with normal
commandline options. The configuration file is a plain text file using a simple markup language called YAML, and contains all information for melfeature to run
properly. The basic function of melfeature is to select a set of melodies, either from a database or from files, and to perform feature extractions, which results are then saved in a single CSV file.
The CSV file is also a simple text file with a header line specifying the meaning of the file columns. Each row in the CSV- file is of identical format and holds feature values
in different columns. Each row corresponds to a melody in the input set or to parts of the melodies (e.g., phrases, choruses) if segmentation is used. CSV files are readily usable with
any spread sheet program such as Excel or Calc. This is used in the next line of the batch file:
which starts the result file. The exact action depends on the configuration of the Windows system, since the
start command will try to start the default action for CSV files,
mostly this will be Excel, but might also be undefined. The result file name follows after the start command (separated by a blank).
%MELOSPY_PATH% will be automatically substituted by the content of the environment variable
MELOSPY_PATH which should be pointing to the ROOT directory of your MeloSpySuite
installation, hence, most probably to
C:\MeloSpySuite. The configuration file happens to specify the result file exactly to be
ROOT/analysis/features_solo_level.csv, so after
running melfeature the result file should be opened automatically in Excel (or whatever the default application for CSV is).
Environment variables are system-wide variables that are accessible by all programs and are hence used for configurational purposes. For instance, the MSI installer generates the new
MELOSPY_PATH, which is, however, only accessible everywhere in the system first after a restart. Environment variables can have different scopes, e.g., each user
can have it its own personal set of environment variables. Actually, each single commandline window gets a copy of the current environment variables as defined in the registry,
but these can be altered by MSDOS command during the single session.
Next part: General settings.