mod <- pt2_read_mod(pt2_demo())
## select a specific cell from the first pattern
cell <- pt2_cell(mod$patterns[[1]], 0L, 0L)
## get the note played by this particular cell
pt2_note(cell)
## Replace the notes in the first pattern
## with those of the first bar of
## 'Frère Jacques'
pt2_note(mod$patterns[[1]][]) <-
c("C-2", "---", "---", "---",
"D-2", "---", "---", "---",
"E-2", "---", "---", "---",
"C-2", "---", "---", "---")
Run the code above in your browser using DataLab