Define the parameter mapping for an instrument.
Requires
- module:modules/sonification
Members
-
duration :string|number|function
-
Define the duration of the notes for this instrument. This can be a string with a data property name, e.g.
'y'
, in which case this data property is used to define the duration relative to they
-values of the other points. A highery
value would then result in a longer duration. Alternatively,'-y'
can be used, in which case the polarity is inverted, and a highery
value would result in a shorter duration. This option can also be a fixed number or a function. If it is a function, this function is called once before the note starts playing, and should return the duration in milliseconds. It receives two arguments: The point, and the dataExtremes.Type:
- string | number | function
-
frequency :string|number|function
-
Define the frequency of the instrument. This can be a string with a data property name, e.g.
'y'
, in which case this data property is used to define the frequency relative to they
-values of the other points. A highery
value would then result in a higher frequency. Alternatively,'-y'
can be used, in which case the polarity is inverted, and a highery
value would result in a lower frequency. This option can also be a fixed number or a function. If it is a function, this function is called in regular intervals while the note is playing. It receives three arguments: The point, the dataExtremes, and the current relative time - where 0 is the beginning of the note and 1 is the end. The function should return the frequency of the note as a number (in Hz).Type:
- string | number | function
-
pan :string|number|function|undefined
-
Define the panning of the instrument. This can be a string with a data property name, e.g.
'x'
, in which case this data property is used to define the panning relative to thex
-values of the other points. A higherx
value would then result in a higher panning value (panned further to the right). Alternatively,'-x'
can be used, in which case the polarity is inverted, and a higherx
value would result in a lower panning value (panned further to the left). This option can also be a fixed number or a function. If it is a function, this function is called in regular intervals while the note is playing. It receives three arguments: The point, the dataExtremes, and the current relative time - where 0 is the beginning of the note and 1 is the end. The function should return the panning of the note as a number between -1 and 1.Type:
- string | number | function | undefined
-
volume :string|number|function
-
Define the volume of the instrument. This can be a string with a data property name, e.g.
'y'
, in which case this data property is used to define the volume relative to they
-values of the other points. A highery
value would then result in a higher volume. Alternatively,'-y'
can be used, which inverts the polarity, so that a highery
value results in a lower volume. This option can also be a fixed number or a function. If it is a function, this function is called in regular intervals while the note is playing. It receives three arguments: The point, the dataExtremes, and the current relative time - where 0 is the beginning of the note and 1 is the end. The function should return the volume of the note as a number between 0 and 1.Type:
- string | number | function