musa-dsl 0.22.3 → 0.22.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 193117ba393c58eaf2387d7b0a5ba54bc7fbad0c6ac2e5a7171997b1629d5f69
4
- data.tar.gz: 5ac3515f62f3c5d8ea34cd91552fb6d0f8d53e40f60d1383fa34a28c0b11289d
3
+ metadata.gz: fe8d0a64e4ba5518c7ed0fe4b75fffbf059217ef65e83025889a21d1c830a6e7
4
+ data.tar.gz: a78c43004243d81a9411c42e34338ecfe4ca7ef17322417dc2e8eb9a953b9abd
5
5
  SHA512:
6
- metadata.gz: 13ec912683ee5e0f0f0865ff9197e641671c430ed5a59d438b15acb5423f6d18f3f57624d5dd4c348daa69c93ac1d47428809cea84953893a4cb7f9b224613f9
7
- data.tar.gz: b64ee9f844989e4db527787f763089c6bcd5aa050254da270c2c5c3461145aefef9b701da6944cda20b53286bfee2e42650c2a21de864ee8ea53f5d48aff0791
6
+ metadata.gz: 6bf51f55471c9a753ec648cb1c223ef0564307d2807ec0c569a144856ef330ca7567e8ed4f8f0f651e1808ea42712c02c686ac123424d0feaa90955e2f6d77fe
7
+ data.tar.gz: 2bd503000a0d7cd2bd0e74f9790cbf5533335bc7d74cc6846cb60ea3bad4f1fd3fb24e74ed0bd1c6955b476d45274f51047202c89e12582e5fd642753d34144e
@@ -1,5 +1,5 @@
1
1
  module Musa
2
- VERSION = '0.22.3'
2
+ VERSION = '0.22.4'
3
3
  end
4
4
 
5
5
  require_relative 'musa-dsl/core-ext'
@@ -22,8 +22,10 @@ module Musa::Datasets
22
22
  end
23
23
  end
24
24
 
25
- def to_timed_serie(time_start = nil, base_duration: nil)
25
+ def to_timed_serie(time_start: nil, time_start_component: nil, base_duration: nil)
26
26
  time_start ||= 0r
27
+ time_start += self.first[time_start_component] if time_start_component
28
+
27
29
  base_duration ||= 1/4r # TODO review incoherence between neumalang 1/4r base duration for quarter notes and general 1r size of bar
28
30
 
29
31
  # TODO if instead of using clone (needed because of p.shift) we use index counter the P elements would be evaluated on the last moment
@@ -22,8 +22,8 @@ module Musa
22
22
  indexes
23
23
  end
24
24
 
25
- def to_p(time_dimension, keep_time: nil)
26
- condensed_matrices.collect { |m| m.to_p(time_dimension, keep_time: keep_time) }
25
+ def to_p(time_dimension:, keep_time: nil)
26
+ condensed_matrices.collect { |m| m.to_p(time_dimension: time_dimension, keep_time: keep_time) }
27
27
  end
28
28
 
29
29
  def condensed_matrices
@@ -69,14 +69,14 @@ module Musa
69
69
  refine ::Matrix do
70
70
  include Musa::Datasets
71
71
 
72
- def to_p(time_dimension, keep_time: nil)
72
+ def to_p(time_dimension:, keep_time: nil)
73
73
  decompose(self.to_a, time_dimension).collect do |points|
74
74
  line = []
75
75
 
76
76
  start_point = points[0]
77
77
  start_time = start_point[time_dimension]
78
78
 
79
- line << start_point.tap { |_| _.delete_at(time_dimension) unless keep_time; _ }.extend(Datasets::V)
79
+ line << start_point.clone.tap { |_| _.delete_at(time_dimension) unless keep_time; _ }.extend(Datasets::V)
80
80
 
81
81
  (1..points.size-1).each do |i|
82
82
  end_point = points[i]
@@ -84,7 +84,7 @@ module Musa
84
84
  end_time = end_point[time_dimension]
