OscAlgoPi - algorithmic music for your home using an RPi

SuperCollider, Pure Data, ChucK, CSound, Nyquist, Overtone, TidalCycles, Bipscript, oh my

Moderators: khz, MattKingUSA

Post Reply
User avatar
oscillator
Established Member
Posts: 527
Joined: Sat Jan 17, 2015 6:07 pm
Location: SWEDEN
Has thanked: 54 times
Been thanked: 22 times
Contact:

OscAlgoPi - algorithmic music for your home using an RPi

Post by oscillator »

OscAlgoPi. I mafe this project last summer.The goal of this project is to create a stand alone box that plays algorithmic music using only the Raspberry Pi with good quality audio. The machine is controlled using a web interface. You can create additional styles using xml files.

OscAlgoPi demo video; https://youtu.be/pgdsWRK9E9M

Download code and build instructions: https://oscillator.se/opensource
MusE DAW running on Debian 10 Stable/XFCE4.
https://oscillator.se/musik
Basslint
Established Member
Posts: 875
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 65 times
Been thanked: 29 times

Re: OscAlgoPi - algorithmic music for your home using an RPi

Post by Basslint »

Sounds like it generates some very interesting grooves! :D Can you tell us more about its development?
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
User avatar
oscillator
Established Member
Posts: 527
Joined: Sat Jan 17, 2015 6:07 pm
Location: SWEDEN
Has thanked: 54 times
Been thanked: 22 times
Contact:

Re: OscAlgoPi - algorithmic music for your home using an RPi

Post by oscillator »

Basslint wrote: Fri Mar 19, 2021 3:59 pm Sounds like it generates some very interesting grooves! :D Can you tell us more about its development?
Sure!

I have an idea since many years, of a small black box that you connect to your stereo/hifi, and it just plays ever-changing music until eternity.

The first iteration was the MAMA (Machine for Ambient Music with Arduino). It is documented here if you want to build it! :) http://oscillator.se/arduino#MAMA

It is an Arduino connected to a GM synth shield. You just connected it to your stereo and it just a realtime clock, a motion sensor (is anyone in the room?) etc to create space music. I have since disassembled it but reused the code and GM shield in my Arduino radio (so I always have space music to listen to :) ).

I got hold of a couple of Raspberry Pi:s as a gift, and with that kind of jump in processing power I thought I would redo the project, hacking myu own algorithms. So I read up on different algorithms. I wanted to hack them together myself, to learn things from the ground up.
g_system.png
This is a description from the manual of all the systems (software) involved.

The main program, several 1000s lines of C++ code, is called OAP. It uses RtMidi to speak to fluidsynth which is running on the Pi too. fluidsynth uses ALSA to connect to audio out on the RPi.

I wanted to be able to interact with the algorithms so I reused an idea from my RPi internet radio player: The RPi also runs a web server so any device on the same Wifi can get an interface. To solve the communication between the web server and OAP I had to create an additional program that works with SIGnals. I like making device-independent solutions.

There are two hard-coded styles in the OAP: A Kraftwerk-inspired and a Drone-inspired.

The first is based on synced patterns and rules (probabilities = Markov chains) to move between patterns. But I can also permutate the patterns.

The second is more free form where different tracks are not synced -- thus creating multi track music that doesn't repeat (that often).

Finally I introduced the possibility to specify new musical styles (both synced and non-synced) using a simple XML format. So you can add your own styles without knowing C++.

Permutations are working on small building blocks, patterns of notes:
- swap places of notes
- keep notes but change their rhythm
- simplify patterns by removing notes
- "complexify" patterns by adding notes
- shift patterns in time
- transpose patterns (in a clever musical way)
- and go back to the original pattern

This, combined with the Markov chaining of patterns (different probabilities in how you move between patterns) was interesting and kept the result musical.

It became a huge project, I think it is something like 5000 lines of C++ code, but if was a great learning experience, both in algorithmic music and in creating a working system on a RPi.
You do not have the required permissions to view the files attached to this post.
MusE DAW running on Debian 10 Stable/XFCE4.
https://oscillator.se/musik
Post Reply