This file contains 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
// Nbit creates a rhythmic array a specified beatdivision, of length numbeats, with adjustable event density | |
Nbit { | |
var beatdiv, numbeats, density; | |
*new { | beatdiv = 5, numbeats = 2, density = 0.5 | | |
var pulse = 1 / beatdiv; | |
var array = Array.fill(beatdiv*numbeats, { (density.coin).binaryValue }); | |
while( |
This file contains 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
PolyPlotter { | |
*plot {|limbArray = #[9, 17, 21], phaseoffset = 0, superpose = true| | |
var sinusplot; | |
sinusplot = { SinOsc.ar(limbArray, phaseoffset) }.plot(1, bounds: Rect(20, 780, 1370, 70)); | |
sinusplot.superpose = superpose; | |
} | |
} |
This file contains 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
// Rationalize converts a list of decimal representations to their closest possible rational expressions, | |
// returning a new 2D list | |
Rationalize { | |
*new { |decimal_list| | |
var rational_list = List(); | |
decimal_list.do { |item, i| |
This file contains 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
/* | |
Farey creates an ordered List containing decimal representations of a full Farey sequence up to F(n). | |
You can use my Rationalize class for conversion to rational list. | |
(translated from the Python example on Wikipedia) | |
*/ | |
Farey { | |
*new { |n = 5| |
This file contains 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
/* | |
EdgeList takes two rhythm arrays and makes a composite array, returning a 3D array with the unit duration, the composite array, | |
and the IOI times between events in the composite (in seconds). Can be used as an edge list for a graph. | |
The array arguments should be comprised of 0 and 1 values, and must each contain at least one value. | |
*/ | |
EdgeList { | |
var array1, array2, object; |
This file contains 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
PolyCalc { | |
*new { |limb1 = 21, limb2 = 25| | |
var limb1factors = limb1.factors; | |
var limb2factors = limb2.factors; | |
var limb1FirstFactor, limb1SecondFactor, limb2FirstFactor, limb2SecondFactor, temp; | |
var formatDurations; | |
if(limb1factors.size == 1, { limb1factors.add(1) }); | |
if(limb2factors.size == 1, { limb2factors.add(1) }); |
This file contains 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
// SNELLEN by chadochan. 7/12/2015 Durham | |
// Creates a 12-line 'optotype' eyechart text matrix with text project, random text, and text clearing functions. | |
( | |
var font = "Rockwell"; | |
var bold = true; | |
var backgroundcolor = Color.black; | |
var lettercolor = Color.grey(1); | |
var composite1, composite2, composite3, composite4, composite5, composite6, composite7, composite8, composite9, composite10, composite11, composite12; |
This file contains 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
// TEXTWALL by chadochan. 7/12/2015 Durham | |
// Creates a 25x6 text matrix with text project, random text, and text clearing functions. | |
( | |
var font = Font("Luxi Mono", 90); | |
var backgroundcolor = Color.black; | |
var lettercolor = Color.white; | |
var letter1, letter2, letter3, letter4, letter5, letter6, letter7, letter8, letter9, letter10, letter11, letter12, letter13, letter14, letter15, letter16, letter17, letter18, letter19, letter20, letter21, letter22, letter23, letter24, letter25, letter26, letter27, letter28, letter29, letter30, letter31, letter32, letter33, letter34, letter35, letter36, letter37, letter38, letter39, letter40, letter41, letter42, letter43, letter44, letter45, letter46, letter47, letter48, letter49, letter50, letter51, letter52, letter53, letter54, letter55, letter56, letter57, letter58, letter59, letter60, letter61, letter62, letter63, letter64, letter65, letter66, letter67, letter68, letter69, letter70, letter71, letter72, letter73, letter74, letter75, letter76, letter77, letter78, letter79, le |