Sha256: 8639eda568ccbe7acadb0a730159326b8cd7dc7dda7304d34a6e061fed365feb

Contents?: true

Size: 686 Bytes

Versions: 6

Compression:

Stored size: 686 Bytes

Contents

# slide the playback rate up and down
require 'rubygems'
require 'osc-ruby'

c = OSC::Client.new 'localhost', 53000

# first cue
cue_number = 1

# pause between OSC messages. if this is much below 0.05 it'll just get weird
sleep_time = 0.05

# more steps means a longer slide
steps = 100

# how high should rate peak
max_rate = 2.0

10.times do
  # start at 1 to avoid sending 0.0 to rate
  (1..steps).each do |n|
    c.send(OSC::Message.new("/cue/#{ cue_number }/rate", n / (steps / max_rate)))
    sleep(sleep_time)
  end

  (1..steps).each do |n|
    c.send(OSC::Message.new("/cue/#{ cue_number }/rate", (max_rate + 0.01) - (n / (steps / max_rate))))
    sleep(sleep_time)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
qcmd-0.2.0 sample/fast-rate-change.rb
qcmd-0.1.16 sample/fast-rate-change.rb
qcmd-0.1.16.pre2 sample/fast-rate-change.rb
qcmd-0.1.16.pre sample/fast-rate-change.rb
qcmd-0.1.15 sample/fast-rate-change.rb
qcmd-0.1.14 sample/fast-rate-change.rb