Skip to content

Instantly share code, notes, and snippets.

@pepijn-devries
Created September 26, 2015 14:27
Show Gist options
  • Save pepijn-devries/35ca5d9c12ef29409111 to your computer and use it in GitHub Desktop.
Save pepijn-devries/35ca5d9c12ef29409111 to your computer and use it in GitHub Desktop.
# play all samples in the module at note "C-3"
playSample(mod)
# play chromatic scales of octaves 2 and 3 using the 23rd sample
data(period_table)
for (i_note in as.vector(outer(names(period_table)[-1:-2],
c(2:3), function(x, y) paste(x, y, sep = ""))))
{
print(i_note)
playSample(PTSample(mod, 23), 0.1, T, i_note, 0.5)
}
# play all finetunes of C-3
for (ft in -8:7)
{
print(ft)
playSample(PTSample(mod, 23), 0.1, T, "C-3", 0.5, finetune = ft)
}
# export one of the samples as *.wav file
writeWave(PTSample(mod, 25), "guitar slide.wav")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment