musa-dsl 0.23.9 → 0.23.10

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
  SHA256:
3
- metadata.gz: 79f0b29dc4afd60274d8c1e5727ae70d3233b91a004a0173b57e398f152dcf56
4
- data.tar.gz: 7538b77296f7185211e56b344bd3d332afb6de8b2cfa95b166737830a524c68b
3
+ metadata.gz: 03b06753c72ecbea6d6b7b056996afa6defaa57e74edd389272728822c537e52
4
+ data.tar.gz: 6580590252818be5df7a5f42094a026897852e874ece2ce77e657a499255b2d1
5
5
  SHA512:
6
- metadata.gz: 91d9441bc8fb61321764876d90c7ac8079a475e4dd9ce4c12184e3262a7682bdce2cd5d66e272daa2e1e1233734d46bb9bda6232522781ab40e07f27ae5a51e7
7
- data.tar.gz: c20a18071678dd0c68567de8a2f1b1b8b1a2fe1cf5d541b99bef712bce79385172e2102219d484acb5e131b25e52a94081e866c56b28736da244a48ead7d78b0
6
+ metadata.gz: 52a8bb01f12163cac1598946db6a60b10cb460894eac06952c82fb7b9eb32a76c6c05d1ff6b1c2133cd024253f3be5e100eec06c67afc6e0314d3bbbf2332bc2
7
+ data.tar.gz: a7eb355bb4d9e13523f4769d4f204f150d0eb59fb2adaf0ddc989750b42e3958f1422074d11d798df99d560990a5e005d748ad06d99205273af0bdf3cf12e5e2
@@ -1,4 +1,4 @@
1
- module Musa; module Sequencer
1
+ module Musa::Sequencer
2
2
  class BaseSequencer
3
3
  private def _every(interval, control, block_procedure_binder: nil, &block)
4
4
  block ||= proc {}
@@ -84,4 +84,4 @@ module Musa; module Sequencer
84
84
 
85
85
  private_constant :EveryControl
86
86
  end
87
- end; end
87
+ end
@@ -3,7 +3,7 @@ using Musa::Extension::Arrayfy
3
3
 
4
4
  using Musa::Extension::InspectNice
5
5
 
6
- module Musa; module Sequencer
6
+ module Musa::Sequencer
7
7
  class BaseSequencer
