library(onsetsync) # to handle onsets
library(dplyr) # to handle summaries
Ch. 11 – Synchrony
Corpus analysis example of onsets.
Load libraries
Get Cuban Salsa and Son materials
These are build into the onsetsync package and come from IEMP collection. The code runs an analysis of asynchrony across different Cuban Salsa and Son tracks (five in total) and create a table of the Bass asynchronies with Guitar and Tres (in milliseconds).
<- onsetsync::CSS_IEMP # Cuban Salsa & Son
corpus <- sync_sample_paired(corpus,'Bass','Guitar',0,1,'SD')
D <-summarise(group_by(D$asynch,name), M = mean(asynch*1000))
RES <- sync_sample_paired(corpus,'Bass','Tres',0,1,'SD')
D2 <- summarise(group_by(D2$asynch,name), M = mean(asynch*1000))
RES2 names(RES)[2] <- 'Bass - Guitar (in ms)' # rename for clarity
$`Bass - Tres (in ms)` <- RES2$M # rename for clarity
RESprint(knitr::kable(RES,digits=1)) # create table
name | Bass - Guitar (in ms) | Bass - Tres (in ms) |
---|---|---|
El Cantante | -5.2 | 14.6 |
Habanera | -11.3 | 6.6 |
Palo Santo | -16.1 | -3.5 |
Tumbao Sangreao | -12.0 | 5.2 |
Yo Naci En Un Sola | -7.1 | -4.4 |