bpm-finder-app 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +51 -0
- data/lib/bpm_finder_app.rb +34 -0
- metadata +47 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4a60a37f816b194c8a602f925e2e39e0e1fc41a04b16f692b5f3fbcb8ba6bd94
|
|
4
|
+
data.tar.gz: bb8c027bea1d364f6db09b022f832f754b920d27443d478309bcd3202324486f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: cee6004439d15eb8378467dcb93dbd37554cdf8339aa6b17b6c1b00477e876672eb74f571972e1045fd1a3f1d38d664aba5f8ce112e18117221b679f0c291803
|
|
7
|
+
data.tar.gz: 7d749f6cc9f1eecb87061f9e7e967a47b27244a12f554d8280cd288fdcb45f036a0c1e8209890ca259ffabdeda7bbc219b06509bc9272e1245e386fd88e9703b
|
data/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# BPM Finder - Official Ruby Gem
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/bpm-finder-app)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Ruby gem for audio tempo calculation, Tap BPM interval analysis, delay note divisions, and reverb pre-delay formulas.
|
|
7
|
+
|
|
8
|
+
Powered by the [BPM Finder App](https://bpmfinderapp.com).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Add to your `Gemfile`:
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
gem 'bpm-finder-app'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Or install directly:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gem install bpm-finder-app
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Usage Example
|
|
29
|
+
|
|
30
|
+
```ruby
|
|
31
|
+
require 'bpm_finder_app'
|
|
32
|
+
|
|
33
|
+
# 1. Tap BPM Calculation
|
|
34
|
+
timestamps = [1000, 1500, 2000, 2500]
|
|
35
|
+
bpm = BpmFinderApp.calculate_bpm_from_intervals(timestamps)
|
|
36
|
+
puts "Detected BPM: #{bpm}" # 120
|
|
37
|
+
|
|
38
|
+
# 2. Delay Note Divisions
|
|
39
|
+
delay_times = BpmFinderApp.calculate_delay_times(120)
|
|
40
|
+
puts delay_times
|
|
41
|
+
|
|
42
|
+
# 3. Reverb Pre-Delay Recommendations
|
|
43
|
+
predelay = BpmFinderApp.calculate_reverb_predelay(120)
|
|
44
|
+
puts predelay
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Official Web Application
|
|
50
|
+
|
|
51
|
+
Access online audio file tempo detection at the [BPM Finder App](https://bpmfinderapp.com).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module BpmFinderApp
|
|
2
|
+
def self.calculate_bpm_from_intervals(timestamps)
|
|
3
|
+
return nil if timestamps.nil? || timestamps.length < 2
|
|
4
|
+
intervals = []
|
|
5
|
+
(1...timestamps.length).each do |i|
|
|
6
|
+
intervals << (timestamps[i] - timestamps[i - 1]).abs
|
|
7
|
+
end
|
|
8
|
+
avg_interval = intervals.sum / intervals.length.to_f
|
|
9
|
+
return nil if avg_interval <= 0
|
|
10
|
+
(60000.0 / avg_interval).round
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.calculate_delay_times(bpm)
|
|
14
|
+
quarter = 60000.0 / bpm
|
|
15
|
+
{
|
|
16
|
+
quarter_note_ms: quarter.round(2),
|
|
17
|
+
eighth_note_ms: (quarter / 2.0).round(2),
|
|
18
|
+
sixteenth_note_ms: (quarter / 4.0).round(2),
|
|
19
|
+
dotted_eighth_ms: (quarter * 0.75).round(2),
|
|
20
|
+
triplet_eighth_ms: ((quarter * 2.0) / 3.0).round(2)
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.calculate_reverb_predelay(bpm)
|
|
25
|
+
quarter = 60000.0 / bpm
|
|
26
|
+
sixteenth = quarter / 4.0
|
|
27
|
+
eighth = quarter / 2.0
|
|
28
|
+
{
|
|
29
|
+
tight_predelay_ms: (sixteenth / 2.0).round(2),
|
|
30
|
+
natural_predelay_ms: sixteenth.round(2),
|
|
31
|
+
spacious_predelay_ms: eighth.round(2)
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: bpm-finder-app
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- John Goldberg
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-08-03 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: High-precision Ruby library for audio tempo detection, Tap BPM tap counting,
|
|
14
|
+
delay note divisions, and reverb pre-delay formulas. Powered by the BPM Finder App.
|
|
15
|
+
email:
|
|
16
|
+
- support@bpmfinderapp.com
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- README.md
|
|
22
|
+
- lib/bpm_finder_app.rb
|
|
23
|
+
homepage: https://bpmfinderapp.com
|
|
24
|
+
licenses:
|
|
25
|
+
- MIT
|
|
26
|
+
metadata: {}
|
|
27
|
+
post_install_message:
|
|
28
|
+
rdoc_options: []
|
|
29
|
+
require_paths:
|
|
30
|
+
- lib
|
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
|
+
requirements:
|
|
33
|
+
- - ">="
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: '0'
|
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
requirements: []
|
|
42
|
+
rubygems_version: 3.4.19
|
|
43
|
+
signing_key:
|
|
44
|
+
specification_version: 4
|
|
45
|
+
summary: Ruby gem for audio tempo calculation, Tap BPM analysis, and delay/reverb
|
|
46
|
+
formulas.
|
|
47
|
+
test_files: []
|