midi-topaz 0.0.6 → 0.0.7

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.
Files changed (3) hide show
  1. data/lib/topaz/tempo.rb +12 -1
  2. data/lib/topaz.rb +1 -1
  3. metadata +1 -1
data/lib/topaz/tempo.rb CHANGED
@@ -30,7 +30,11 @@ module Topaz
30
30
  initialize_midi_io(options)
31
31
  raise "You must specify an internal tempo rate or an external tempo source" if @source.nil?
32
32
 
33
- @source.interval = options[:interval] unless options.nil? || options[:interval].nil?
33
+ unless options.nil?
34
+ @source.interval = options[:interval] unless options[:interval].nil?
35
+ initialize_sync(options[:children], options[:sync_to])
36
+ end
37
+
34
38
  end
35
39
 
36
40
  # this will change the tempo
@@ -115,6 +119,13 @@ module Topaz
115
119
  end
116
120
 
117
121
  private
122
+
123
+ def initialize_sync(children, sync_to)
124
+ children = [children].flatten.compact
125
+ sync_to = [sync_to].flatten.compact
126
+ children.each { |t| add_destination(t) }
127
+ sync_to.each { |t| sync_to(t) }
128
+ end
118
129
 
119
130
  def initialize_midi_io(args)
120
131
  ports = args.kind_of?(Hash) ? args[:midi] : args
data/lib/topaz.rb CHANGED
@@ -18,6 +18,6 @@ require 'topaz/tempo'
18
18
 
19
19
  module Topaz
20
20
 
21
- VERSION = "0.0.6"
21
+ VERSION = "0.0.7"
22
22
 
23
23
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: midi-topaz
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ari Russo