Module: RuckTime

Included in:
Fixnum, Float
Defined in:
lib/ruck/ugen/time_helpers.rb

Overview

time helpers so you can write 4.seconds, 1.sample, etc

Instance Method Summary collapse

Instance Method Details

#minuteObject 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

#msObject



10
11
12
# File 'lib/ruck/ugen/time_helpers.rb', line 10

def ms
  self.to_f * SAMPLE_RATE / 1000.0
end

#sampleObject Also known as: samples



5
6
7
# File 'lib/ruck/ugen/time_helpers.rb', line 5

def sample
  self
end

#secondObject Also known as: seconds



14
15
16
# File 'lib/ruck/ugen/time_helpers.rb', line 14

def second
  self.to_f * SAMPLE_RATE
end