On Thu, 2004-06-03 at 17:59, Dave Griffiths wrote:
> Sounds cool, but I don't understand fully...
Sorry, I didn't explain at all, partly because I can't remember how it
works.
This is the two dimensional structure:
+ + -
+ - +
- -
That gets rendered into something like this.
- -
- - + - - - +
+ - - + - - +- - - +
+ + + - - + + +
+ +
By this recursive subroutine:
{
my $count;
sub test {
my ($self, $value, $level) = _at__;
if (not $level) {
$level = $count = 0;
_at_score = ();
}
return if _at_$structure <= $level;
my $substruct = $structure->[$level];
foreach my $dir (_at_$substruct) {
++$count;
if ($dir eq '+') {
++$value;
}
elsif ($dir eq '-') {
--$value;
}
push _at_score, $value;
$self->test($value, $level + 1, $count);
}
}
}
I think there's probably a bug but it sounds ok, but then I am cheating
by using a rather boring scale.
> An lsystem is really just a set of search replace rules you iteratively apply
> to a string. Most of the work is in how you interpret the symbols. (good
> description here: http://en.wikipedia.org/wiki/Lindenmayer_system)
> Branching is also important, but in this system it doesn't make use of that
> for the melody.
Aha, thanks for that.
> Cool - I think I like the livecoded bit the best :) I meant to post some
> lsystem music earlier but forgot:
> http://www.archive.org/download/a-long-walk-take1/a-long-walk-take1.ogg
> http://www.archive.org/download/a-long-walk-take2/a-long-walk-take2.ogg
Both are lovely! A lot more successful than my attempts at melody I
think.
Goodnight,
alex
Received on Sun Jun 06 2004 - 01:01:55 BST