Giter VIP home page Giter VIP logo

bowl18's Introduction

bowl18: Implementation of Bowling et al.’s (2018) Vocal Similarity Algorithms

lifecycle Travis build status AppVeyor build status Coverage status DOI

The bowl18 R package implements Bowling et al.’s (2018) vocal similarity algorithms.

Installation

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

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

Usage

Bowling et al. (2018) formalise two aspects of a musical chord’s ‘vocal similarity’:

  1. Its similarity to the harmonic series, assessed with the gill09_harmonicity() function;
  2. The absence of small frequency intervals, assessed with the bowl18_min_freq_dist() function.

gill09_harmonicity

gill09_harmonicity() measures a chord’s similarity to a harmonic series, after Gill & Purves (2009). It assumes that chord pitches are precisely aligned with the just-tuned scale provided by Bowling et al. (2018).

By default, gill09_harmonicity assumes that the input is a vector of MIDI pitch numbers. We recommend using the hrep package to clarify this input format, as follows:

library(bowl18)
library(hrep)

# Constructing chords with pi_chord()
pi_chord(c(60, 64, 67)) # C major chord
#> Pitch chord: 60 64 67

# Major chord
gill09_harmonicity(pi_chord(c(60, 64, 67)))
#> [1] 0.4666667

# Diminished chord
gill09_harmonicity(pi_chord(c(60, 63, 66)))
#> [1] 0.4285714

# Augmented chord
gill09_harmonicity(pi_chord(c(60, 64, 68)))
#> [1] 0.105

bowl18_min_freq_dist

bowl18_min_freq_dist() returns the minimum frequency distance between the fundamental frequencies of a chord. It makes no assumptions about the chord’s tuning.

By default, bowl18_min_freq_dist() assumes that the input is a vector of frequencies. We recommend using the hrep package to clarify this input format, as follows:

library(bowl18)
library(hrep)

# Constructing chords with pi_chord() and fr_chord()
x <- pi_chord(c(60, 64, 67)) # C major chord
fr_chord(x) 
#> Frequency chord: 261.626 Hz, 329.628 Hz, 391.995 Hz

# Major chord
bowl18_min_freq_dist(fr_chord(pi_chord(c(60, 64, 67))))
#> [1] 62.36788

# Cluster chord
bowl18_min_freq_dist(fr_chord(pi_chord(c(60, 61, 62))))
#> [1] 15.55707

Bowling et al. (2018) argue that, in particular, frequency differences smaller than 50 Hz contribute negatively to consonance.

References

Bowling, D. L., Purves, D., & Gill, K. Z. (2018). Vocal similarity predicts the relative attraction of musical chords. Proceedings of the National Academy of Sciences, 115(1), 216–221. https://doi.org/10.1073/pnas.1713206115

Gill, K. Z., & Purves, D. (2009). A biological rationale for musical scales. PLoS ONE, 4(12), 1–9. https://doi.org/10.1371/journal.pone.0008144

bowl18's People

Stargazers

 avatar

Watchers

 avatar

Forkers

homeymusic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.