Skip to content

Commit

Permalink
Merge pull request #15 from pmcharrison/dev
Browse files Browse the repository at this point in the history
hrep v0.11.0
  • Loading branch information
pmcharrison committed Sep 20, 2019
2 parents ccbfb18 + 183d9a3 commit 92bdbdb
Show file tree
Hide file tree
Showing 123 changed files with 2,577 additions and 801 deletions.
22 changes: 15 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
Package: hrep
Title: Harmony Representations
Version: 0.10.0
Version: 0.11.0
Authors@R: person("Peter", "Harrison", email = "pmc.harrison@gmail.com", role = c("aut", "cre"))
Description: This package provides methods for representing and manipulating chord sequences.
Description: This package provides utilities for representing and manipulating
chord sequences for perceptually informed harmony modelling.
The available representations include symbolic representations,
acoustic representations, and sensory representations.
Integer encodings are defined for several symbolic representations,
allowing the user to efficiently express chord sequences as sequences
of integers.
Depends: R (>= 3.4.0)
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
ByteCompile: true
Suggests:
testthat (>= 2.0.0),
sets (>= 1.0.18),
covr (>= 3.2.0)
testthat (>= 2.1.0),
covr (>= 3.2.0),
ggplot2 (>= 3.0.0)
RoxygenNote: 6.1.1
Imports:
plyr (>= 1.8.4),
Expand All @@ -21,12 +27,14 @@ Imports:
magrittr (>= 1.5),
memoise (>= 1.1.0),
methods,
ggplot2 (>= 3.0.0),
tuneR (>= 1.3.3),
abcR (>= 0.0.0.9005),
tibble (>= 1.4.2),
utils,
glue
glue (>= 1.3.1),
data.table (>= 1.12.2),
readr (>= 1.3.1),
ellipsis (>= 0.2.0.1)
RdMacros: Rdpack
Remotes: pmcharrison/abcR
URL: https://github.com/pmcharrison/hrep
Expand Down
75 changes: 55 additions & 20 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ S3method("[[<-",coded_vec)
S3method("[[<-",corpus)
S3method("[[<-",vec)
S3method("amp<-",sparse_fr_spectrum)
S3method("amp<-",sparse_pc_spectrum)
S3method("amp<-",sparse_pi_spectrum)
S3method("freq<-",sparse_fr_spectrum)
S3method("metadata<-",coded_vec)
S3method("metadata<-",corpus)
S3method("pc<-",sparse_pc_spectrum)
S3method("pitch<-",sparse_pi_spectrum)
S3method("y_lab<-",sparse_spectrum)
S3method("y_unit<-",sparse_spectrum)
S3method(Ops,pc_chord)
S3method(Ops,pc_set)
S3method(Ops,pi_chord)
S3method(amp,sparse_fr_spectrum)
S3method(amp,sparse_pc_spectrum)
S3method(amp,sparse_pi_spectrum)
S3method(as.character,fr_chord)
S3method(as.character,int_vec)
Expand All @@ -36,29 +39,22 @@ S3method(as.numeric,fr_chord)
S3method(as.numeric,int_vec)
S3method(as.numeric,pc_chord)
S3method(as.numeric,pi_chord)
S3method(c,chord)
S3method(c,corpus)
S3method(c,fr_chord)
S3method(c,pc_chord)
S3method(c,pc_set)
S3method(c,pc_set_norm_form)
S3method(c,pi_chord)
S3method(c,smooth_spectrum)
S3method(c,sparse_fr_spectrum)
S3method(c,sparse_pi_spectrum)
S3method(decode,corpus)
S3method(decode,integer)
S3method(edit_bass_pc,pc_chord)
S3method(encode,coded_vec)
S3method(encode,corpus)
S3method(encode,pc_chord)
S3method(encode,pc_chord_type)
S3method(encode,pc_set)
S3method(encode,pc_set_norm_form)
S3method(encode,pc_set_type)
S3method(encode,vec)
S3method(expand_harmonics,pi_chord)
S3method(expand_harmonics,sparse_fr_spectrum)
S3method(expand_harmonics,sparse_pi_spectrum)
S3method(fr_chord,character)
S3method(fr_chord,chord)
S3method(fr_chord,fr_chord)
S3method(fr_chord,numeric)
S3method(fr_chord,pc_chord)
Expand Down Expand Up @@ -98,7 +94,9 @@ S3method(num_elements,coded_vec)
S3method(num_elements,corpus)
S3method(num_elements,vec)
S3method(num_sequences,corpus)
S3method(pc,sparse_pc_spectrum)
S3method(pc_chord,character)
S3method(pc_chord,chord)
S3method(pc_chord,fr_chord)
S3method(pc_chord,numeric)
S3method(pc_chord,pc_chord)
Expand All @@ -108,26 +106,28 @@ S3method(pc_chord,pi_chord)
S3method(pc_chord_type,default)
S3method(pc_chord_type,pc_chord)
S3method(pc_chord_type,pc_set)
S3method(pc_chord_type,pc_set_norm_form)
S3method(pc_chord_type,pc_set_norm_order)
S3method(pc_chord_type,pc_set_type)
S3method(pc_chord_type,pi_chord)
S3method(pc_chord_type,smooth_spectrum)
S3method(pc_chord_type,sparse_spectrum)
S3method(pc_set,character)
S3method(pc_set,chord)
S3method(pc_set,fr_chord)
S3method(pc_set,numeric)
S3method(pc_set,pc_chord)
S3method(pc_set,pc_set)
S3method(pc_set,pc_set_norm_form)
S3method(pc_set,pc_set_norm_order)
S3method(pc_set,pc_set_type)
S3method(pc_set,pi_chord)
S3method(pc_set_norm_form,default)
S3method(pc_set_norm_form,pc_set)
S3method(pc_set_norm_form,pc_set_norm_form)
S3method(pc_set_norm_form,pc_set_norm_order)
S3method(pc_set_norm_order,numeric)
S3method(pc_set_norm_order,pc_set)
S3method(pc_set_type,default)
S3method(pc_set_type,pc_set)
S3method(pc_set_type,pc_set_norm_order)
S3method(pc_set_type,pc_set_type)
S3method(pi_chord,character)
S3method(pi_chord,chord)
S3method(pi_chord,fr_chord)
S3method(pi_chord,numeric)
S3method(pi_chord,pc_chord)
Expand All @@ -150,8 +150,8 @@ S3method(print,int_vec)
S3method(print,pc_chord)
S3method(print,pc_chord_type)
S3method(print,pc_set)
S3method(print,pc_set_norm_form)
S3method(print,pc_set_norm_order)
S3method(print,pc_set_type)
S3method(print,pi_chord)
S3method(print,pi_chord_type)
S3method(print,smooth_spectrum)
Expand All @@ -171,26 +171,37 @@ S3method(save_wav_sox,pi_chord)
S3method(save_wav_sox,sparse_fr_spectrum)
S3method(save_wav_sox,sparse_pi_spectrum)
S3method(save_wav_sox,vec)
S3method(smooth_pc_spectrum,default)
S3method(smooth_pc_spectrum,sparse_pc_spectrum)
S3method(smooth_pi_spectrum,default)
S3method(smooth_pi_spectrum,sparse_pi_spectrum)
S3method(sparse_fr_spectrum,default)
S3method(sparse_fr_spectrum,list)
S3method(sparse_fr_spectrum,pi_chord)
S3method(sparse_fr_spectrum,sparse_fr_spectrum)
S3method(sparse_fr_spectrum,sparse_pi_spectrum)
S3method(sparse_pc_spectrum,default)
S3method(sparse_pc_spectrum,list)
S3method(sparse_pc_spectrum,pi_chord)
S3method(sparse_pc_spectrum,sparse_fr_spectrum)
S3method(sparse_pi_spectrum,default)
S3method(sparse_pi_spectrum,fr_sparse_spectrum)
S3method(sparse_pi_spectrum,list)
S3method(sparse_pi_spectrum,pi_chord)
S3method(sparse_pi_spectrum,sparse_fr_spectrum)
S3method(sparse_pi_spectrum,sparse_pi_spectrum)
S3method(tp,pc_chord)
S3method(tp,pc_set)
S3method(tp,pi_chord)
S3method(transform_symbols,coded_vec)
S3method(transform_symbols,corpus)
S3method(transform_symbols,vec)
S3method(transposition,pc_set_norm_form)
S3method(transposition,pc_set_type)
S3method(type,coded_vec)
S3method(type,corpus)
S3method(type,default)
S3method(type,vec)
S3method(upper,smooth_spectrum)
S3method(view,coded_vec)
S3method(view,pc_chord)
S3method(view,pc_set)
S3method(view,pi_chord)
Expand All @@ -208,32 +219,46 @@ S3method(y_lab,smooth_spectrum)
S3method(y_lab,sparse_spectrum)
S3method(y_unit,smooth_spectrum)
S3method(y_unit,sparse_spectrum)
export("%>%")
export("amp<-")
export("freq<-")
export("metadata<-")
export("pc<-")
export("pitch<-")
export(.milne_pc_spectrum)
export(.smooth_pc_spectrum)
export(.smooth_pi_spectrum)
export(.wave)
export(alphabet_size)
export(amp)
export(amplitude_to_dB)
export(ascending_pc_dist)
export(coded_vec)
export(combine_sparse_spectra)
export(corpus)
export(cosine_similarity)
export(dB_to_amplitude)
export(decode)
export(decode_chord_quality)
export(decode_pc_chord)
export(decode_pc_chord_type)
export(decode_pc_set)
export(edit_bass_pc)
export(encode)
export(encode_pc_chord)
export(encode_pc_chord_type)
export(encode_pc_set)
export(expand_harmonics)
export(fr_chord)
export(freq)
export(freq_to_midi)
export(get_bass_fr)
export(get_bass_pc)
export(get_bass_pi)
export(get_chord_qualities_df)
export(get_non_bass_pc)
export(high_eq)
export(initialise_chord_qualities)
export(int_vec)
export(is.chord)
export(is.coded)
Expand All @@ -245,6 +270,11 @@ export(is.milne_pc_spectrum)
export(is.pc_chord)
export(is.pc_set)
export(is.pi_chord)
export(is.smooth_pc_spectrum)
export(is.smooth_pi_spectrum)
export(is.sparse_fr_spectrum)
export(is.sparse_pc_spectrum)
export(is.sparse_pi_spectrum)
export(is.vec)
export(label)
export(list_chords)
Expand All @@ -257,21 +287,26 @@ export(milne_pc_spec_dist)
export(milne_pc_spectrum)
export(num_elements)
export(num_sequences)
export(pc)
export(pc_chord)
export(pc_chord_type)
export(pc_dist)
export(pc_set)
export(pc_set_norm_form)
export(pc_set_norm_order)
export(pc_set_type)
export(pi_chord)
export(pi_chord_type)
export(pi_to_pc)
export(pitch)
export(play_sox)
export(register_chord_quality)
export(represent)
export(sample_rate)
export(save_wav_sox)
export(smooth_pc_spectrum)
export(smooth_pi_spectrum)
export(sparse_fr_spectrum)
export(sparse_pc_spectrum)
export(sparse_pi_spectrum)
export(sum_amplitudes)
export(tp)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# hrep 0.11.0

