[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] wslib update
Hi all,
I just added some things to wslib. The most important are Pattern
additions. They are not documented yet, so here are some examples:
// Pint, PintC, PintL, PintN: interpolation of patterns
(
[ PintC( Pwhite(), 0.1 ), // cubic interpolation (speed = 0.1)
PintL( Pwhite(), 0.1 ), // linear interpolation
PintN( Pwhite(), 0.1 ), // no interpolation
].collect({|p|p.asStream.nextN(100)}).flop.flat
.plot(numChannels: 3);
)
PintC( Pseq([0,1], inf), 1/
Pseries(1,0.25) ).asStream.nextN(1000).plot; // speed can be dynamic
// Pcbrown: version of brown noise that stays around the center
(
[ Pcbrown(), // centered brown noise
Pbrown(), // regular brown noise
].collect({|p|p.asStream.nextN(1000)}).flop.flat
.plot(numChannels: 2);
)
// PenvirGet: get Environment variables straight into patterns
~vari = 10;
~stream = PenvirGet( \vari ).asStream;
~stream.next; // -> 10
~stream = \vari.p.asStream; // shortcut
~vari = 11;
~stream.next; // -> 11
~vari = Pwhite(); // can also be a pattern or a stream
~stream.next; // -> ... (some random value)
~vari = { 1.0.rand }; // can also be a function
~stream.next; // -> ... (some random value)
PintC( \vari.p, 0.1 ).asStream.nextN(100).plot;
---
Quarks.checkoutAll; // -> enjoy!
cheers,
Wouter
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/