Last active
October 28, 2015 07:58
-
-
Save furenku/3cc18ed8e7eaa828bb20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
x=m.space; | |
p = ProxySpace.push( s ); | |
k = [ | |
\root, // root note | |
\intensity, | |
\degree, // progression degree | |
\chord, // chord variation | |
\chord_0, \chord_1, \chord_2, \chord_3 | |
]; | |
k.collect{|key| | |
// create controlproxy in proxyspace | |
("set " ++ key.asString ).postln; | |
p[key] = {|val| val }; | |
x[key].addDependant({|o,w,v| | |
p[key].set(\val, v.value()); | |
}); | |
}; | |
x[\chord]=\m; | |
x[\root]=60; | |
x[\degree]=0; | |
d=Dictionary.new(); | |
d[\M]=[0,7,12,16,19,24]; | |
d[\m]=[0,7,12,15,19,24]; | |
d[\M7]=[0,7,10,16,19,24]; | |
d[\m7]=[0,7,10,15,19,24]; | |
d[\Mmaj7]=[0,7,10,15,19,24]; | |
d[\mmaj7]=[0,7,11,16,19,24]; | |
d[\M9]=[0,7,11,15,19,24]; | |
d[\M9m]=[0,7,14,16,19,24]; | |
d[\m9]=[0,7,13,16,19,24]; | |
d[\m9m]=[0,7,14,15,19,24]; | |
p[\chords] = { | |
( | |
~root.kr + ~degree.kr + | |
[ ~chord_0.kr, ~chord_1.kr, ~chord_2.kr, ~chord_3.kr ] | |
).midicps; | |
}; | |
x[\chord].addDependant({|val| | |
val.value().postln; | |
if( d.keys.includes( val.value() ), | |
{ | |
p[\chord_0].set(\val, d[ val.value()][0] ); | |
p[\chord_1].set(\val, d[ val.value()][1] ); | |
p[\chord_2].set(\val, d[ val.value()][2] ); | |
p[\chord_3].set(\val, d[ val.value()][3] ); | |
//p[\chord_type].set(\chord_type, val.value); | |
}, { | |
"ERR: Use 'M', 'm', 'M7', 'm7', 'Mmaj7', 'mmaj7', 'M9', 'M9m', 'm9' or 'm9m' only as first CaosChord.ar argument".warn; | |
p[\chord_0].set(\val, d[ \m ][0] ); | |
p[\chord_1].set(\val, d[ \m ][1] ); | |
p[\chord_2].set(\val, d[ \m ][2] ); | |
p[\chord_3].set(\val, d[ \m ][3] ); | |
}); | |
}); | |
Tdef(\progresion, {arg params=#[[0,\M]]; | |
var waitTime = 1; | |
inf.do{|i| | |
if( params.wait != nil, | |
waitTime = params.wait | |
); | |
x[\chord]=params.chords[i%params.chords.size][1]; | |
x[\degree]=params.chords[i%params.chords.size][0]; | |
waitTime.wait; | |
} | |
}); | |
q=[ [ 2, \mmaj7 ] ,[ 0, \M ], [5, \m], [6, \mmaj7]]; | |
Tdef(\progresion).set(\chords,q); | |
Tdef(\progresion).set(\wait,5); | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment