musicality 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +13 -3
- data/README.md +8 -8
- data/bin/auditions +241 -0
- data/bin/collidify +4 -2
- data/bin/musicality +13 -2
- data/examples/composition/auto_counterpoint.rb +4 -4
- data/examples/composition/part_generator.rb +6 -6
- data/examples/composition/scale_exercise.rb +5 -5
- data/examples/notation/scores.rb +2 -2
- data/examples/notation/twinkle.rb +6 -6
- data/examples/notation/twinkle.score +3 -3
- data/lib/musicality.rb +6 -4
- data/lib/musicality/composition/dsl/part_methods.rb +12 -0
- data/lib/musicality/composition/dsl/score_dsl.rb +4 -4
- data/lib/musicality/composition/dsl/score_methods.rb +8 -2
- data/lib/musicality/notation/model/audition.rb +16 -0
- data/lib/musicality/notation/model/score.rb +31 -30
- data/lib/musicality/performance/supercollider/conductor.rb +2 -2
- data/lib/musicality/performance/supercollider/synthdefs.rb +30 -29
- data/lib/musicality/project/auditions_task.rb +28 -0
- data/lib/musicality/project/create_tasks.rb +15 -9
- data/lib/musicality/project/file_cleaner.rb +22 -5
- data/lib/musicality/project/file_raker.rb +29 -21
- data/lib/musicality/project/project.rb +218 -32
- data/lib/musicality/version.rb +1 -1
- data/musicality.gemspec +6 -4
- data/spec/composition/dsl/part_methods_spec.rb +24 -0
- data/spec/notation/conversion/score_conversion_spec.rb +2 -1
- data/spec/notation/conversion/score_converter_spec.rb +23 -23
- data/spec/notation/model/score_spec.rb +66 -46
- data/spec/performance/conversion/score_collator_spec.rb +29 -29
- data/spec/performance/midi/score_sequencing_spec.rb +5 -5
- metadata +10 -8
- data/lib/musicality/project/load_config.rb +0 -58
@@ -8,25 +8,25 @@ def scale_exercise scale_class, base_pitch, rhythm
|
|
8
8
|
scale = scale_class.to_pitch_seq(base_pitch)
|
9
9
|
n = scale_class.count
|
10
10
|
m = rhythm.size
|
11
|
-
|
11
|
+
|
12
12
|
rseq = RepeatingSequence.new((0...m).to_a)
|
13
13
|
aseq = AddingSequence.new([0]*(m-1) + [1])
|
14
14
|
cseq = CompoundSequence.new(:+,[aseq,rseq])
|
15
15
|
pgs = cseq.take(m*n).map {|i| scale.at(i) }
|
16
16
|
notes = make_notes(rhythm, pgs) +
|
17
17
|
make_notes([3/4.to_r,-1/4.to_r], [scale.at(n)])
|
18
|
-
|
18
|
+
|
19
19
|
rseq = RepeatingSequence.new(n.downto(n+1-m).to_a)
|
20
20
|
aseq = AddingSequence.new([0]*(m-1) + [-1])
|
21
21
|
cseq = CompoundSequence.new(:+,[aseq,rseq])
|
22
22
|
pgs = cseq.take(m*n).map {|i| scale.at(i) }
|
23
23
|
notes += make_notes(rhythm, pgs) +
|
24
24
|
make_notes([3/4.to_r,-1/4.to_r], [scale.at(0)])
|
25
|
-
|
25
|
+
|
26
26
|
return notes
|
27
27
|
end
|
28
28
|
|
29
|
-
score = Score::Tempo.new(
|
29
|
+
score = Score::Tempo.new(120) do |s|
|
30
30
|
s.parts["scale"] = Part.new(Dynamics::MP) do |p|
|
31
31
|
Heptatonic::Prima::MODES.each do |mode_n,scale_class|
|
32
32
|
[[1/4.to_r,1/4.to_r,1/2.to_r]].each do |rhythm|
|
@@ -38,4 +38,4 @@ score = Score::Tempo.new(FOUR_FOUR,120) do |s|
|
|
38
38
|
end
|
39
39
|
|
40
40
|
seq = ScoreSequencer.new(score.to_timed(200)).make_midi_seq("scale" => 1)
|
41
|
-
File.open("./scale_exercise.mid", 'wb'){ |fout| seq.write(fout) }
|
41
|
+
File.open("./scale_exercise.mid", 'wb'){ |fout| seq.write(fout) }
|
data/examples/notation/scores.rb
CHANGED
@@ -10,11 +10,11 @@ include Meters
|
|
10
10
|
#
|
11
11
|
|
12
12
|
# minimum score, with no parts
|
13
|
-
s = Score::Tempo.new(
|
13
|
+
s = Score::Tempo.new(120)
|
14
14
|
|
15
15
|
# add a part
|
16
16
|
s.parts["piano"] = Part.new(MP) do |p|
|
17
|
-
p.notes = q(C4,C4,G4,G4,A4,A4) + h(G4) +
|
17
|
+
p.notes = q(C4,C4,G4,G4,A4,A4) + h(G4) +
|
18
18
|
q(F4,F4,E4,E4,D4,D4) + h(C4)
|
19
19
|
end
|
20
20
|
|
@@ -4,25 +4,25 @@ include Meters
|
|
4
4
|
include Dynamics
|
5
5
|
include Pitches
|
6
6
|
|
7
|
-
score = Score::Tempo.new(
|
7
|
+
score = Score::Tempo.new(120, title: "Twinkle, Twinkle, Little Star") do |s|
|
8
8
|
s.parts["rhand"] = Part.new(MF) do |p|
|
9
9
|
a_notes = q(C4,C4,G4,G4,A4,A4) + h(G4) +
|
10
10
|
q(F4,F4,E4,E4,D4,D4) + h(C4)
|
11
11
|
b_notes = q(G4,G4,F4,F4,E4,E4) + h(D4)
|
12
12
|
p.notes += a_notes + b_notes
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
s.parts["lhand"] = Part.new(MF) do |p|
|
16
16
|
Cmaj = [C3,E3,G3]
|
17
17
|
Fmaj = [F2,A2,C3]
|
18
18
|
Gmaj = [G2,B2,D3]
|
19
|
-
|
20
|
-
a_chords = h(Cmaj,Cmaj,Fmaj,Cmaj) +
|
19
|
+
|
20
|
+
a_chords = h(Cmaj,Cmaj,Fmaj,Cmaj) +
|
21
21
|
h(Fmaj,Cmaj,Gmaj,Cmaj)
|
22
22
|
b_chords = h(Cmaj,Fmaj,Cmaj,Gmaj)
|
23
23
|
p.notes += a_chords + b_chords
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
s.program.push 0...4
|
27
27
|
s.program.push 4...6
|
28
28
|
s.program.push 4...6
|
@@ -31,4 +31,4 @@ end
|
|
31
31
|
|
32
32
|
File.open('twinkle.ly','w'){|f| f.write(score.to_lilypond) }
|
33
33
|
File.open('twinkle.mid','wb'){|f| score.to_midi_seq(200).write(f) }
|
34
|
-
score.to_osc(200,'twinkle')
|
34
|
+
score.to_osc(200,'twinkle')
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# include Pitches
|
5
5
|
# ScoreDSL.load('twinkle.score')
|
6
6
|
|
7
|
-
tempo_score
|
7
|
+
tempo_score 120 do
|
8
8
|
title "Twinkle, Twinkle, Little Star"
|
9
9
|
|
10
10
|
Cmaj = [C3,E3,G3]
|
@@ -14,7 +14,7 @@ tempo_score Meters::FOUR_FOUR, 120 do
|
|
14
14
|
notes(
|
15
15
|
"rhand" => q(C4,C4,G4,G4,A4,A4) + h(G4) +
|
16
16
|
q(F4,F4,E4,E4,D4,D4) + h(C4),
|
17
|
-
"lhand" => h(Cmaj,Cmaj,Fmaj,Cmaj) +
|
17
|
+
"lhand" => h(Cmaj,Cmaj,Fmaj,Cmaj) +
|
18
18
|
h(Fmaj,Cmaj,Gmaj,Cmaj)
|
19
19
|
)
|
20
20
|
end
|
@@ -30,4 +30,4 @@ tempo_score Meters::FOUR_FOUR, 120 do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
File.open('twinkle.ly','w'){|f| f.write(score.to_lilypond) }
|
33
|
-
File.open('twinkle.mid','wb'){|f| score.to_midi_seq(200).write(f) }
|
33
|
+
File.open('twinkle.mid','wb'){|f| score.to_midi_seq(200).write(f) }
|
data/lib/musicality.rb
CHANGED
@@ -26,6 +26,7 @@ require 'musicality/notation/model/meter'
|
|
26
26
|
require 'musicality/notation/model/meters'
|
27
27
|
require 'musicality/notation/model/key'
|
28
28
|
require 'musicality/notation/model/keys'
|
29
|
+
require 'musicality/notation/model/audition'
|
29
30
|
require 'musicality/notation/model/score'
|
30
31
|
|
31
32
|
require 'treetop'
|
@@ -82,6 +83,7 @@ require 'musicality/composition/generation/counterpoint_generator'
|
|
82
83
|
require 'musicality/composition/generation/random_rhythm_generator'
|
83
84
|
|
84
85
|
require 'musicality/composition/dsl/score_methods'
|
86
|
+
require 'musicality/composition/dsl/part_methods'
|
85
87
|
require 'musicality/composition/dsl/score_dsl'
|
86
88
|
|
87
89
|
require 'musicality/composition/convenience_methods'
|
@@ -140,15 +142,15 @@ require 'musicality/printing/lilypond/part_engraver'
|
|
140
142
|
require 'musicality/printing/lilypond/score_engraver'
|
141
143
|
require 'musicality/printing/lilypond/score_engraving'
|
142
144
|
|
143
|
-
#
|
145
|
+
#
|
144
146
|
# Project
|
145
147
|
#
|
146
148
|
|
147
149
|
require 'rake'
|
148
150
|
require 'yaml'
|
149
151
|
require 'rake/tasklib'
|
152
|
+
require 'musicality/project/project'
|
150
153
|
require 'musicality/project/file_raker'
|
151
154
|
require 'musicality/project/file_cleaner'
|
152
|
-
require 'musicality/project/
|
153
|
-
require 'musicality/project/
|
154
|
-
require 'musicality/project/create_tasks'
|
155
|
+
require 'musicality/project/auditions_task'
|
156
|
+
require 'musicality/project/create_tasks'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Musicality
|
2
|
+
|
3
|
+
class Part
|
4
|
+
def dynamic_change new_dynamic, transition_dur: 0, offset: 0
|
5
|
+
if transition_dur == 0
|
6
|
+
change = (transition_dur == 0) ? Change::Immediate.new(new_dynamic) : Change::Gradual.linear(new_dynamic, transition_dur)
|
7
|
+
self.dynamic_changes[self.duration + offset] = change
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Musicality
|
2
2
|
|
3
|
-
class ScoreDSL
|
3
|
+
class ScoreDSL
|
4
4
|
def self.load fname
|
5
5
|
dsl = ScoreDSL.new
|
6
6
|
dsl.instance_eval(File.read(fname), fname)
|
@@ -12,10 +12,10 @@ class ScoreDSL
|
|
12
12
|
@score = nil
|
13
13
|
end
|
14
14
|
|
15
|
-
def tempo_score
|
16
|
-
@score = Score::Tempo.new(
|
15
|
+
def tempo_score start_tempo, &block
|
16
|
+
@score = Score::Tempo.new(start_tempo)
|
17
17
|
@score.instance_eval(&block)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
end
|
21
|
+
end
|
@@ -56,7 +56,13 @@ class Score
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
|
+
def audition part_name, program, &block
|
61
|
+
audition = Audition.new(part_name, program)
|
62
|
+
audition.instance_eval(&block)
|
63
|
+
@auditions.push audition
|
64
|
+
end
|
65
|
+
|
60
66
|
class Tempo < Score
|
61
67
|
def tempo_change new_tempo, transition_dur: 0, offset: 0
|
62
68
|
if transition_dur == 0
|
@@ -65,7 +71,7 @@ class Score
|
|
65
71
|
tempo_changes[self.duration + offset] = Change::Gradual.linear(new_tempo, transition_dur)
|
66
72
|
end
|
67
73
|
end
|
68
|
-
|
74
|
+
|
69
75
|
def meter_change new_meter, offset: 0
|
70
76
|
meter_changes[self.duration + offset] = Change::Immediate.new(new_meter)
|
71
77
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Musicality
|
2
|
+
|
3
|
+
class Audition
|
4
|
+
attr_reader :part_name, :program, :performers
|
5
|
+
def initialize part_name, program
|
6
|
+
@part_name = part_name
|
7
|
+
@program = program.is_a?(Array) ? program : [program]
|
8
|
+
@performers = {}
|
9
|
+
end
|
10
|
+
|
11
|
+
def performer name, supercollider_settings
|
12
|
+
@performers[name] = supercollider_settings
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -6,13 +6,13 @@ class Score
|
|
6
6
|
|
7
7
|
special_packing(:program){|p| p.map {|range| range.to_s }}
|
8
8
|
special_unpacking(:program){|p| p.map {|str| parse_numeric_range(str) }}
|
9
|
-
|
9
|
+
|
10
10
|
special_packing(:sections){|s| Hash[ s.map {|name,range| [name,range.to_s] } ]}
|
11
11
|
special_unpacking(:sections){|s| Hash[ s.map {|name,str| [name,parse_numeric_range(str)] } ]}
|
12
12
|
|
13
|
-
attr_accessor :parts, :sections, :program, :start_key, :key_changes
|
13
|
+
attr_accessor :parts, :sections, :program, :start_key, :key_changes, :auditions
|
14
14
|
attr_writer :title, :composer
|
15
|
-
|
15
|
+
|
16
16
|
def title value = nil
|
17
17
|
if value.nil?
|
18
18
|
return @title
|
@@ -29,7 +29,7 @@ class Score
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def initialize parts: {}, program: [], title: nil, composer: nil, sections: {}, start_key: Keys::C_MAJOR, key_changes: {}
|
32
|
+
def initialize parts: {}, program: [], title: nil, composer: nil, sections: {}, start_key: Keys::C_MAJOR, key_changes: {}, auditions: []
|
33
33
|
@parts = parts
|
34
34
|
@program = program
|
35
35
|
@title = title
|
@@ -37,6 +37,7 @@ class Score
|
|
37
37
|
@sections = sections
|
38
38
|
@start_key = start_key
|
39
39
|
@key_changes = key_changes
|
40
|
+
@auditions = auditions
|
40
41
|
yield(self) if block_given?
|
41
42
|
end
|
42
43
|
|
@@ -44,11 +45,11 @@ class Score
|
|
44
45
|
def check_methods
|
45
46
|
[:check_program, :check_parts, :check_start_key, :check_key_changes ]
|
46
47
|
end
|
47
|
-
|
48
|
+
|
48
49
|
def clone
|
49
50
|
Marshal.load(Marshal.dump(self))
|
50
51
|
end
|
51
|
-
|
52
|
+
|
52
53
|
def ==(other)
|
53
54
|
return self.class == other.class &&
|
54
55
|
@parts == other.parts && @program == other.program &&
|
@@ -56,20 +57,20 @@ class Score
|
|
56
57
|
@title == other.title && @composer == other.composer &&
|
57
58
|
@start_key == other.start_key && @key_changes == other.key_changes
|
58
59
|
end
|
59
|
-
|
60
|
+
|
60
61
|
def duration
|
61
62
|
@parts.map {|name,part| part.duration }.max || 0.to_r
|
62
63
|
end
|
63
|
-
|
64
|
+
|
64
65
|
def collated?
|
65
|
-
@program.size == 1 && @program[0].first == 0
|
66
|
+
@program.size == 1 && @program[0].first == 0 && @program[0].last == duration
|
66
67
|
end
|
67
|
-
|
68
|
+
|
68
69
|
class Timed < Score
|
69
70
|
end
|
70
71
|
|
71
72
|
# Tempo-based score with meter, bar lines, and a fixed pulse (beat).
|
72
|
-
#
|
73
|
+
#
|
73
74
|
# Offsets and durations are based on note duration, but note duration is
|
74
75
|
# determined by the tempo, which can change.
|
75
76
|
#
|
@@ -78,23 +79,23 @@ class Score
|
|
78
79
|
attr_accessor :start_tempo, :tempo_changes, :start_meter, :meter_changes
|
79
80
|
|
80
81
|
# See Score#initialize for remaining kwargs
|
81
|
-
def initialize
|
82
|
+
def initialize start_tempo, tempo_changes: {}, start_meter: Meters::FOUR_FOUR, meter_changes: {}, parts: {}, program: [], title: nil, composer: nil, sections: {}, start_key: Keys::C_MAJOR, key_changes: {}, auditions: []
|
82
83
|
@start_tempo = start_tempo
|
83
84
|
@tempo_changes = tempo_changes
|
84
85
|
@start_meter = start_meter
|
85
86
|
@meter_changes = meter_changes
|
86
|
-
|
87
|
-
super(parts: parts, program: program, title: title, composer: composer, sections: sections, start_key: start_key, key_changes: key_changes)
|
87
|
+
|
88
|
+
super(parts: parts, program: program, title: title, composer: composer, sections: sections, start_key: start_key, key_changes: key_changes, auditions: auditions)
|
88
89
|
end
|
89
|
-
|
90
|
+
|
90
91
|
def check_methods
|
91
92
|
super() + [:check_start_tempo, :check_tempo_changes, :check_start_meter, :check_meter_changes]
|
92
93
|
end
|
93
|
-
|
94
|
+
|
94
95
|
def validatables
|
95
96
|
super() + [ @start_meter ] + @meter_changes.values.map {|v| v.end_value}
|
96
97
|
end
|
97
|
-
|
98
|
+
|
98
99
|
def ==(other)
|
99
100
|
return super(other) &&
|
100
101
|
@start_tempo == other.start_tempo &&
|
@@ -115,23 +116,23 @@ class Score
|
|
115
116
|
end
|
116
117
|
|
117
118
|
private
|
118
|
-
|
119
|
+
|
119
120
|
def check_start_tempo
|
120
121
|
if @start_tempo <= 0
|
121
122
|
raise NonPositiveError, "Start tempo (#{@start_tempo}) is not positive"
|
122
123
|
end
|
123
124
|
end
|
124
|
-
|
125
|
+
|
125
126
|
def check_tempo_changes
|
126
127
|
badtypes = @tempo_changes.select {|k,v| !v.end_value.is_a?(Numeric) }
|
127
128
|
if badtypes.any?
|
128
129
|
raise TypeError, "Found non-numeric tempo change values: #{badtypes}"
|
129
130
|
end
|
130
|
-
|
131
|
+
|
131
132
|
badvalues = @tempo_changes.select {|k,v| v.end_value <= 0 }
|
132
133
|
if badvalues.any?
|
133
134
|
raise NonPositiveError, "Found non-positive tempo changes values: #{badvalues}"
|
134
|
-
end
|
135
|
+
end
|
135
136
|
end
|
136
137
|
|
137
138
|
def check_start_meter
|
@@ -139,7 +140,7 @@ class Score
|
|
139
140
|
raise TypeError, "Start meter #{@start_meter} is not a Meter object"
|
140
141
|
end
|
141
142
|
end
|
142
|
-
|
143
|
+
|
143
144
|
def check_meter_changes
|
144
145
|
badtypes = @meter_changes.select {|k,v| !v.end_value.is_a?(Meter) }
|
145
146
|
if badtypes.any?
|
@@ -152,26 +153,26 @@ class Score
|
|
152
153
|
end
|
153
154
|
end
|
154
155
|
end
|
155
|
-
|
156
|
+
|
156
157
|
private
|
157
|
-
|
158
|
+
|
158
159
|
def check_program
|
159
160
|
non_ranges = @program.select {|x| !x.is_a?(Range) }
|
160
161
|
if non_ranges.any?
|
161
162
|
raise TypeError, "Non-Range program element(s) found: #{non_ranges}"
|
162
163
|
end
|
163
|
-
|
164
|
+
|
164
165
|
non_increasing = @program.select {|seg| seg.first >= seg.last }
|
165
166
|
if non_increasing.any?
|
166
167
|
raise NonIncreasingError, "Non-increasing program range(s) found: #{non_increasing}"
|
167
168
|
end
|
168
|
-
|
169
|
+
|
169
170
|
negative = @program.select {|seg| seg.first < 0 || seg.last < 0 }
|
170
171
|
if negative.any?
|
171
172
|
raise NegativeError, "Program range(s) with negative value(s) found: #{negative}"
|
172
173
|
end
|
173
174
|
end
|
174
|
-
|
175
|
+
|
175
176
|
def check_parts
|
176
177
|
non_parts = @parts.values.select {|x| !x.is_a?(Part) }
|
177
178
|
if non_parts.any?
|
@@ -184,13 +185,13 @@ class Score
|
|
184
185
|
raise TypeError, "Start key #{@start_key} is not a Key object"
|
185
186
|
end
|
186
187
|
end
|
187
|
-
|
188
|
+
|
188
189
|
def check_key_changes
|
189
190
|
badtypes = @key_changes.select {|k,v| !v.end_value.is_a?(Key) }
|
190
191
|
if badtypes.any?
|
191
192
|
raise TypeError, "Found key change values that are not Key objects: #{badtypes}"
|
192
193
|
end
|
193
|
-
|
194
|
+
|
194
195
|
badoffsets = @key_changes.select {|k,v| k != k.to_i }
|
195
196
|
if badoffsets.any?
|
196
197
|
raise NonIntegerError, "Found key changes at non-integer offsets: #{badoffsets}"
|
@@ -217,7 +218,7 @@ class Score
|
|
217
218
|
def self.parse_numeric_range str
|
218
219
|
result = str.match /(\d+([\.\/]\d+)?)([\.]{2,3})(\d+([\.\/]\d+)?)/
|
219
220
|
raise ArgumentError, "string #{str} is not a numeric range" if result.nil?
|
220
|
-
|
221
|
+
|
221
222
|
dots = result.values_at(3)
|
222
223
|
l_num = parse_numeric(result.values_at(1)[0])
|
223
224
|
r_num = parse_numeric(result.values_at(4)[0])
|
@@ -14,11 +14,11 @@ class Conductor
|
|
14
14
|
end]
|
15
15
|
end
|
16
16
|
|
17
|
-
def perform base_fpath, selected_parts: @performers.keys, verbose: false, lead_time: 0.1
|
17
|
+
def perform base_fpath, selected_parts: @performers.keys, verbose: false, lead_time: 0.1, keep_code: false
|
18
18
|
bundles = bundles(selected_parts, lead_time)
|
19
19
|
fpath = write_sc_code bundles, base_fpath
|
20
20
|
exec_sc_code fpath, bundles.last.time, verbose
|
21
|
-
File.delete(fpath)
|
21
|
+
File.delete(fpath) unless keep_code
|
22
22
|
end
|
23
23
|
|
24
24
|
def bundles selected_parts = @performers.keys, lead_time
|
@@ -3,10 +3,13 @@ module SuperCollider
|
|
3
3
|
module SynthDefs
|
4
4
|
|
5
5
|
VOLUME_CONTROL = SynthDef.new(name: "volume_control", params: { :in => nil, :out => nil, :control => nil },
|
6
|
-
body:
|
6
|
+
body: <<-SCLANG,
|
7
|
+
var sig = In.ar([in,in+1]) * In.kr(control);
|
8
|
+
Out.ar(out,sig);
|
9
|
+
SCLANG
|
7
10
|
credit: "James Tunnell",
|
8
11
|
)
|
9
|
-
|
12
|
+
|
10
13
|
VOLUME_CHANGE = SynthDef.new(name: "volume_change", params: { :vol_bus => nil, :vol => nil, :dur => nil },
|
11
14
|
body: " Out.kr(vol_bus, Line.kr(In.kr(vol_bus), vol, dur));",
|
12
15
|
credit: "James Tunnell",
|
@@ -203,8 +206,6 @@ SCLANG
|
|
203
206
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
204
207
|
)
|
205
208
|
|
206
|
-
//
|
207
|
-
|
208
209
|
ESM = SynthDef.new(name: "esm", params: { :freq => 440, :mix => 0.5, :glide => 0, :cutoff => 20000, :rq => 1, :fdec => 0, :fint => 1,
|
209
210
|
:vel => 1, :fvel => 1, :t_gate => 1, :vdec => 1, :vvel => 0, :od => 0, :mul => 0.1, :pan => 0, :out => 0 },
|
210
211
|
body: <<-SCLANG,
|
@@ -277,7 +278,7 @@ SCLANG
|
|
277
278
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
278
279
|
)
|
279
280
|
|
280
|
-
PROPHET5_STRINGS = SynthDef.new(name: "prophet5pwmstrings", params: { :out => 0, :freq => 440, :amp => 0.8,
|
281
|
+
PROPHET5_STRINGS = SynthDef.new(name: "prophet5pwmstrings", params: { :out => 0, :freq => 440, :amp => 0.8,
|
281
282
|
:gate => 1, :lforate => 3, :lfowidth => 0.1, :cutoff => 12000, :rq => 0.5, :pan => 0.0 },
|
282
283
|
body: <<-SCLANG,
|
283
284
|
var lfo, pulse, filter, env;
|
@@ -298,7 +299,7 @@ EOS
|
|
298
299
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
299
300
|
)
|
300
301
|
|
301
|
-
OSC_WOBBLE = SynthDef.new(name: "singleoscillatorwobble", params: { :out => 0, :freq => 440, :amp => 0.8,
|
302
|
+
OSC_WOBBLE = SynthDef.new(name: "singleoscillatorwobble", params: { :out => 0, :freq => 440, :amp => 0.8,
|
302
303
|
:gate => 1, :lforate => 10, :lfowidth => 0.5, :cutoff => 12000, :rq => 0.5, :pan => 0.0 },
|
303
304
|
body: <<-SCLANG,
|
304
305
|
var lfo, pulse, filter, env;
|
@@ -319,7 +320,7 @@ EOS
|
|
319
320
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
320
321
|
)
|
321
322
|
|
322
|
-
TRI_BELLS = SynthDef.new(name:"trianglewavebells", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
323
|
+
TRI_BELLS = SynthDef.new(name:"trianglewavebells", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
323
324
|
:lforate => 10, :lfowidth => 0.0, :cutoff => 100, :rq => 0.5, :pan => 0.0 },
|
324
325
|
body: <<-SCLANG,
|
325
326
|
var osc1, osc2, vibrato, filter, env;
|
@@ -367,7 +368,7 @@ EOS
|
|
367
368
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
368
369
|
)
|
369
370
|
|
370
|
-
MOOG_BASS = SynthDef.new(name: "moogbass", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
371
|
+
MOOG_BASS = SynthDef.new(name: "moogbass", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
371
372
|
:cutoff => 1000, :gain => 2.0, :lagamount => 0.01, :pan => 0.0 },
|
372
373
|
body: <<-SCLANG,
|
373
374
|
var osc, filter, env, filterenv;
|
@@ -388,7 +389,7 @@ EOS
|
|
388
389
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
389
390
|
)
|
390
391
|
|
391
|
-
MOOG_BASS2 = SynthDef.new(name: "moogbass2", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
392
|
+
MOOG_BASS2 = SynthDef.new(name: "moogbass2", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
392
393
|
:attackTime => 0.2, :fenvamount => 0.5, :cutoff => 1000, :gain => 2.0, :pan => 0.0 },
|
393
394
|
body: <<-SCLANG,
|
394
395
|
var osc, filter, env, filterenv;
|
@@ -410,7 +411,7 @@ EOS
|
|
410
411
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
411
412
|
)
|
412
413
|
|
413
|
-
PLASTICKY_STRINGS = SynthDef.new(name: "plastickystrings", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
414
|
+
PLASTICKY_STRINGS = SynthDef.new(name: "plastickystrings", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
414
415
|
:lforate => 5900, :lfowidth => 0.01, :cutoff => 12000, :rq => 0.5, :pan => 0.0 },
|
415
416
|
body: <<-SCLANG,
|
416
417
|
var lfo, saw, filter, env;
|
@@ -432,7 +433,7 @@ EOS
|
|
432
433
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
433
434
|
)
|
434
435
|
|
435
|
-
BASS_FOUNDATION = SynthDef.new(name: "bassfoundation", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
436
|
+
BASS_FOUNDATION = SynthDef.new(name: "bassfoundation", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
436
437
|
:cutoff => 1000, :rq => 0.5, :pan => 0.0 },
|
437
438
|
body: <<-SCLANG,
|
438
439
|
var osc, filter, env, filterenv;
|
@@ -453,7 +454,7 @@ EOS
|
|
453
454
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
454
455
|
)
|
455
456
|
|
456
|
-
BASS_HIGHEND = SynthDef.new(name: "basshighend", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
457
|
+
BASS_HIGHEND = SynthDef.new(name: "basshighend", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
457
458
|
:cutoff => 3000, :rq => 0.1, :drive => 2.0, :pan => 0.0 },
|
458
459
|
body: <<-SCLANG,
|
459
460
|
var osc, filter, env, filterenv;
|
@@ -489,7 +490,7 @@ EOS
|
|
489
490
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
490
491
|
)
|
491
492
|
|
492
|
-
WINWOOD_LEAD = SynthDef.new(name: "winwoodlead", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
493
|
+
WINWOOD_LEAD = SynthDef.new(name: "winwoodlead", params: { :out => 0, :freq => 440, :amp => 0.8, :gate => 1,
|
493
494
|
:cutoff => 8000, :rq => 0.8, :lfowidth => 0.01, :lforate => 8, :lagamount => 0.01, :pan => 0.0 },
|
494
495
|
body: <<-SCLANG,
|
495
496
|
var pulse, filter, env, lfo;
|
@@ -512,7 +513,7 @@ EOS
|
|
512
513
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
513
514
|
)
|
514
515
|
|
515
|
-
SITUATION_SYNTH = SynthDef.new(name: "situationsynth", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
516
|
+
SITUATION_SYNTH = SynthDef.new(name: "situationsynth", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
516
517
|
:cutoff => 8000, :rq => 0.8, :lfowidth => 0.001, :lforate => 3.3, :pan => -0.1 },
|
517
518
|
body: <<-SCLANG,
|
518
519
|
var pulse, filter, env, filterenv, lfo;
|
@@ -527,7 +528,7 @@ SITUATION_SYNTH = SynthDef.new(name: "situationsynth", params: { :out => 0, :fre
|
|
527
528
|
SCLANG
|
528
529
|
)
|
529
530
|
|
530
|
-
RES_SQUARES = SynthDef.new(name: "ressquares", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
531
|
+
RES_SQUARES = SynthDef.new(name: "ressquares", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
531
532
|
:cutoff => 8000, :rq => 0.8, :pan => -0.1 },
|
532
533
|
body: <<-SCLANG,
|
533
534
|
var pulse, filter, env;
|
@@ -548,7 +549,7 @@ EOS
|
|
548
549
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
549
550
|
)
|
550
551
|
|
551
|
-
EIGHTTOEIGHT_KICK = SynthDef.new(name: "eightoeightkick", params: { :out => 0, :freq => 440, :amp => 0.1,
|
552
|
+
EIGHTTOEIGHT_KICK = SynthDef.new(name: "eightoeightkick", params: { :out => 0, :freq => 440, :amp => 0.1,
|
552
553
|
:ringTime => 10.0, :releaseTime => 1.0, :distortion => 0.1, :pan => -0.1 },
|
553
554
|
body: <<-SCLANG,
|
554
555
|
var impulse, filter, env;
|
@@ -569,7 +570,7 @@ EOS
|
|
569
570
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
570
571
|
)
|
571
572
|
|
572
|
-
TONEWHEEL_TWO = SynthDef.new(name: "tonewheeltwo", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
573
|
+
TONEWHEEL_TWO = SynthDef.new(name: "tonewheeltwo", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
573
574
|
:lforate => 4.85, :lfowidth => 0.1, :cutoff => 5000, :rq => 0.25, :pan => 0.0 },
|
574
575
|
body: <<-SCLANG,
|
575
576
|
//tone wheel organ emulation via two oscillators pp. 50-51
|
@@ -593,7 +594,7 @@ EOS
|
|
593
594
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
594
595
|
)
|
595
596
|
|
596
|
-
EVERYTHING_RHODES = SynthDef.new(name: "everythingrhodes", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
597
|
+
EVERYTHING_RHODES = SynthDef.new(name: "everythingrhodes", params: { :out => 0, :freq => 440, :amp => 0.1, :gate => 1,
|
597
598
|
:lforate => 1.85, :lfowidth => 0.5, :cutoff => 2000, :rq => 0.2, :pan => 0.0 },
|
598
599
|
body: <<-SCLANG,
|
599
600
|
var pulse, filter, env;
|
@@ -614,7 +615,7 @@ EOS
|
|
614
615
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
615
616
|
)
|
616
617
|
|
617
|
-
SPACE_THEREMIN = SynthDef.new(name: "spacetheremin", params: { :out => 0, :freq => 440, :amp => 0.1,
|
618
|
+
SPACE_THEREMIN = SynthDef.new(name: "spacetheremin", params: { :out => 0, :freq => 440, :amp => 0.1,
|
618
619
|
:gate => 1, :lforate => 6, :lfowidth => 0.5, :cutoff => 4000, :rq => 0.25, :lagTime => 0.1, :pan => 0.0 },
|
619
620
|
body: <<-SCLANG,
|
620
621
|
var lfo, osc, filter, env;
|
@@ -635,7 +636,7 @@ EOS
|
|
635
636
|
source: "https://github.com/acarabott/roundhouse-synth-design-course-2014",
|
636
637
|
)
|
637
638
|
|
638
|
-
FAT_VELOCITY_BASS = SynthDef.new(name: "fatvelocitybass", params: { :out => 0, :freq => 440, :amp => 0.5,
|
639
|
+
FAT_VELOCITY_BASS = SynthDef.new(name: "fatvelocitybass", params: { :out => 0, :freq => 440, :amp => 0.5,
|
639
640
|
:gate => 1, :cutoff => 2000, :rq => 0.15, :lagTime => 0.01, :pan => 0.0 },
|
640
641
|
body: <<-SCLANG,
|
641
642
|
var lfo, osc, filter, env;
|
@@ -990,7 +991,7 @@ SCLANG
|
|
990
991
|
source: "https://github.com/supercollider-quarks/SynthDefPool",
|
991
992
|
)
|
992
993
|
|
993
|
-
CS80_LEAD_MH = SynthDef.new(name: "cs80lead_mh", params: { :freq => 880, :amp => 0.5, :att => 0.75, :decay => 0.5,
|
994
|
+
CS80_LEAD_MH = SynthDef.new(name: "cs80lead_mh", params: { :freq => 880, :amp => 0.5, :att => 0.75, :decay => 0.5,
|
994
995
|
:sus => 0.8, :rel => 1.0, :fatt => 0.75, :fdecay => 0.5, :fsus => 0.8, :frel => 1.0, :cutoff => 200, :pan => 0,
|
995
996
|
:dtune => 0.002, :vibrate => 4, :vibdepth => 0.015, :gate => 1, :ratio => 1,:out => 0 },
|
996
997
|
body: <<-SCLANG,
|
@@ -1030,7 +1031,7 @@ CYMBAL_808 = SynthDef.new(name: "cymbal808", params: { :out => 0, :baseFreq => 3
|
|
1030
1031
|
signal = signal + FreeVerb.ar(signal);
|
1031
1032
|
signal = signal * EnvGen.ar(Env.new([0, 1, 0.4, 0, 0], [2, time, 50, 500], [0, -0.5, 0, -50]), timeScale:(1/1000), doneAction:2);
|
1032
1033
|
signal = [signal, DelayN.ar(signal, 0.005, 0.005)];
|
1033
|
-
OffsetOut.ar(out, signal*
|
1034
|
+
OffsetOut.ar(out, signal*amp ! 2);
|
1034
1035
|
SCLANG
|
1035
1036
|
credit: "Published on sc-users 2007-08-25 by Ryan Brown",
|
1036
1037
|
source: "https://github.com/supercollider-quarks/SynthDefPool",
|
@@ -1571,7 +1572,7 @@ SCLANG
|
|
1571
1572
|
)
|
1572
1573
|
|
1573
1574
|
|
1574
|
-
SynthDef.new(name: "sawpulse", params: { :out => 0, :freq => 440, :gate => 0.5, :plfofreq => 6, :mw => 0, :ffreq => 2000, :rq => 0.3, :freqlag => 0.05, :amp => 1 },
|
1575
|
+
SAWPULSE = SynthDef.new(name: "sawpulse", params: { :out => 0, :freq => 440, :gate => 0.5, :plfofreq => 6, :mw => 0, :ffreq => 2000, :rq => 0.3, :freqlag => 0.05, :amp => 1 },
|
1575
1576
|
body: <<-SCLANG,
|
1576
1577
|
var sig, plfo, fcurve;
|
1577
1578
|
plfo = SinOsc.kr(plfofreq, mul:mw, add:1);
|
@@ -1588,7 +1589,7 @@ SCLANG
|
|
1588
1589
|
source: "https://github.com/bwestergard/supercollider-experiments",
|
1589
1590
|
)
|
1590
1591
|
|
1591
|
-
SynthDef.new(name: "sawpulse2", params: { :out => 0, :freq => 440, :gate => 0.5, :plfofreq => 6, :mw => 0, :ffreq => 2000, :rq => 0.3, :freqlag => 0.05, :amp => 1 },
|
1592
|
+
SAWPULSE2 = SynthDef.new(name: "sawpulse2", params: { :out => 0, :freq => 440, :gate => 0.5, :plfofreq => 6, :mw => 0, :ffreq => 2000, :rq => 0.3, :freqlag => 0.05, :amp => 1 },
|
1592
1593
|
body: <<-SCLANG,
|
1593
1594
|
var sig, plfo, fcurve;
|
1594
1595
|
plfo = SinOsc.kr(plfofreq, mul:mw, add:1);
|
@@ -1603,7 +1604,7 @@ SCLANG
|
|
1603
1604
|
source: "https://github.com/bwestergard/supercollider-experiments",
|
1604
1605
|
)
|
1605
1606
|
|
1606
|
-
SynthDef.new(name: "sinepluck", params: { :out => 0, :freq => 440, :amp => 1, :dur => nil },
|
1607
|
+
SINEPLUCK = SynthDef.new(name: "sinepluck", params: { :out => 0, :freq => 440, :amp => 1, :dur => nil },
|
1607
1608
|
body: <<-SCLANG,
|
1608
1609
|
var mod,tone;
|
1609
1610
|
amp = amp * 0.8;
|
@@ -1617,7 +1618,7 @@ SCLANG
|
|
1617
1618
|
source: "https://github.com/bwestergard/supercollider-experiments",
|
1618
1619
|
)
|
1619
1620
|
|
1620
|
-
SynthDef.new(name: "snare", params: { :amp => 1, :dur => 0.05, :out => 0 },
|
1621
|
+
SNARE3 = SynthDef.new(name: "snare", params: { :amp => 1, :dur => 0.05, :out => 0 },
|
1621
1622
|
body: <<-SCLANG,
|
1622
1623
|
dur = dur * 16;
|
1623
1624
|
Out.ar(out, amp * XLine.ar(2,1/1000,dur) * BPF.ar(PinkNoise.ar(0.8), XLine.ar(20000,1000,dur, doneAction:2), 0.8).dup);
|
@@ -1625,7 +1626,7 @@ SCLANG
|
|
1625
1626
|
source: "https://github.com/bwestergard/supercollider-experiments",
|
1626
1627
|
)
|
1627
1628
|
|
1628
|
-
SynthDef.new(name: "kick", params: { :out => 0, :amp => 1, :dur => 0.05 },
|
1629
|
+
KICK1 = SynthDef.new(name: "kick", params: { :out => 0, :amp => 1, :dur => 0.05 },
|
1629
1630
|
body: <<-SCLANG,
|
1630
1631
|
var tone;
|
1631
1632
|
tone = SinOsc.ar(XLine.ar(800,2,dur*4, mul: 0.2, doneAction:2));
|
@@ -1635,7 +1636,7 @@ SCLANG
|
|
1635
1636
|
)
|
1636
1637
|
|
1637
1638
|
|
1638
|
-
SynthDef.new(name: "poly1", params: { :out => 0, :gate => 1, :freq => 440 },
|
1639
|
+
POLY1 = SynthDef.new(name: "poly1", params: { :out => 0, :gate => 1, :freq => 440 },
|
1639
1640
|
body: <<-SCLANG,
|
1640
1641
|
var aEnv,fEnv,osc1, osc2,flt;
|
1641
1642
|
aEnv=EnvGen.kr(Env.asr(0.2,1,0.1), gate, doneAction:2);
|
@@ -1651,4 +1652,4 @@ SCLANG
|
|
1651
1652
|
|
1652
1653
|
end
|
1653
1654
|
end
|
1654
|
-
end
|
1655
|
+
end
|