sonifyStripes: Climate stripes sonification

View source: R/stripes.R

sonifyStripesR Documentation

Climate stripes sonification

Description

Sonification of climate stripes data, or more generally, of a time series of values. A smoothed version of the time series is computed by moving average, then sonification proceeds as follows:

  • Backtrack is a standard house-like tune, including a four-on-the-floor kick+hi-hat pattern on the drum, a bass following the drum kick, and 3 chords played by a synthesizer

  • The smoothed time series controls the master volume and the amount of 'distortion' in the synthesizer's sound

  • Large anomalies below / above the smoothed series trigger percussion sounds (by default a snare and a hand clap) that are panned full left (negative anomalies) and full right (positive anomalies)

Usage

sonifyStripes(
  values = sequenceR::globalT$Anomaly,
  bpm = 135,
  minVol = 0.1,
  nma = 10,
  pClap = 0.15,
  synthVar = 0.5,
  kick = sequenceR::mini909$bass,
  hihat = sequenceR::mini909$hihat,
  openHihat = sequenceR::mini909$hihat_o,
  posPercussion = sequenceR::mini909$snare,
  negPercussion = sequenceR::mini909$clap,
  bassNote = "E1",
  chord1 = c("E2", "E3", "G3", "D4", "Gb4"),
  chord2 = c("E2", "D3", "Gb3", "A3", "E4"),
  chord3 = c("E2", "B2", "Gb3", "G3", "D4"),
  videoFile = NULL,
  videoResFactor = 1
)

Arguments

values

Numeric vector, values to sonify. Default is global temperature anomalies over the period 1850-2021

bpm

Numeric > 0, tempo in beat per minute

minVol

Numeric >= 0, minimum volume reached when smoothed series is minimum

nma

Numeric >=0 , number of moving average steps on each side of the current value (i.e. moving average window is 2*nma+1 when possible, nma+1 on the series' edges)

pClap

Numeric in (0,0.5). "Large" anomalies triggering claps/snare are defined as anomalies below (resp. above) the pClap (resp. (1-pClap))-quantile of anomalies.

synthVar

Numeric >= 0 , controls the variability of the synthesizer sound. When zero, the synthesizer sound does not change. Large values induce more variability in the synthesizer sound.

kick

soundSample, sound sample used to play the kick drum.

hihat

soundSample, sound sample used to play the closed hi-hat.

openHihat

soundSample, sound sample used to play the open hi-hat.

posPercussion

soundSample, sound sample used to play the positive-anomaly percussion.

negPercussion

soundSample, sound sample used to play the negative-anomaly percussion.

bassNote

string, bass note (in scientific pitch notation).

chord1

string vector, first chord played by synthesizer.

chord2

string vector, second chord played by synthesizer.

chord3

string vector, third chord played by synthesizer.

videoFile

file path, full path to video file. When NULL, video is not created.

videoResFactor

Numeric > 0 , video resolution, 2 recommended for good-quality video.

Value

A list with the following components:

  • mix, tuneR::Wave object, the final mix of the sonification.

  • dat, data frame with 4 columns: time step, raw value, smoothed value, anomaly

  • quantiles, numeric vector of size 2, the quantiles defining large negative/positive anomalies

  • waves, list of tuneR::Wave object, individual waves for each instrument in case you wish to mix them in your own way.

Examples

w <- sonifyStripes()

benRenard/sequenceR documentation built on Jan. 11, 2025, 2:33 a.m.