{"id":21570395,"url":"https://github.com/arirusso/pulse-analysis","last_synced_at":"2025-04-10T14:12:44.895Z","repository":{"id":56889571,"uuid":"80181162","full_name":"arirusso/pulse-analysis","owner":"arirusso","description":"Measure pulse timing accuracy in an audio file","archived":false,"fork":false,"pushed_at":"2017-06-08T20:22:21.000Z","size":20499,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T12:56:20.587Z","etag":null,"topics":["audio","cli-app","clock","command-line-app","drum-machine","music","pulse","rhythm","ruby","sync","synthesizers","timing"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arirusso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-27T04:32:26.000Z","updated_at":"2018-03-13T22:16:55.000Z","dependencies_parsed_at":"2022-08-20T16:00:50.212Z","dependency_job_id":null,"html_url":"https://github.com/arirusso/pulse-analysis","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fpulse-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fpulse-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fpulse-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fpulse-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arirusso","download_url":"https://codeload.github.com/arirusso/pulse-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248232688,"owners_count":21069489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","cli-app","clock","command-line-app","drum-machine","music","pulse","rhythm","ruby","sync","synthesizers","timing"],"created_at":"2024-11-24T11:12:31.581Z","updated_at":"2025-04-10T14:12:44.870Z","avatar_url":"https://github.com/arirusso.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pulse Analysis\n\nUsing an audio file, measure pulses for timing deviation\n\nThis would generally be used to measure the timing accuracy of drum machines, sequencers and other music electronics.  Inspired by the [Inner Clock Systems Litmus Test](http://innerclocksystems.com/New%20ICS%20Litmus.html)\n\n## Installation\n\nThe package [libsndfile](https://github.com/erikd/libsndfile) must be installed first.  It's available in *Homebrew*, *APT*, *Yum* as well as many other package managers. For those who wish to compile themselves or need more information, follow the link above for more information\n\nInstall the gem itself using\n\n```sh\ngem install pulse-analysis\n```\n\nOr if you're using Bundler, add this to your Gemfile\n\n```ruby\ngem \"pulse-analysis\"\n```\n\n## Usage\n\n### Input file\n\nPulse-Analysis operates on a single input audio file at a time.  This file must be in an uncompressed format such as *WAV* or *AIFF*.\n\nIn keeping with conventions established by the Litmus Test, audio input files must be at least *48k* sample rate.  \n\nMono audio files are recommended.  If a stereo file is used, only the left channel will be analyzed.\n\nIt's recommended that the audio file have a pulse rate of *16th notes* at *120 BPM* and be around *10 minutes long*. In other words, to produce the best results, use only a single repetitive pulse-like sound (eg snare drum) striking 16th notes.\n\nExample audio files are included in the repository and can be found [here](https://github.com/arirusso/pulse-analysis/tree/master/spec/media)\n\n### Command Line\n\n```sh\npulse-analysis /path/to/a/sound/file.wav\n```\n\nThis will run the program and output something like\n\n```sh\n[/] Reading file /path/to/a/sound/file.wav Done!\n[/] Running analysis Done!\n[\\] Generating Report Done!\n\n+------------------------+-------------------------+-------------+\n|                         Pulse Analysis                         |\n+------------------------+-------------------------+-------------+\n| Item                   | Value                                 |\n+------------------------+-------------------------+-------------+\n| Sample rate            | 88200 (Hertz)                         |\n| Length                 | 4310 (Number of pulses) | 9m0s (Time) |\n| Tempo                  | 119.7546 (BPM)                        |\n| Longest period length  | 11326 (Samples)         | 128.41 (ms) |\n| Shortest period length | 10747 (Samples)         | 121.85 (ms) |\n| Average period length  | 11047.5949 (Samples)    | 125.26 (ms) |\n| Largest abberation     | 544 (Samples)           | 6.17 (ms)   |\n| Average abberation     | 160.2981 (Samples)      | 1.82 (ms)   |\n+------------------------+-------------------------+-------------+\n```\n\n### In Ruby\n\n```ruby\n2.4.0 :002 \u003e require \"pulse-analysis\"\n =\u003e true\n\n2.4.0 :003 \u003e PulseAnalysis.report(\"/path/to/a/sound/file.wav\")\n =\u003e {\n   :file=\u003e{\n     :path=\u003e\"/path/to/a/sound/file.wav\"},\n     :analysis=\u003e[\n       {\n         :key=\u003e:sample_rate,\n         :description=\u003e\"Sample rate\",\n         :value=\u003e{\n           :unit=\u003e\"Hertz\",\n           :value=\u003e88200\n         }\n       },\n       {\n         :key=\u003e:tempo,\n         :description=\u003e\"Tempo\",\n         :value=\u003e{\n           :unit=\u003e\"BPM\",\n           :value=\u003e119.9371\n         }\n       },\n       ...\n```\n\n## Disclaimer\n\nWith the subjective nature of the data at hand, this program is not meant to reflect poorly on any musicians, companies, hobbyists or anyone whose product has measurable timing.  After all, variation in timing may be desirable in musical context.\n\nAdditionally, it's recommended that results be independently verified.  The configuration of a particular device or recording environment can cause variation in timing accuracy.\n\n## License\n\nLicensed under Apache 2.0, See the file LICENSE\n\nCopyright (c) 2017 [Ari Russo](http://arirusso.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farirusso%2Fpulse-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farirusso%2Fpulse-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farirusso%2Fpulse-analysis/lists"}