compmus_gather_chroma.Rd
These functions gather chroma or timbre vectors into long format for
Computational Musicology, as generated by
get_tidy_audio_analysis
.
compmus_gather_chroma(dat)
compmus_gather_timbre(dat)
Data frame with a pitches
or timbre
column.
compmus_gather_timbre
: Gather chroma/timbre vectors
library(tidyverse)
get_tidy_audio_analysis("6IQILcYkN2S2eSu5IHoPEH") %>%
select(segments) %>%
unnest(segments) %>%
compmus_gather_chroma()
#> # A tibble: 52,656 × 10
#> start duration confide…¹ loudn…² loudn…³ loudn…⁴ loudn…⁵ timbre pitch…⁶ value
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <list> <fct> <dbl>
#> 1 0 1.14 0 -60 0 -60 0 <dbl> C 1
#> 2 1.14 0.255 1 -60 0.00844 -35.5 0 <dbl> C 1
#> 3 1.40 0.337 1 -54.3 0.0432 -34.9 0 <dbl> C 1
#> 4 1.74 0.255 1 -53.7 0.00787 -33.9 0 <dbl> C 1
#> 5 1.99 0.291 1 -53.1 0.0436 -33.5 0 <dbl> C 1
#> 6 2.28 0.296 1 -54.0 0.0491 -34.1 0 <dbl> C 1
#> 7 2.58 0.296 1 -53.3 0.0493 -33.6 0 <dbl> C 1
#> 8 2.87 0.296 1 -53.5 0.0501 -34.3 0 <dbl> C 1
#> 9 3.17 0.296 1 -53.8 0.0471 -34.6 0 <dbl> C 1
#> 10 3.47 0.291 1 -54.0 0.0433 -34.2 0 <dbl> C 1
#> # … with 52,646 more rows, and abbreviated variable names ¹confidence,
#> # ²loudness_start, ³loudness_max_time, ⁴loudness_max, ⁵loudness_end,
#> # ⁶pitch_class
get_tidy_audio_analysis("5ZLkc5RY1NM4FtGWEd6HOE") %>%
select(segments) %>%
unnest(segments) %>%
compmus_gather_timbre()
#> # A tibble: 9,324 × 10
#> start duration confidence loudn…¹ loudn…² loudn…³ loudn…⁴ pitches basis value
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <list> <chr> <dbl>
#> 1 0 0.407 0 -60 0 -60 0 <dbl> c01 0
#> 2 0.407 0.0633 1 -60 0.0308 -11.6 0 <dbl> c01 46.9
#> 3 0.470 0.639 0.706 -12.1 0.211 -2.19 0 <dbl> c01 52.3
#> 4 1.11 0.236 0.166 -11.4 0.0455 -8.42 0 <dbl> c01 50.0
#> 5 1.34 0.340 0.872 -11.6 0.0799 -1.03 0 <dbl> c01 51.4
#> 6 1.68 0.423 0.672 -9.78 0.0878 -2 0 <dbl> c01 54.9
#> 7 2.11 0.402 0.548 -9.52 0.132 -1.09 0 <dbl> c01 53.8
#> 8 2.51 0.347 0.091 -11.7 0.0307 -9.06 0 <dbl> c01 48.5
#> 9 2.86 0.186 0.724 -14.6 0.0524 -6.90 0 <dbl> c01 51.8
#> 10 3.04 0.0924 0.134 -9.00 0.0584 -6.12 0 <dbl> c01 52.3
#> # … with 9,314 more rows, and abbreviated variable names ¹loudness_start,
#> # ²loudness_max_time, ³loudness_max, ⁴loudness_end