8
8
  private def _move(every: nil,
9
9
  from:, to: nil,
@@ -436,4 +436,4 @@ module Musa; module Sequencer
436
436
 
437
437
  private_constant :MoveControl
438
438
  end
439
- end; end
439
+ end
@@ -3,11 +3,9 @@ using Musa::Extension::Arrayfy
3
3
 
4
4
  using Musa::Extension::InspectNice
5
5
 
6
- module Musa; module Sequencer
6
+ module Musa::Sequencer
7
7
  class BaseSequencer
8
- private def _play_timed(timed_serie,
9
- control,
10
- &block)
8
+ private def _play_timed(timed_serie, control, &block)
11
9
 
12
10
  if first_value_sample = timed_serie.peek_next_value
13
11
  debug "_play_timed: first_value_sample #{first_value_sample}"
@@ -40,45 +38,52 @@ module Musa; module Sequencer
40
38
 
41
39
  source_next_value = timed_serie.next_value
42
40
 
43
- affected_components = component_ids.select { |_| !source_next_value[:value][_].nil? } if source_next_value
41
+ if source_next_value
42
+ affected_components = component_ids.select { |_| !source_next_value[:value][_].nil? }
44
43
 
45
- if affected_components && affected_components.any?
46
- time = source_next_value[:time]
44
+ if affected_components&.any?
45
+ time = source_next_value[:time]
47
46
 
48
- values = hash_mode ? {} : []
49
- extra_attributes = extra_attribute_names.collect { |_| [_, hash_mode ? {} : []] }.to_h
50
- started_ago = hash_mode ? {} : []
47
+ values = hash_mode ? {} : []
48
+ extra_attributes = extra_attribute_names.collect { |_| [_, hash_mode ? {} : []] }.to_h
49
+ started_ago = hash_mode ? {} : []
51
50
 
52
- affected_components.each do |component|
53
- values[component] = source_next_value[:value][component]
51
+ affected_components.each do |component|
52
+ values[component] = source_next_value[:value][component]
54
53
 
55
- extra_attribute_names.each do |attribute_name|
56
- extra_attributes[attribute_name][component] = source_next_value[attribute_name][component]
54
+ extra_attribute_names.each do |attribute_name|
55
+ extra_attributes[attribute_name][component] = source_next_value[attribute_name][component]
56
+ end
57
+
58
+ last_positions[component] = _quantize_position(time, warn: false)
57
59
  end
58
60
 
59
- last_positions[component] = _quantize_position(time, warn: false)
60
- end
61
+ component_ids.each do |component|
62
+ if last_positions[component] && last_positions[component] != time
63
+ sa = _quantize_position(time, warn: false) - last_positions[component]
64
+ started_ago[component] = (sa == 0) ? nil : sa
65
+ end
66
+ end
61
67
 
62
- component_ids.each do |component|
63
- if last_positions[component] && last_positions[component] != time
64
- sa = _quantize_position(time, warn: false) - last_positions[component]
65
- started_ago[component] = (sa == 0) ? nil : sa
68
+ _numeric_at _quantize_position(start_position + time, warn: true), control do
69
+ binder.call(values,
70
+ **extra_attributes,
71
+ time: start_position + time,
72
+ started_ago: started_ago,
73
+ control: control)
74
+
75
+ _play_timed_step(hash_mode,
76
+ component_ids, extra_attribute_names,
77
+ timed_serie,
78
+ start_position,
79
+ last_positions,
80
+ binder, control)
66
81
  end
67
82
  end
83
+ else
68
84
 
69
- _numeric_at _quantize_position(start_position + time, warn: true), control do
70
- binder.call(values,
71
- **extra_attributes,
72
- time: start_position + time,
73
- started_ago: started_ago,
74
- control: control)
75
-
76
- _play_timed_step(hash_mode,
77
- component_ids, extra_attribute_names,
78
- timed_serie,
79
- start_position,
80
- last_positions,
81
- binder, control)
85
+ control.do_after.each do |do_after|
86
+ _numeric_at position + do_after[:bars], control, &do_after[:block]
82
87
  end
83
88
  end
84
89
  end
@@ -107,5 +112,5 @@ module Musa; module Sequencer
107
112
 
108
113
  private_constant :PlayTimedControl
109
114
  end
110
- end; end
115
+ end
111
116
 
@@ -5,7 +5,7 @@ using Musa::Extension::Arrayfy
5
5
 
6
6
  using Musa::Extension::InspectNice
7
7
 
8
- module Musa; module Sequencer
8
+ module Musa::Sequencer
9
9
  class BaseSequencer
10
10
  private def _play(serie,
11
11
  control,
@@ -175,4 +175,4 @@ module Musa; module Sequencer
175
175
 
176
176
  private_constant :PlayControl
177
177
  end
178
- end; end
178
+ end
@@ -4,7 +4,7 @@ require_relative '../core-ext/smart-proc-binder'
4
4
  using Musa::Extension::Arrayfy
5
5
  using Musa::Extension::DeepCopy
6
6
 
7
- module Musa; module Sequencer
7
+ module Musa::Sequencer
8
8
  class BaseSequencer
9
9
  include Musa::Extension::SmartProcBinder
10
10
  include Musa::Extension::DeepCopy
@@ -214,4 +214,4 @@ module Musa; module Sequencer
214
214
 
215
215
  private_constant :EventHandler
216
216
  end
217
- end; end
217
+ end
data/musa-dsl.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'musa-dsl'
3
- s.version = '0.23.9'
4
- s.date = '2021-08-03'
3
+ s.version = '0.23.10'
4
+ s.date = '2021-08-05'
5
5
  s.summary = 'A simple Ruby DSL for making complex music'
6
6
  s.description = 'Musa-DSL: A Ruby framework and DSL for algorithmic sound and musical thinking and composition'
7
7
  s.authors = ['Javier Sánchez Yeste']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musa-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.9
4
+ version: 0.23.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Sánchez Yeste
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-03 00:00:00.000000000 Z
11
+ date: 2021-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citrus