build_audulus_wavetable_node 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/midi_patch.rb +17 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0430540d97d29d13391b6466220caa8beef3952
|
4
|
+
data.tar.gz: d75945b017b74ab830417884512cd3f6e07b8d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a272a9846e85be361a8b2afd8815bac51c4c21e4bdcffc77e4b6a7871b86f610e6f776ce53bd0d8eefc4562b6e4dc583b58a311f8a695569ee28277381ed9200
|
7
|
+
data.tar.gz: 942129e6fbffecee61f4135fbe544f295ab2440b27ea3c4662dc9a04e88796239a6372babc9d5a5e1b7e427fb16db530c6693552391a44752e75422a6c933eb0
|
data/lib/midi_patch.rb
CHANGED
@@ -4,6 +4,8 @@ require_relative 'spline_helper'
|
|
4
4
|
require 'pry'
|
5
5
|
|
6
6
|
module MidiPatch
|
7
|
+
STEPWISE_X_DELTA = 0.0001
|
8
|
+
|
7
9
|
def self.build_patch(path)
|
8
10
|
seq = MIDI::Sequence.new()
|
9
11
|
|
@@ -56,7 +58,8 @@ module MidiPatch
|
|
56
58
|
}
|
57
59
|
|
58
60
|
coordinates = scaled_times.zip(scaled_notes)
|
59
|
-
|
61
|
+
stepwise_coordinates = make_stepwise(coordinates)
|
62
|
+
SplineHelper.build_spline_node_from_coordinates(stepwise_coordinates)
|
60
63
|
end
|
61
64
|
|
62
65
|
def self.build_gate_node(seq)
|
@@ -82,7 +85,8 @@ module MidiPatch
|
|
82
85
|
end
|
83
86
|
}
|
84
87
|
|
85
|
-
|
88
|
+
stepwise_coordinates = make_stepwise(coordinates)
|
89
|
+
SplineHelper.build_spline_node_from_coordinates(stepwise_coordinates)
|
86
90
|
end
|
87
91
|
|
88
92
|
def self.scale_time(time, min_time, max_time)
|
@@ -100,4 +104,15 @@ module MidiPatch
|
|
100
104
|
def self.remove_from_stack(stack, event)
|
101
105
|
stack.delete_if {|e| e.note == event.note}
|
102
106
|
end
|
107
|
+
|
108
|
+
def self.make_stepwise(coordinates)
|
109
|
+
last_y = nil
|
110
|
+
coordinates.flat_map {|x, y|
|
111
|
+
result = []
|
112
|
+
result << [x-STEPWISE_X_DELTA, last_y] unless last_y.nil?
|
113
|
+
result << [x, y]
|
114
|
+
last_y = y
|
115
|
+
result
|
116
|
+
}
|
117
|
+
end
|
103
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build_audulus_wavetable_node
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Thrasher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fftw3
|
@@ -97,5 +97,5 @@ rubyforge_project:
|
|
97
97
|
rubygems_version: 2.6.13
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
|
-
summary: Builds
|
100
|
+
summary: Builds Audulus patches based on WAV or MIDI file inputs
|
101
101
|
test_files: []
|