[sc-users] MathLib

Dan Stowell danstowell at gmail.com
Sat Mar 3 21:45:52 PST 2007


Julian,

The MarkovSet class has some very nice potential. Do you happen to
have an example of how to use it from within a Pbind or similar? It'd
be nice to be able to use it to generate Pattern sequences but I can't
spot how, I'm afraid.

Thanks
Dan

2007/3/3, Julian Rohrhuber <rohrhuber at uni-hamburg.de>:
> I've fixed those, thank you for your suggestions! I've improved the
> stream methods a bit, too.
>
> >
> >I was trying out MarkovSetN (v3.4 from the MathLib quark) and it didn't seem
> >to be behaving quite as I was expecting when using it in a stream:
> >
> >1. The lookUpDict values get rewritten as the buffer gets updated.
> >2. When a seed is chosen, the stream returns nil n=order times rather than
> >the values of the seed.
> >3. Why is nil.alwaysYield used instead of automatically choosing a new seed
> >like in MarkovSet?
> >
> >Just wondered whether these were bugs or misunderstandings on my part. The
> >following changes work for me anyway...
> >jamie
> >
> >/*
> >m=MarkovSetN.fill(inf, Pseq("ababababaabb"),2); m.makeSeeds;
> >n=m.asStream;
> >30.do {n.next.postln;};
> >*/
> >
> >+ MarkovSetN {
> >
> >       embedInStream { arg inval, repeats=inf;
> >                       var item,  buffer, key;
> >
> >                       repeats.do {
> >                               key = seeds.choose; //get a  seed name
> >                               ("chose a seed at random" + key).postln;
> >
> >                               //buffer = lookUpDict.at(key).asArray;
> >                               buffer = lookUpDict.at(key).asArray.copy;
> >//must be copied otherwise lookUpDict gets changed by buffer.removeAt(0)
> >below
> >
> >                               //buffer.do { "fromBuffer: ".post;
> >inval = item.yield };
> >                               buffer.do {|item| "fromBuffer:
> >".post; inval = item.yield };
> >//arg item missing otherwise get nil for n=order items in the stream
> >
> >                               while {
> >                                       item = this.get(key);
> >                                       item.notNil;
> >                               } {
> >                                       buffer.removeAt(0);
> >                                       buffer = buffer.add(item);
> >                                       key = buffer.asSymbol;
> >                               item.yield;
> >                               };
> >                               //nil.alwaysYield;
> >//why not choose seed at random like MarkovSet?
> >                               };
> >                       ^inval;
> >       }
> >}
> >
> >
> >
> >
> >
> >Julian Rohrhuber wrote:
> >>
> >>  I've bundled a couple of math-related classes and extensions
> >>  into a thematic quark library: MathLib. It is not my personal library,
> >>  so please feel free to suggest things to add that are missing.
> >>
> >>
> >>  //////////////
> >>  installing it:
> >>
> >>  Quarks.install("MathLib");
> >>
> >>  if you run into problems with svn, see Quarks.help.
> >>
> >>
> >>  /////////////////
> >>  MathLib contents:
> >>
> >>  MarkovSet:
> >>      MarkovSet
> >>      MarkovSetN
> >>      IdentityMarkovSet
> >>      LookupMarkovSet
> >>      ShannonFinger
> >>      FuzzyDictionary
> >>      FuzzySet
> >>
> >>  Patterns:
> >>      P3n1
> >>      Pboolnet // an adaption of Sekhar's boolean network pattern.
> >>
> >>
> >>  extensions:
> >>      statistical methods by Alberto de Campo
> >>      information theory stuff for Bag
> >>      matrix elimination by Kathi Vogt
> >>      a test whether a number is a cantor number
> >>      a simple way to write a quine
> >>
> >>  and a LaTeX table generator
> >>  --
> >>
> >>
> >>
> >>
> >>
> >>  .
> >>  _______________________________________________
> >>  sc-users mailing list
> >>  sc-users at create.ucsb.edu
> >>  http://www.create.ucsb.edu/mailman/listinfo/sc-users
> >>
> >>
> >
> >--
> >View this message in context:
> >http://www.nabble.com/MathLib-tf3229108.html#a9287638
> >Sent from the Supercollider - User mailing list archive at Nabble.com.
> >
> >_______________________________________________
> >sc-users mailing list
> >sc-users at create.ucsb.edu
> >http://www.create.ucsb.edu/mailman/listinfo/sc-users
>
>
> --
>
>
>
>
>
> .
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>


-- 
http://www.mcld.co.uk


More information about the sc-users mailing list