In data sonification, time is a very important channel to avoid chaos.
There are three types of timing in terms of when a tone is played: absolute, relative, and simultaneous.
Absolute timing means that the time channel encodes a certain quantitative or temporal data variable,
so that a time position when a tone is played at corresponds to a quantity or date-time.
In contrast, relatively timed sonification plays one tone after another,
more applicable for a nomoinal or ordinal variable.
Simultaneously-timed sounds have 0 as their start time so that they are played at the same time.
Erie supports these timings using a single time
channel.
Time channel plays another role, duration—how long a tone is played.
There are two types of duration: one along the same scale with the time
channel and one that maps a different scale.
For the former, use time2
channel; and for the latter, use duration
or tap
-related channel.
Note: duration
, tapCount
, and tapSpeed
only works for discrete tones (see the tone
documentation).
This documents introduces patterns for using the time
channel.
The default unit for time-related channels is “second” unless specified otherwise.
Absolute timing with fixed duration: time
The baseline pattern for absolute timing with fixed duration is using field
property.
With the scale
property, it is possible to set the total length
of the sonification stream, as a shortcut to the range
property.
JSON
JavaScript
Absolute timing with varied duration along the same scale: time
and time2
When the duration of a tone is determined by another field that uses the same scale of the time
channel’s field,
one can use time2
channel (similar to x2
and y2
channels in Vega-Lite).
No scale
detail is available for this channel.
If the time
channel includes bin
then time2
is not available because bin end point is encoded using the time duration.
JSON
JavaScript
Relative timing with fixed duration: time
For relative timing, such as when sonifying the mean value of a quantitative field over a nominal/ordinal field,
set the timing
property of the scale
to 'relative'
, as shown below.
One can specify the length of each tone (if not specified by duration
field) using the band
property.
JSON
JavaScript
Simiultaneous timing
The simultaneous
timing makes all the tones played at the same time (each tone’s start time is 0).
It is recommended to use a separate duration
channel with a nominal channel.
In this case, speech channels (speechBefore
, speechAfter
) are not supported (ignored).
JSON
JavaScript
Use of a tick
As an auditory axis, it’s possible to use a tick
.
It is defined using the following properties
Property | type | Description |
---|---|---|
name |
String |
(Optional) The name of the tick. |
interval |
Number (unit: seconds/beat) |
(Default: 0.5 -seconds/2 -beats) the interval between tick sounds. |
band |
Number (unit: seconds/beat) |
(Default: 0.1 -seconds/0.5 -beats) the length of each tick sound. |
playAtTime0 |
Boolean |
(Default: true ) whether to play a tick sound at the beginnig of a stream. |
oscType |
'sine'|'square'|'sawtooth'|'triangle' |
(Default: 'sine' ) the type of an oscillator. See here for details. |
pitch |
Number |
(Default: 150 ) the pitch frequency of the tick sound. |
loudness |
Number[0-1] |
(Default: 0.4 ) the relative loudness of the tick sound. |