getSynth | R Documentation |
Creates an additive, Hammond-inspired Synthesizer. Higher harmonics decay faster and have smaller sustain.
getSynth(
notes,
nHarmonics = 5,
peak = 0.03,
decay = 0.8,
duration = 1,
sustain = 0.25,
decayPar = 1,
sustainPar = 4,
type = "sine"
)
notes |
Character vector, note names |
nHarmonics |
Integer >=1, number of harmonics |
peak |
Numeric, peak time in seconds |
decay |
Numeric, end-of-decay time in seconds |
duration |
Numeric, total duration in seconds |
sustain |
Numeric, sustain volume |
decayPar |
Numeric, the higher the value the smaller the decay time for higher harmonics |
sustainPar |
Numeric, the higher the value the smaller the sustain volume for higher harmonics |
type |
String, oscillator type, one of 'sine', 'saw', 'square' or 'triangle'. If an unknown string is provided, a sine oscillator will be used. |
An object of class 'instrument'.
synth <- getSynth(c('E2','B2','E3','G3','A3'))
w=play.instrument(synth,time=(0:(length(synth)-1))*0.5,fadeout=rep(Inf,length(synth)))
tuneR::plot(w)
## Not run:
# This line of code is wrapped in \dontrun{} since it relies
# on an external audio player to play the audio sample.
# See ?tuneR::setWavPlayer for setting a default player.
tuneR::play(w)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.