85
85
 
86
86
  line << end_time - start_time
87
- line << end_point.tap { |_| _.delete_at(time_dimension) unless keep_time; _ }.extend(Datasets::V)
87
+ line << end_point.clone.tap { |_| _.delete_at(time_dimension) unless keep_time; _ }.extend(Datasets::V)
88
88
 
89
89
  start_time = end_time
90
90
  end
@@ -107,8 +107,9 @@ module Musa
107
107
 
108
108
  x_dim_values_indexes.keys.sort.each do |value|
109
109
  x_dim_values_indexes[value].each do |index|
110
+ #
110
111
  # hacia un lado
111
-
112
+ #
112
113
  unless used_indexes.include?(index)
113
114
  i = index
114
115
  xx = array[i][time_dimension]
@@ -125,8 +126,9 @@ module Musa
125
126
 
126
127
  directional_segments << a if a.size > 1
127
128
 
129
+ #
128
130
  # y hacia el otro
129
-
131
+ #
130
132
  i = index
131
133
  xx = array[i][time_dimension]
132
134
 
@@ -9,11 +9,15 @@ module Musa; module Sequencer
9
9
  control,
10
10
  reference: nil,
11
11
  step: nil,
12
+ predictive: nil,
12
13
  right_open: nil,
14
+ stops: nil,
13
15
  &block)
14
16
 
15
17
  reference ||= 0r
16
18
  step ||= 1r
19
+ predictive ||= predictive
20
+ stops = stops.nil? ? true : stops
17
21
 
18
22
  if first_value_sample = timed_serie.peek_next_value
19
23
 
@@ -26,6 +30,8 @@ module Musa; module Sequencer
26
30
 
27
31
  reference = reference.hashify(keys: components)
28
32
  step = step.hashify(keys: components)
33
+ predictive = predictive.hashify(keys:components)
34
+ stops = stops.hashify(keys:components)
29
35
  right_open = right_open.hashify(keys:components)
30
36
  else
31
37
  size = first_value_sample[:value].size
@@ -33,6 +39,8 @@ module Musa; module Sequencer
33
39
 
34
40
  reference = reference.arrayfy(size: size)
35
41
  step = step.arrayfy(size: size)
42
+ predictive = predictive.arrayfy(size: size)
43
+ stops = stops.arrayfy(size: size)
36
44
  right_open = right_open.arrayfy(size: size)
37
45
  end
38
46
 
@@ -44,8 +52,9 @@ module Musa; module Sequencer
44
52
  QUANTIZE(split[component],
45
53
  reference: reference[component],
46
54
  step: step[component],
55
+ predictive: predictive[component],
47
56
  right_open: right_open[component],
48
- stops: true).instance
57
+ stops: stops[component]).instance
49
58
  end
50
59
 
51
60
  last_positions = hash_mode ? {} : []
@@ -218,6 +218,8 @@ module Musa
218
218
  def play_timed(timed_serie,
219
219
  reference: nil,
220
220
  step: nil,
221
+ predictive: nil,
222
+ stops: nil,
221
223
  right_open: nil,
222
224
  on_stop: nil,
223
225
  after_bars: nil, after: nil,
@@ -238,6 +240,8 @@ module Musa
238
240
  control,
239
241
  reference: reference,
240
242
  step: step,
243
+ predictive: predictive,
244
+ stops: stops,
241
245
  right_open: right_open,
242
246
  &block)
243
247
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'musa-dsl'
3
- s.version = '0.22.3'
4
- s.date = '2020-11-12'
3
+ s.version = '0.22.4'
4
+ s.date = '2020-11-14'
5
5
  s.summary = 'A simple Ruby DSL for making complex music'
6
6
  s.description = 'Musa-DSL: A Ruby DSL for algorithmic music composition, device language neutral (MIDI, OSC, etc)'
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.22.3
4
+ version: 0.22.4
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: 2020-11-12 00:00:00.000000000 Z
11
+ date: 2020-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citrus