Synchronising for Rémi
This commit is contained in:
30
Classes/Patterns/PXo.sc
Normal file
30
Classes/Patterns/PXo.sc
Normal file
@ -0,0 +1,30 @@
|
||||
Pxo {
|
||||
*new {
|
||||
arg expression, divisor=1, repeats=inf;
|
||||
var xoExp = Array.new(maxSize: expression.size);
|
||||
expression.do({
|
||||
arg char, i;
|
||||
if (char == $x, {xoExp.add(1, i)}, {xoExp.add(Rest(), i)})
|
||||
});
|
||||
xoExp = xoExp.collect({arg item; item / divisor});
|
||||
^Pseq.new(xoExp, repeats)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ptx {
|
||||
*new {
|
||||
arg expression, repeats=inf;
|
||||
var xoExp = Array.new(maxSize: expression.size);
|
||||
expression.do({
|
||||
arg char, i;
|
||||
switch(char)
|
||||
{$@} {xoExp.add(2, i)}
|
||||
{$O} {xoExp.add(1, i)}
|
||||
{$o} {xoExp.add(0.5, i)}
|
||||
{$°} {xoExp.add(0.25, i)}
|
||||
{} {xoExp.add(Rest(), i)};
|
||||
});
|
||||
^Pseq.new(xoExp, repeats)
|
||||
}
|
||||
}
|
||||
12
Classes/Patterns/PwrapSeq.sc
Normal file
12
Classes/Patterns/PwrapSeq.sc
Normal file
@ -0,0 +1,12 @@
|
||||
/* This one is taken from Mads Kjeldgaard's */
|
||||
/* https://github.com/madskjeldgaard/Monolithic/blob/main/Classes/Pattern/PwrapSeq.sc */
|
||||
PwrapSeq{
|
||||
*new{
|
||||
arg array, maxIndex, startIndex=0, repeats=inf;
|
||||
|
||||
var indexPat = Pseries.new(startIndex, 1, length: inf) % (maxIndex+1);
|
||||
|
||||
^Pindex.new(listPat: array, indexPat: indexPat, repeats: repeats)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user