random_muter: Randomly mute MIDI sequence

Description Usage Arguments Value Examples

View source: R/random_muter.R

Description

Takes sequence produced by drum_machine function and applies mutes to this sequence.

Usage

1
2
random_muter(seq_arg = NULL, prob = 1, position = "all",
  track_apply = NULL)

Arguments

seq_arg

The sequence to be modified. This should be the output of the drum_machine function.

prob

(default = 1) The probability a note in the sequence will be muted.

position

(default = "all") The position of items in the sequence to be muted.

track_apply

An integer or vector of integers indicating which tracks (hh, kick, snare) to apply the mute to.

Value

A modified MIDI sequence to be entered into the create_midi function.

Examples

1
2
3
4
# Applies mutes to first track (hh, or hi-hat) of drum sequence with .5 probability.

drum_machine(hh = 1:16, kick = seq(1, 16, by = 4), snare = c(5, 13)) %>%
random_muter(., prob = .5, track_apply = 1)

datadiarist/midiR documentation built on April 1, 2020, 4:29 a.m.