[Csnd] L-Systems in Csound

Hello everybody!

I’m researching again a little bit on L-Systems / Lindenmayer Systems and i was wondering what your experiences with these are?
Espacially in Csound. May it Sound Generation, Sound Control oder Data creation.

I was using L-Systems via Common Lisp and i wanted to connect it a little deeper to Csound and i want to see whats it’s possible there.

All the Best
Philipp

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        GitHub · Where software is built
Discussions of bugs and features can be posted here

I have been using a variety of Lindenmayer systems, implemented by me in a variety of programming languages, to compose pieces for Csound, over the past 30 some years.

These days, I use L-systems that I have implemented in C++, Python, and JavaScript.

One feature of some of my systems is that they use neo-Riemannian chord transformations and/or tonal scales to generate not only notes, but also harmonies.

The source code for systems that I currently maintain is here:

https://github.com/gogins/csound-ac

https://github.com/gogins/cloud-5

A few examples of music that I have composed using L-systems:

https://music.youtube.com/watch?v=Yw0TlYCm5no&si=Y8rAQx3fGyKHy1Jf

https://music.youtube.com/watch?v=XM65ZbEj8ng&si=98DA_MnBymDLqVQG

Source code for many of my pieces is here:

https://github.com/gogins/michael.gogins.studio

Regards,
Mike

Fun that you should ask… I was working on a midi-controllable Lsys generator in Csound today.
I have been using the,m in the past, but never got around to really making anything with them. I do include them in my digital composition class, though, and this year actually several of the students picked up the ideas. Then I thought I’d look once more for myself too :wink:
The midi controllable one is very much an odd attempt and needs much refining. I’ll share when it is presentable.

I attach two examples I have used in class that just shows a possible way to implement them in pure Csound. I use recursive instrument calls to produce each generation. That is a little bit messy, but perhaps you find it useful :wink:

Øyvind

fre. 21. feb. 2025 kl. 08:21 skrev Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie>:

Hello everybody!

I’m researching again a little bit on L-Systems / Lindenmayer Systems and i was wondering what your experiences with these are?
Espacially in Csound. May it Sound Generation, Sound Control oder Data creation.

I was using L-Systems via Common Lisp and i wanted to connect it a little deeper to Csound and i want to see whats it’s possible there.

All the Best
Philipp

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

1_lsys_simplest.csd (4.98 KB)

5_lsys_pitch_rhythm_chunks.csd (7.21 KB)

Mike -

I find your sounds and textures in “Poustinia Variation 5a” both beautiful and fascinating.

If they were made in Csound, I’d love to see their instrument design.

Art H.

Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

I’m glad you liked it!

The entire piece is defined in this one file, including the Csound orchestra:

https://github.com/gogins/michael.gogins.studio/blob/master/music/Poustinia/Poustinia-v5a.html.

The orchestra in this piece uses some of these “patches,” one per Csound instrument definition:

https://github.com/gogins/csound-ac/tree/master/patches

These patches are designed to be used according to this scheme:

https://github.com/gogins/csound-ac/blob/master/patches/modular_csound.pdf

In fact, all of my pieces for the past 20 or so years are available as open source on GitHub, mostly here:

https://github.com/gogins/michael.gogins.studio/tree/master/music

Best,
Mike

Absolutely loving - Poustinia Variations. Thanks for the links Michael - and for these beautiful compositions too!

Very nice pieces Mike! Thanks for sharing! Also for your source code!

I have been using a variety of Lindenmayer systems, implemented by me in a variety of programming languages, to compose pieces for Csound, over the past 30 some years.

These days, I use L-systems that I have implemented in C++, Python, and JavaScript.

One feature of some of my systems is that they use neo-Riemannian chord transformations and/or tonal scales to generate not only notes, but also harmonies.

The source code for systems that I currently maintain is here:

GitHub - gogins-dev/csound-ac: A C++ library for algorithmic composition, designed to be used with Csound, with both C++ and Python interfaces. · GitHub
GitHub - gogins/cloud-5: Complete browser-based computer music studio for algorithmic composition and live coding · GitHub

A few examples of music that I have composed using L-systems:

YouTube Music

YouTube Music

Source code for many of my pieces is here:

GitHub - gogins/michael.gogins.studio: Studio of Michael Gogins: computer music, photographs, writings. · GitHub

Regards,
Mike

Csound mailing list
Csound@listserv.heanet.ie

Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Fun that you should ask... I was working on a midi-controllable Lsys generator in Csound today.
I have been using the,m in the past, but never got around to really making anything with them. I do include them in my digital composition class, though, and this year actually several of the students picked up the ideas. Then I thought I'd look once more for myself too :wink:
The midi controllable one is very much an odd attempt and needs much refining. I'll share when it is presentable.

I attach two examples I have used in class that just shows a possible way to implement them in pure Csound. I use recursive instrument calls to produce each generation. That is a little bit messy, but perhaps you find it useful :wink:

Øyvind

Thanks Øyvind for your files!
I did not work that much with strings yet in Csound, so it was very interesting to see your approach. Did you find a solution for MIDI controlable LSYS?

Csound mailing list
Csound@listserv.heanet.ie

Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Hi,
Yes, here’s my current version. I use some samples for percussion sounds, and disabled those to enable the csd to run.
If you enter your own samples on line 80-84, and enable the sample player on line 442-450, it should work as it does here.
Mainly it is intended to work with midi in and out, so I do not use the synthesis in Csound for this one.

I haven’t written any proper documentation, so here is a brief rundown of what it does:
When you play a midi note, it will generate the LSYS from that base pitch. If you hold the note longer than the time it takes to generate all branches, it will start over, looping the tree again and again.
Also, if you play another note simultaneously, it will force the new branches to the symbol represented by the (absolute) interval between the notes. For example if you play a C, and while holding the C you play a C#, the interval is 1 semitone and all branches in new generations will be forced to use the symbol A. Similarly, it will use the symbol B for an interval of 2 (playing D as the second not in the example above).
You can set the melodic interval for each symbol in the GUI, and also the rules (a separate text box for each root symbol, e.g. in “rule A” you can set to generated symbols for A. Use capital letters here, and only letters A,B,C,D at the moment.
Each generation is output on a separate midi channel, and there is an option to create a percussion track from one of the generations (set in “perc_gen” in the GUI). The percussion track maps symbols to note numbers as set in “drum map” in the GUI.
Rhythm is calculated by dividing the available time into how many symbols it branches out to at each point. This way, some complex nested rhythms are generated. To my ears it sounds a bit like “instant Zappa” :wink:

Hope you find it of some use
Øyvind

fre. 14. mars 2025 kl. 20:30 skrev Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie>:

Fun that you should ask… I was working on a midi-controllable Lsys generator in Csound today.
I have been using the,m in the past, but never got around to really making anything with them. I do include them in my digital composition class, though, and this year actually several of the students picked up the ideas. Then I thought I’d look once more for myself too :wink:
The midi controllable one is very much an odd attempt and needs much refining. I’ll share when it is presentable.

I attach two examples I have used in class that just shows a possible way to implement them in pure Csound. I use recursive instrument calls to produce each generation. That is a little bit messy, but perhaps you find it useful :wink:

Øyvind

Thanks Øyvind for your files!
I did not work that much with strings yet in Csound, so it was very interesting to see your approach. Did you find a solution for MIDI controlable LSYS?

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

lsys_cs_midi_nosamples.csd (15.7 KB)

Thanks Øyvind a lot!

Super interesting concepts in using Csound that are totaly new for me!
It will take a while for me to get my head around this - but it’s super inspiring!

All the best,
Philipp