basic-sequencer 0.0.8 → 0.0.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec513a538fe69308f4a18864954f08178c2fedea
4
- data.tar.gz: 890417b4e1be3d6fe5b491c72881c598de5465d7
3
+ metadata.gz: 1fee1fb5787628ee5fd6fe422239e040e37d7309
4
+ data.tar.gz: 24ca6dca2aad4d6dad6cb9221f2d0b61f7870adb
5
5
  SHA512:
6
- metadata.gz: a766fe59fd8abaa49b9e86aea9c9d0f2156946c24e963938bcaf5d0cb7e42598c2a5796e7b0f43a8ead9fe2b5e2579b1656ce0600dd0ab3d2f95d5454c44612e
7
- data.tar.gz: 1ec5a6a9d6aa85f3ddb94770a4b365f1eafee1095eeae9efb724efd58dc1e4d020e5fbbbbeb9007b3be45f5d352a1c6685ae7ec750d943f88a63a35231dec6d4
6
+ metadata.gz: cb36e4d709eb8b179f84a91c132c85cc0efa6c2c94449ab90387ec05c7807dd273278afd1404944b878d8fb6e76c7444c97c44edfdf60cb42de241404c5dddfe
7
+ data.tar.gz: ad16382fa3c2a3922277e964ef849b304dedc92910e38a1856f063378cd8f660be720734dd3b2ab516c3589e2e4ddd6835467a964d29b29ba3ff6ead9962f2af
@@ -19,6 +19,6 @@ require "sequencer/loop"
19
19
 
20
20
  module Sequencer
21
21
 
22
- VERSION = "0.0.8"
22
+ VERSION = "0.0.9"
23
23
 
24
24
  end
@@ -32,6 +32,30 @@ module Sequencer
32
32
  Thread.abort_on_exception = true
33
33
  end
34
34
 
35
+ # Add a MIDI clock output
36
+ # @param [Array<UniMIDI::Output>, UniMIDI::Output] output
37
+ # @return [Array<UniMIDI::Output>]
38
+ def add_midi_output(output)
39
+ outputs = [output].flatten
40
+ @clock.add_destination(outputs)
41
+ midi_outputs
42
+ end
43
+
44
+ # Remove a MIDI clock output
45
+ # @param [Array<UniMIDI::Output>, UniMIDI::Output] output
46
+ # @return [Array<UniMIDI::Output>]
47
+ def remove_midi_output(output)
48
+ outputs = [output].flatten
49
+ @clock.remove_destination(outputs)
50
+ midi_outputs
51
+ end
52
+
53
+ # The MIDI outputs
54
+ # @return [Array<UniMIDI::Output>]
55
+ def midi_outputs
56
+ @clock.destinations.map(&:output)
57
+ end
58
+
35
59
  private
36
60
 
37
61
  # Action taken by the clock on a tick. Fires the tick event
@@ -8,6 +8,46 @@ class Sequencer::ClockTest < Test::Unit::TestCase
8
8
  @clock = Sequencer::Clock.new(120)
9
9
  end
10
10
 
11
+ context "Clock#initialize" do
12
+
13
+ should "get MIDI output" do
14
+ output = Object.new
15
+ @clock = Sequencer::Clock.new(120, :output => output)
16
+ assert_not_nil @clock.midi_outputs
17
+ assert_not_empty @clock.midi_outputs
18
+ assert @clock.midi_outputs.include?(output)
19
+ end
20
+
21
+ end
22
+
23
+ context "Clock#add_midi_output" do
24
+
25
+ should "add MIDI output" do
26
+ output = Object.new
27
+ refute @clock.midi_outputs.include?(output)
28
+ @clock.add_midi_output(output)
29
+ assert_not_nil @clock.midi_outputs
30
+ assert_not_empty @clock.midi_outputs
31
+ assert @clock.midi_outputs.include?(output)
32
+ end
33
+
34
+ end
35
+
36
+ context "Clock#remove_midi_output" do
37
+
38
+ should "remove MIDI output" do
39
+ output = Object.new
40
+ refute @clock.midi_outputs.include?(output)
41
+ @clock.add_midi_output(output)
42
+ assert_not_nil @clock.midi_outputs
43
+ assert_not_empty @clock.midi_outputs
44
+ assert @clock.midi_outputs.include?(output)
45
+ @clock.remove_midi_output(output)
46
+ refute @clock.midi_outputs.include?(output)
47
+ end
48
+
49
+ end
50
+
11
51
  context "Clock#tempo" do
12
52
 
13
53
  should "get tempo" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basic-sequencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Russo