musa-dsl 0.23.9 → 0.23.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-every.rb +2 -2
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-move.rb +2 -2
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb +39 -34
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-play.rb +2 -2
- data/lib/musa-dsl/sequencer/base-sequencer-implementation.rb +2 -2
- data/musa-dsl.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03b06753c72ecbea6d6b7b056996afa6defaa57e74edd389272728822c537e52
|
4
|
+
data.tar.gz: 6580590252818be5df7a5f42094a026897852e874ece2ce77e657a499255b2d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a8bb01f12163cac1598946db6a60b10cb460894eac06952c82fb7b9eb32a76c6c05d1ff6b1c2133cd024253f3be5e100eec06c67afc6e0314d3bbbf2332bc2
|
7
|
+
data.tar.gz: a7eb355bb4d9e13523f4769d4f204f150d0eb59fb2adaf0ddc989750b42e3958f1422074d11d798df99d560990a5e005d748ad06d99205273af0bdf3cf12e5e2
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module Musa
|
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
|
87
|
+
end
|
@@ -3,7 +3,7 @@ using Musa::Extension::Arrayfy
|
|
3
3
|
|
4
4
|
using Musa::Extension::InspectNice
|
5
5
|
|
6
|
-
module Musa
|
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
|
439
|
+
end
|
@@ -3,11 +3,9 @@ using Musa::Extension::Arrayfy
|
|
3
3
|
|
4
4
|
using Musa::Extension::InspectNice
|
5
5
|
|
6
|
-
module Musa
|
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
|
-
|
41
|
+
if source_next_value
|
42
|
+
affected_components = component_ids.select { |_| !source_next_value[:value][_].nil? }
|
44
43
|
|
45
|
-
|
46
|
-
|
44
|
+
if affected_components&.any?
|
45
|
+
time = source_next_value[:time]
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
values = hash_mode ? {} : []
|
48
|
+
extra_attributes = extra_attribute_names.collect { |_| [_, hash_mode ? {} : []] }.to_h
|
49
|
+
started_ago = hash_mode ? {} : []
|
51
50
|
|
52
|
-
|
53
|
-
|
51
|
+
affected_components.each do |component|
|
52
|
+
values[component] = source_next_value[:value][component]
|
54
53
|
|
55
|
-
|
56
|
-
|
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
|
-
|
60
|
-
|
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
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
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
|
-
|
70
|
-
|
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
|
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
|
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
|
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
|
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
|
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.
|
4
|
-
s.date = '2021-08-
|
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.
|
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-
|
11
|
+
date: 2021-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: citrus
|