- BREAKING CHANGE - changed integer encodings for symbolic representations.
- Implementing chord qualities dictionary (see `decode_chord_quality`).
- Improved API for `decode` function.
- Implemented new representations: `smooth_pi_spectrum`, `smooth_pc_spectrum`,
`sparse_pc_spectrum`.
- Renamed `pc_set_norm_form` to `pc_set_type`.
- Improved documentation.

# hrep 0.10.0

- Added documentation website.
Expand Down
8 changes: 8 additions & 0 deletions R/accessor.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ pitch <- function(x) UseMethod("pitch")
#' @export
`pitch<-` <- function(x, value) UseMethod("pitch<-")

#' @rdname access
#' @export
pc <- function(x) UseMethod("pc")

#' @rdname access
#' @export
`pc<-` <- function(x, value) UseMethod("pc<-")

#' @rdname access
#' @export
amp <- function(x) UseMethod("amp")
Expand Down
2 changes: 1 addition & 1 deletion R/alphabet-size.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ pc_set_alphabet_size <- function() {
}

pc_chord_type_alphabet_size <- function() {
pc_chord_alphabet_size() / 12L
length(hrep::pc_chord_type_alphabet$by_id)
}
5 changes: 5 additions & 0 deletions R/assert-installed.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
assert_installed <- function(pkg, cran = TRUE) {
if (!requireNamespace(pkg))
stop("package '", pkg, "' must be installed to run this function. ",
if (cran) "Install it with install.packages('", pkg, "').")
}
Loading

0 comments on commit 92bdbdb

Please sign in to comment.