Module: RuckTime
Overview
time helpers so you can write 4.seconds, 1.sample, etc
Instance Method Summary collapse
- #minute ⇒ Object (also: #minutes)
- #ms ⇒ Object
- #sample ⇒ Object (also: #samples)
- #second ⇒ Object (also: #seconds)
Instance Method Details
#minute ⇒ Object Also known as: minutes
19 20 21 |
# File 'lib/ruck/ugen/time_helpers.rb', line 19 def minute self.to_f * SAMPLE_RATE * 60.0 end |
#ms ⇒ Object
10 11 12 |
# File 'lib/ruck/ugen/time_helpers.rb', line 10 def ms self.to_f * SAMPLE_RATE / 1000.0 end |
#sample ⇒ Object Also known as: samples
5 6 7 |
# File 'lib/ruck/ugen/time_helpers.rb', line 5 def sample self end |
#second ⇒ Object Also known as: seconds
14 15 16 |
# File 'lib/ruck/ugen/time_helpers.rb', line 14 def second self.to_f * SAMPLE_RATE end |