Synchronising for Rémi

This commit is contained in:
2024-01-21 16:19:41 +01:00
parent 7eeb172dba
commit 1777d5758c
16 changed files with 565 additions and 312 deletions

30
Classes/Patterns/PXo.sc Normal file
View 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)
}
}

View 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)
}
}