knitr::opts_chunk$set(echo = FALSE)

library(ggplot2)
library(parn94)
library(magrittr)
library(purrr)

bigand_1996 <- system.file("bigand1996/compiled/bigand_1996.rds", 
                           package = "parn94", mustWork = TRUE) %>% readRDS
bigand_1996_reference_chord <- 
  system.file("bigand1996/compiled/bigand_1996_reference_chord.rds", 
              package = "parn94", mustWork = TRUE) %>% readRDS

theme_set(theme_bw() +
            theme(panel.grid.major = element_blank(),
                  panel.grid.minor = element_blank(),
                  strip.background = element_rect(fill = "white")))

This report compares this package's implementation of Parncutt's pitch commonality algorithm with the results reported in @Bigand1996.

Method

@Bigand1996 provide tables of metadata for the chords they used in their experiment. These tables don't actually say what the precise pitches in the chords are, but it is possible to deduce these pitches from the provided metadata. These chords and their metadata can be found in the dataset bigand_1996. We can use this data to compare implementations of Parncutt's pitch commonality algorithm.

Results

df <- bigand_1996 
df$pitch_commonality_new <- map_dbl(
  df$pitches,
  ~ pitch_commonality(as.numeric(bigand_1996_reference_chord),
                      .)
)
ggplot(df, aes(x = pitch_commonality_new, y = pitch_commonality)) +
  geom_point() +
  scale_x_continuous("New implementation") +
  scale_y_continuous("Bigand et al. (1996) implementation")

The two sets of values are highly correlated:

cor.test(df$pitch_commonality, df$pitch_commonality_new)

The differences between the results are likely to be down to the slightly different methodologies underpinning the algorithms; @Bigand1996 use the algorithm from @Parncutt1989, whereas we use the algorithm from @Parncutt1994, which uses a slightly different similarity measure for the two pitch salience profiles.

References



pmcharrison/parn94 documentation built on April 10, 2021, 1:33 p.m.