README.md

jl12: Johnson-Laird’s (2012) Tonal Dissonance Model

lifecycle Travis build
status AppVeyor build
status Coverage
status DOI

The jl12 R package implements Johnson-Laird’s (2012) tonal dissonance model.

Installation

Within R, you can install the current version of jl12 from Github as follows:

if (!require(devtools)) install.packages("devtools")
devtools::install_github("jl12")

Usage

Higher scores correspond to greater dissonance. These scores correspond to each of the distinguishable categories in the cultural component of Johnson-Laird et al.’s (2012) algorithm.

Major chord:

library(jl12)
jl_tonal_dissonance(c(0, 4, 7))
#> [1] 1

Minor chord:

jl_tonal_dissonance(c(0, 3, 7))
#> [1] 3

Cluster chord:

jl_tonal_dissonance(c(0, 1, 2))
#> [1] 12

The model comprises several rules. It is possible to call these rules individually, for example:

jl_rule_1(c(0, 3, 7))
#> [1] 1
jl_rule_2(c(0, 3, 7))
#> [1] TRUE
jl_rule_3(c(0, 3, 7))
#> [1] FALSE
#> attr(,"solution")
#> [1]  0  3  7 10

References

Johnson-Laird, P. N., Kang, O. E., & Leong, Y. C. (2012). On musical dissonance. Music Perception, 30(1), 19–35.



pmcharrison/jl12 documentation built on July 6, 2019, 10:27 a.m.