jnyqide
Class InstrumentCharacteristics
java.lang.Object
jnyqide.InstrumentCharacteristics
public class InstrumentCharacteristics
- extends java.lang.Object
Class: InstrumentCharacteristics
Author: Priyanka Raghavan and Roger B. Dannenberg
Description: The instrument characteristics class reads from
the instruments.txt file and stores the
instrument characteristics such as the subcategory,name,library.
The characteristics include the implementation and parameter
description. The different parameters are added as an arraylist.
Syntax for the instruments.txt file:
(see instruments.txt for examples, it should be clear)
Each sound is described by a function declaration preceded by
a category like this:
category:subcategory[function](parameters)
where category and subcategory determine what appears in the
pull-down lists in the browser, and function is the lisp
function to call (if omitted, then subcategory is also the
function name). parameters is a comma-separated list of
parameter declarations. Each parameter is of the form
type name = default (low:high)
where type is "int" or "float", name is the parameter name
(if the parameter is a keyword parameter, it is prefixed with
a colon), and low:high gives the range for a slider.
After the function declaration, there can be specifications for
the implementation of the function. There should be either
a pair of implementations for LISP and SAL, or a single
REQUIRE. The LISP and SAL implementation is specified as follows:
LISP-SOURCE
SAL-SOURCE
and the REQUIRE is specified as follows:
REQUIRE "path to implementation file to be loaded"
After the implementation specifications (if any), the
sound description is terminated by the following line:
END-SOUND
There may be any number of these sound specifications (instruments)
in the file.
When a user selects an instrument in the browser, the appropriate
implementation is constructed (using SAL-SOURCE or LISP-SOURCE if
present, otherwise using REQUIRE to load a file) and the function
is called with parameters chosen by sliders.
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getCategoryName
public java.lang.String getCategoryName()
setCategoryName
public void setCategoryName(java.lang.String name)
setSubcategoryName
public void setSubcategoryName(java.lang.String subname)
getSubcategoryName
public java.lang.String getSubcategoryName()
getFunctionName
public java.lang.String getFunctionName()
addParameter
public void addParameter(java.lang.String name,
java.lang.String minValue,
java.lang.String maxValue,
java.lang.String defaultValue,
java.lang.String type)
getParameters
public java.util.ArrayList getParameters()
getLispImplementation
public java.lang.String getLispImplementation()
getSalImplementation
public java.lang.String getSalImplementation()
getRequire
public java.lang.String getRequire()
readImplementation
public java.lang.String readImplementation(java.io.BufferedReader br)
throws java.lang.Exception
- Throws:
java.lang.Exception
readData
public boolean readData(java.io.BufferedReader br)