freq2wave {music}R Documentation

Frequency to waveform

Description

Frequency to waveform

Usage

freq2wave(
  frequency,
  oscillator = c("sine", "square", "saw", "triangle"),
  duration = 1,
  BPM = 120,
  sample.rate = 44100,
  attack.time = 50,
  inner.release.time = 50,
  plot = FALSE
)

Arguments

frequency

Float, vector: Frequency/ies to convert to waveform

oscillator

String: "sine", "square", "saw". Default = "sine"

duration

Float: Note duration in beats. Default = 1

BPM

Integer: Beats per minute. Default = 120

sample.rate

Integer: Sample rate. Default = 44100

attack.time

Integer: Attack time. Default = 50 (Helps prevent popping)

inner.release.time

Integer: Release time, that ends on note OFF (instead of beginning at note OFF). Default = 50 (Also helps prevent popping)

plot

Logical: If TRUE, plot wave(s) using mplot

Author(s)

E.D. Gennatas

Examples

wave <- freq2wave(note2freq(buildChord("A4", "sus2")))

[Package music version 0.1.2 Index]