{"id":531,"date":"2012-09-08T21:47:44","date_gmt":"2012-09-08T21:47:44","guid":{"rendered":"http:\/\/garysieling.com\/blog\/?p=531"},"modified":"2012-09-08T21:47:44","modified_gmt":"2012-09-08T21:47:44","slug":"onset-detection-with-r","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/","title":{"rendered":"Finding the beat in R"},"content":{"rendered":"<p>In a previous article, I described a method for <a href=\"http:\/\/garysieling.com\/blog\/detecting-pitches-in-music-with-r\">detecting chords in an audio file<\/a> (<a href=\"http:\/\/garysieling.com\/blog\/how-to-find-pitches-in-music\">also available for Scala<\/a>). Continuing on this theme, the following will find the onset of a drumbeat in a file, <a href=\"http:\/\/garysieling.com\/blog\/book-review-r-cookbook\">using R<\/a>. I&#8217;m using a single drumstick click, which you can <a href=\"http:\/\/www.freesound.org\/people\/TicTacShutUp\/sounds\/432\/\">hear on freesound.org<\/a>.<\/p>\n<p>This method detects sudden volume increases- it is not made to respond to changes in pitch or timbre (i.e. a song that marks the beat by changing pitch or switching instruments, respectively). However, the methods for doing this seem to be based on the method described below. <\/p>\n<p>We&#8217;re looking for the onset of the drumbeat- where the anticipation starts. From reading literature, it appears that this is believed to be what we perceive as the beat in music, rather than, say, the loudest point.<\/p>\n<p>Load the file into memory:<\/p>\n<pre>\nlibrary(sound)\n\nfile<-'432__tictacshutup__prac-perc-4.wav'\nsample<-loadSample(file)\n\nfourbeats<-appendSample(sample, sample, sample, sample)\nsaveSample(fourbeats, \"out\\\\fourbeats.wav\")\n\neightbeats<-appendSample(sample, sample, \n                         sample, sample, \n                         sample, sample,\n                         sample, sample)\nsaveSample(eightbeats, \"out\\\\eightbeats.wav\")\n<\/pre>\n<p>Next, define the first order differential function. (There is a method in R called diff, which is essentially the same)<\/p>\n<pre>\nfirstOrderDiff<-function(x, lag){ x[(1+lag):length(x) - \n                  x[1:(length(x)-lag)]] }\nwav<-sample$sound\nplot(1:length(wav), abs(wav), type=\"l\")<\/pre>\n<p><a href=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph11.png\" alt=\"\" title=\"wav-graph1\" width=\"463\" height=\"368\" class=\"alignnone size-full wp-image-559\" srcset=\"https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph11.png 463w, https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph11-300x238.png 300w\" sizes=\"(max-width: 463px) 100vw, 463px\" \/><\/a><\/p>\n<p>Clearly there is a lot going on- for the sake of example, let's zoom in:<\/p>\n<pre>\nbegin<-abs(wav[1:2000])\nplot(1:length(begin), abs(begin), type=\"l\")\n<\/pre>\n<p>We're really interested in magnitude (loudness) of the sound - it's much easier to work with if you take the absolute value.<\/p>\n<p>Still, there are a lot of peaks and valleys. The first order differential is approximately the derivative, and can be computed over a range (e.g. sample 99 - sample 0, sample 100 - sample 1, etc), but experimentally this seems unstable. Instead, I compute the rolling mean over a small sample, then compute the derivative. This is part of the value in working with only positive numbers, as rolling mean is useless on alternating negative and positive numbers.<\/p>\n<p><a href=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph22.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph22.png\" alt=\"\" title=\"wav-graph2\" width=\"490\" height=\"316\" class=\"alignnone size-full wp-image-556\" srcset=\"https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph22.png 490w, https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph22-300x193.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<pre>\nlibrary(zoo)\nsmoothed<-rollmean(begin, 100)\nplot(abs(smoothed), type=\"l\")\n<\/pre>\n<p><a href=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph31.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph31.png\" alt=\"\" title=\"wav-graph3\" width=\"488\" height=\"343\" class=\"alignnone size-full wp-image-560\" srcset=\"https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph31.png 488w, https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph31-300x211.png 300w\" sizes=\"(max-width: 488px) 100vw, 488px\" \/><\/a><\/p>\n<p>And for the key, find the max value of the derivative to determine where the sound rises fastest:<\/p>\n<pre>\nstart<-which.max(firstOrderDiff(begin, 100))\nabline(v=start)\n<\/pre>\n<p><a href=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph4.png\" alt=\"\" title=\"wav-graph4\" width=\"469\" height=\"324\" class=\"alignnone size-full wp-image-542\" srcset=\"https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph4.png 469w, https:\/\/www.garysieling.com\/blog\/wp-content\/uploads\/2012\/09\/wav-graph4-300x207.png 300w\" sizes=\"(max-width: 469px) 100vw, 469px\" \/><\/a><\/p>\n<p>In the future I will describe how to generalize this for finding each beat, and handling more types of music. <\/p>\n<p>If you're interested in R (the statistical programming language), check out my review of the <a href=\"http:\/\/garysieling.com\/blog\/book-review-r-cookbook\">R Cookbook<\/a>. You may also be interested in <a href=\"http:\/\/www.amazon.com\/gp\/product\/0966017633\/ref=as_li_ss_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0966017633&#038;linkCode=as2&#038;tag=thesecrelifeo-20\">The Scientist & Engineer's Guide to Digital Signal Processing<\/a><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.assoc-amazon.com\/e\/ir?t=thesecrelifeo-20&#038;l=as2&#038;o=1&#038;a=0966017633\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I&#8217;m using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases- &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Finding the beat in R&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[5,6,27],"tags":[178,228,373,402,450,532],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I&#039;m using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Finding the beat in R - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I&#039;m using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2012-09-08T21:47:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2012-09-08T21:47:44+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Finding the beat in R - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I&#039;m using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#blogposting\",\"name\":\"Finding the beat in R - Gary Sieling\",\"headline\":\"Finding the beat in R\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"http:\\\/\\\/172.104.26.128\\\/wp-content\\\/uploads\\\/2012\\\/09\\\/wav-graph11.png\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#articleImage\"},\"datePublished\":\"2012-09-08T21:47:44+00:00\",\"dateModified\":\"2012-09-08T21:47:44+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#webpage\"},\"articleSection\":\"Data Mining, Data Science, Statistics, dsp, fft, music, onset detection, R, statistics\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/#listItem\",\"name\":\"Data Mining\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/#listItem\",\"position\":2,\"name\":\"Data Mining\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#listItem\",\"name\":\"Finding the beat in R\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#listItem\",\"position\":3,\"name\":\"Finding the beat in R\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/#listItem\",\"name\":\"Data Mining\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/\",\"name\":\"Finding the beat in R - Gary Sieling\",\"description\":\"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I'm using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/onset-detection-with-r\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2012-09-08T21:47:44+00:00\",\"dateModified\":\"2012-09-08T21:47:44+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Finding the beat in R - Gary Sieling","description":"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I'm using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-","canonical_url":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#blogposting","name":"Finding the beat in R - Gary Sieling","headline":"Finding the beat in R","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"http:\/\/172.104.26.128\/wp-content\/uploads\/2012\/09\/wav-graph11.png","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#articleImage"},"datePublished":"2012-09-08T21:47:44+00:00","dateModified":"2012-09-08T21:47:44+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#webpage"},"articleSection":"Data Mining, Data Science, Statistics, dsp, fft, music, onset detection, R, statistics"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/#listItem","name":"Data Mining"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/#listItem","position":2,"name":"Data Mining","item":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#listItem","name":"Finding the beat in R"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#listItem","position":3,"name":"Finding the beat in R","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/#listItem","name":"Data Mining"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/","name":"Finding the beat in R - Gary Sieling","description":"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I'm using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2012-09-08T21:47:44+00:00","dateModified":"2012-09-08T21:47:44+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"Finding the beat in R - Gary Sieling","og:description":"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I'm using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-","og:url":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/","article:published_time":"2012-09-08T21:47:44+00:00","article:modified_time":"2012-09-08T21:47:44+00:00","twitter:card":"summary_large_image","twitter:title":"Finding the beat in R - Gary Sieling","twitter:description":"In a previous article, I described a method for detecting chords in an audio file (also available for Scala). Continuing on this theme, the following will find the onset of a drumbeat in a file, using R. I'm using a single drumstick click, which you can hear on freesound.org. This method detects sudden volume increases-"},"aioseo_meta_data":{"post_id":"531","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 16:08:26","updated":"2026-07-06 00:47:32","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/\" title=\"Data Mining\">Data Mining<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tFinding the beat in R\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"Data Mining","link":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/"},{"label":"Finding the beat in R","link":"https:\/\/www.garysieling.com\/blog\/onset-detection-with-r\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/531"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=531"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/531\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}