Robots generating endlessly new "music"

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Robots generating endlessly new "music"

Post by mmmPI »

Nois-e and Mus-e.jpg
Nois-e and Mus-e.jpg (281.39 KiB) Viewed 6493 times


They happen to play plucked string better than me. They can improvise "music" i think, i'm no expert on judging their performance, i have attempted to teach them to use proper notes, and the result got better than when i try to play. You can see their positronic brain has 2 hemisphere and is very similar, the only difference between them is a setting in the central part which gives them their unique melody. They can play years of different "music". They are inspired by Max from that story except for now they have received mixed feedback from neighbours.

There happen to be a Max-e that can play piano :



They are all taugth to play forever some progression. Here is a another version where they play a little faster and are restricted in the high pitch note in the progression , it shows different settings and sound a little different :




This is not proprietary technology, here are some plans of a simple brain before it is mounted into a robots and taught to do progression :



With a schematics :
simple brain.jpg
simple brain.jpg (219.86 KiB) Viewed 6493 times
And explanations :

This version "play" bass instrument, it doesn't do progression.
It can use more notes if the letter B is increased, less notes if B is decreased. Refined if B is made to change over time, like for a progression, that's part of the operation when placing the brain in a robot. The lower the B the lower the notes, if too low or too high notes aren't played.
If you change the letter L it start using different relation between notes, 12 for piano and 5 for most the others like bass or plucked string , even sawtooth or square sounded ok to my ears unlike other numbers but i don't know enough music to make more informed decision here. It is a fix setting per instrument/robot.
Reusing this other machine made ealier to make the beats player and the clock. There could be different rythm , there are plenty in the other thread, this one use kick in 2 times and shaker in 3 time and has a length of 384 notes. This is the hardcoded number (2^7)*3 = 384. used for progression in the robots.
There are only 3 speakers for notes but it is easy to add more by changing the note player when making a robot to have the proper number of hair.

To make the robot Picker Dollies is invaluable to organize the combinator by the operation they do, to make it look more like a real robot with 2 part of the brain and messy connexions everywhere, and the speaker as hair too , this is very important for the aeroacoustics. The smiley lamps are not really enough to make the music feel emotionnal but are necessary to know which robots is currently playing. This is important too, because those robots are delicate machine, once placed they can never stop, that's their form of life, and they are usually assembled in editor mode, where it can happen that the time is paused, and when resuming it, sometimes, it can become suddenly noticeable that several robots are in fact playing at the same time. The moment of the day when this occur seem to have the potential to strongly influence the perception of the quality of the music.


Any advice to improve the music or direction to learn how to would be welcome :)
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

Very cool! This could absolutely be improved with a little music theory.

Instead of random individual notes, the decision of "what to play next" could be chorus, pre-chorus, bridge, etc. Those divided into measures and bars, and those confined by scales and fills, and those by notes and chords that fit into the scale.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Wed Apr 03, 2024 4:05 pm Very cool! This could absolutely be improved with a little music theory.
Thank you ! i'm all ear even if it's more than a little ehehehe :D

I was wondering : Is this machine playing only using a single note on different octave ? or is it using more than 1 , I can't even tell.
adam_bise wrote: Wed Apr 03, 2024 4:05 pm Instead of random individual notes, the decision of "what to play next" could be chorus, pre-chorus, bridge, etc. Those divided into measures and bars, and those confined by scales and fills, and those by notes and chords that fit into the scale.
That's a lot of new words, even the name of the notes i only learned the french "do re mi fa sol la si do" which is of little use here x). I don't know the difference with a chord or a scale, chorus pre-chorus and bridge are also new words on my list of things to look up for now :D

I "understand" more from physic and math, the wavelength the frequency, the way each frequency is 1/2 1/4 1/8 ... how and why there are different black and white keys on the piano, the pythogoras history for western music and there are different way of spacing the notes that existed throughout history. That is very interesting in itself i found, but only very superficial knowledge from a few videos youtube watched late at night. It seem abstract when in factorio with the combinators. Rythm is more intuitive i found, i saw explanations about "euclidians rythms" that sounded cool, easier to for me to hear the math. When in factorio is sound easier to play with the combinator to make a clock and play with the timing.

I am very bad at detecting when i ear something which is note related , like which style of music uses which one how they work together, i listen to many different style of music,and to me it's always "music" aka nothing like the math and physic abstract thing. I have attempted to follow tutorial like " 5 different chord pattern for 5 different emotion". But my result sounded worse than when using random notes spaced by 5 or 12, so i suppose i made some mistake, this version is not ready, there was something with the piano, when using notes separated by 5 or 12 , sometimes it sounded more interesting, but other time it sounded worse, and i couldn't tell why.

I think i had more luck when attempting a version of the "brain" that can play notes while respecting measures and bars, The machine count up to 64 for the beat, and the robot uses different notes when it's beyond 32 or above 32, with a special case for 4 and 8 i found it sounded like a musician who do it on purpose when changing the settings. It uses the "Dem Bow" rythm, which will have some repetition with part of the instrument making the beat staying silent for a number of repetition repeating. Like after 8 plays the 9th play has the kick silent, the 10th play the snare silent, the 11th play the shaker silent or something like that which i did to make it less repetitive. The robots that play notes also uses this count to make some little "solo" sometimes to make variation on how the notes that are played fit into the measure and bars to add to the variation.


Brain attempting to play notes while respecting measures and bars on "Dem Bow" :



The previous version where i attempted such things was on the "shuffle rythm" , it's less complex :


It doesn't count how many time the beat has repeated to offer note playing variation, it's always placing them the same way on the rythm and using from the same selection of notes at the same time. I found it too repetitive but i'm posting it for science anyway. It's probably from such simple version that i would start over again using new rythm, it's easier than modifying a large version i found.
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

There is probably too much to cover, and I am by no means anywhere near a musician or composer. I would suggest enlisting chatGPT for an overall design plan.

It also depends on if you want to make random whole songs or just continuous random music.

If you want to make songs, I would imagine you would need to start with the time signature, like 3/4 or 4/4 so you can build the drums and rhythm. Then decide on the number of measures and what they are, like chorus etc. Then build the bars in each measure using a few scales within a typical scale progression.

A simpler approach would just be to choose a scale and play notes going up and down the scale with random fills using notes that exist in the scale.

I'm not certain how the pitch value in the programmable speaker maps to notes and octaves. I would imagine there are several octaves.

Good luck!
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

mmmPI wrote: Wed Apr 03, 2024 6:00 pm I am very bad at detecting when i ear something which is note related , like which style of music uses which one how they work together
For the most part, they are just chords and scales. You typically stay within a single chord or chord progression, and then use notes and scales that are built from the chord. That is really the basis of what "sounds like it goes together"
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Wed Apr 03, 2024 7:00 pm There is probably too much to cover, and I am by no means anywhere near a musician or composer. I would suggest enlisting chatGPT for an overall design plan.
You did a lot already !! I'd rather not use chatGPT, i don't like it. About music i lack knowledge, and the little i have i'm having to learn how to express it in english, not only the langage but the way music is discussed. It's not the same in acoustic like sound design / physic and music / musician or musicologist. That's a lot of context where i'm never sure about the wording for my notions.
adam_bise wrote: Wed Apr 03, 2024 7:00 pm It also depends on if you want to make random whole songs or just continuous random music.
I had no intent to have a finished thing when starting fiddling it is fun to do on its own :D But now maybe it's going toward a machine that takes a simple recognizable song that works well in factorio, and improvise an extended version , like this : https://www.youtube.com/watch?v=Hrph2EW9VjY where it can make variation on the beat every random number of measure and sync the melody being played or not , maybe also cut a piece and loop it, the animation is fitting for factorio too :)

The sequence is available here : https://onlinesequencer.net/3494172# I have imported it in factorio thanks to https://miditorio.com/ and experimenting with it.
Other candidate that i have tested with MIDItorio and knows works well with the sound available currently : https://www.youtube.com/watch?v=KO4y3nkJXDA
https://onlinesequencer.net/576137#
adam_bise wrote: Wed Apr 03, 2024 7:00 pm If you want to make songs, I would imagine you would need to start with the time signature, like 3/4 or 4/4 so you can build the drums and rhythm.
I didn't know the word signature, i think 3/4 and 4/4 are not exclusive, if the total number of time is a multiple of both 3 and 8, there can be a "shaker" or "hi hat" patterns or "cowbell" that does 1 2 3 1 2 3 and the beat 1 2 3 4 1 2 3 4, and it loop in 24 to be in sync. I'm not sure which one it is from the wikipage or if it is a success but i attempted rythm that sound like those :
is visual beat representation same as signature.jpg
is visual beat representation same as signature.jpg (166.04 KiB) Viewed 6300 times
Where a building is identical if the 16 (lamps) 1/16 of notes that it represent are identical = the same speaker at the same volume at the same position with the same sound.
I think it matters how many buildings are in between the tier 3 assembly. It is 1 2 1 2 1 in the rythm a and 1 3 or 6 in rythm b. Not sure though.

Rythm b example blueprint with centrifuge = chemical plant, not the most intricate rythm : the others are too big for the forum in one post, i need to try and compress them to fit into robots using the math rules from which they were built ( ie : a kick every 16 lamp) rather than the physical representation with the 16 lamps and the speaker copypasted 12 times.



This one is made of 576 lamps, 16 per buildings from the picture, and i used the substations wire to represent the separation in bars i think that's the proper name or maybe those are the smaller subdivision represented by belts. There is a 577th lamp not in the array with the others that turn green when the beat is playing next to the constant combinator to turn it on on the right side.

I think for generating random music as in robots, it will help to have the ability to trigger variation such as muting the kick during either the duration of the belts of the duration of a group of buildings. While using a special rule to choose notes, or to not play notes in sync. Maybe such things can also be used to try and make a robot that generate (random) extended mix version by counting such pattern to introduce variations.

adam_bise wrote: Wed Apr 03, 2024 7:00 pm Then decide on the number of measures and what they are, like chorus etc. Then build the bars in each measure using a few scales within a typical scale progression.
So after a few search to understand the wording, i can say that the robot will/should decide when to do chorus pre-chorus or bridges, but also drop and solo. The structure of the random music. I don't want to try and compose a song, more like trying to program some rules to make it surprising. It should know what is those and alternate in a random but sensible pattern, like pre-chorus always before chorus, but sometimes 1 or 2 or 3 chorus, with a variation on the instrument being silent, either random melody, or a real one from talented human artist , i think that is more a wannabe dj robot then, it would know how to do transitions as they say for techno.
adam_bise wrote: Wed Apr 03, 2024 7:00 pm A simpler approach would just be to choose a scale and play notes going up and down the scale with random fills using notes that exist in the scale.
I'm not certain how the pitch value in the programmable speaker maps to notes and octaves. I would imagine there are several octaves.
Good luck!
Scale also is a new word in this context, but i am familiar with its translation, what it means, but i have never used scale in my life. I know it's not just playing each note next to each other and why. But to me it would be simpler if there was the frequency written on the key so i know if i'm going for a higher or a lower tone, and by which amount, like the ratios. Whereas i have no idea what D4 is compared to C3.

For the piano there are 48 notes available using signals from 1 to 48 whereas for the other instruments like plucked string it's only 35. I suppose one is chromatic and the other pentatonic but i just saw those words on wikipedia. I think that's why when using 12 and 5 as spacing in notes it didn't sound as bad as with other number. It only play the same note on different octave i think is the proper wording. Whereas if i wanted to play several notes at the same time, not the same from a different octave, it would require that the two notes have harmonic ratio of frequency, such as 440 Hz and 220 hz and 110 Hz. That's my understanding more from physics, as when you ask a musician, they tell you about their instrument, the different style they like and how they play it, the rythm. And i have no idea how to achieve that in factorio yet x).
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

OK time signature is just beats per measure like 1-2-3, 1-2-3 or 1-2-3-4, 1-2-3-4. Sorry I thought measures were groups of bars, but when I confirmed on google, they are the same thing.
You could have a high hat playing on each beat 1-2-3-4,1-2-3-4, and a bass drum playing the first beat 1-x-x-x,1-x-x-x and a snare playing the third beat x-x-3-x.

If you were going to play a measure in the key of C then look at the C chord, it is C, E, G. You could play c-c-e-g, g-c-e-c, a-a-f-c Why choose A and F in this? They are part of the C scale. C E G are the chord notes, C being the root note. The C scale is C, D, E, F, G, A, B

You can do a whole plethora of things, like dividing a single note into 2 fast notes, or skipping a note, going up and down octaves, or long playing a note and stop playing it on the next note, playing 2 or more notes in a chord at the same time, etc. For you, since you seem to have 2 "members of a band" They should at least both be playing the same time signature and keys that work well together. Remember you can use chords and scales to determine what sounds well together.

Point is, you could program your device to decide "I am going to play 4 4/4 measures in the key of C" and then just pick out different notes in the C scale using a 1-2-3-4 pattern while tending to end each measure on C, E, or G

Then, to go forward to the next 4 measures, you could look up C chord progressions. like C-F-G. And so play 12 measures, 4 in C key, 4 in F key, and 4 in G key. And then perhaps a final measure back in the C key.

Chorus and bridge are terms to describe large parts of the overall composure. A chorus is typically a set of measures that is repeated a few times throughout a song. Your machine could perhaps build 4-12 measures and flag it as a chorus, and then play it a few times during a song. A bridge is more complicated, if you were transitioning between 2 incompatible keys, you could bridge them with measures that are compatible with both keys. At least that is the way I understand it.

Hope it helps.
Last edited by adam_bise on Thu Apr 04, 2024 2:57 pm, edited 11 times in total.
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

I am unfamiliar with what the pitch value is in the speaker. You could probably work it out by pulling up a virtual online piano and seeing what tone corresponds to what pitch value in the speaker.
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

mmmPI wrote: Thu Apr 04, 2024 11:44 am Whereas i have no idea what D4 is compared to C3.
D is the key D, there are many octaves of it. On a piano, D4 is D in the 4th octave, and C3 is C in the 3rd octave. C3 would be lower in pitch than C4.

You mentioned you are familiar with Do Re Mi Fa So La Ti Do, This is C, D, E, F, G, A, B, and C again at a higher octave.
mmmPI wrote: Thu Apr 04, 2024 11:44 am Scale also is a new word in this context
Scale is just a series of notes relating to a root note. These notes almost always sound well together. There is no wrong order to play them in. They don't have to be in order, but they typically do generally go up and down.

Like the scale of E Minor, is E F# G A B C D. You could boringly just go up and down the scale, or jump around a bit like E, E, G, A, F#, D, E
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Thu Apr 04, 2024 1:49 pm OK time signature is just beats per measure like 1-2-3, 1-2-3 or 1-2-3-4, 1-2-3-4. Sorry I thought measures were groups of bars, but when I confirmed on google, they are the same thing.
You could have a high hat playing on each beat 1-2-3-4,1-2-3-4, and a bass drum playing the first beat 1-x-x-x,1-x-x-x and a snare playing the third beat x-x-3-x.
I used the term beats to tell when there is a sound, but not properly it seems maybe i can try again. In factorio, if you want to play short note, or slightly off beat, you need to account for it too. So you go 1 2 3 1 2 3 1 2 3 but then if you want to put something in between 1 and 2 so that it complete the sound played in 1 you need to have the subdivision already accounted for.

So when i think of signature, for 1 2 3 1 2 3 , if considering the possibility to play note that are as short as 1/16th of a measure, it needs to be at least 16*3 lamps. or "moment" so 48.

But then when i have 48 lamps, i can put a kick in lamp 0 16 and 32, this way i will sound like 1 2 3 1 2 3. with 1 beat per measure [x-x-3]. And still use a hi hat every 12 lamps, 0, 12, 24, 36 this way it will sound like 1 2 3 4 1 2 3 4, [x-x-x-4].

123 123 123 123 = length 12
1234 1234 1234 = length 12

I saw on videos for drums pattern that it is used in certain style of music, or even more complicated mixing of signature. It's easy to program sort of, compared to playing it i suppose, and remembering the complex pattern.

Then you could have robot being silent for 1234 following 1 way of counting and the other silent for 123 of the other of counting. There are different combo that can occur and it's possible to tell them to play different note because they know which combo is currently happening by counting how many times they have synced together and doing modulo operation. I mean that's one way i tried to make them sound like they have creativity.

adam_bise wrote: Thu Apr 04, 2024 1:49 pm If you were going to play a measure in the key of C then look at the C chord, it is C, E, G. You could play c-c-e-g, g-c-e-c, a-a-f-c Why choose A and F in this? They are part of the C scale. C E G are the chord notes, C being the root note. The C scale is C, D, E, F, G, A, B
That make sense, it was not easy, Why A and F are part of the C scale ? :D i'm joking, i had to watch lots of videos for explanations, they are long, and still it's not clear why some are root note and why this amount of division for notes. From the standpoint of being curious rather than willing to do good music, it seem like an arbitrary limitation, a convention that frame things in a style,having to do with the existing division of frequency in interval like notes. Ignoring/not knowing the rule of the scale sound bad i can tell sometimes more than others but when you can tune the frequency of the sound yourself, i think like in violin, you could play frequency that are in between note. I think improvising robots could show "creativity" here because they may "decide" to do 9 or 10 or 12 or 20 division in an octave worth of frequency and sound "new". But as i understand it's not possible in factorio.
adam_bise wrote: Thu Apr 04, 2024 1:49 pm You can do a whole plethora of things, like dividing a single note into 2 fast notes, or skipping a note, going up and down octaves, or long playing a note and stop playing it on the next note, playing 2 or more notes in a chord at the same time, etc. For you, since you seem to have 2 "members of a band" They should at least both be playing the same time signature and keys that work well together. Remember you can use chords and scales to determine what sounds well together.
ohh not so fast x) each of those as to be made in combinators ! Dividing the note into fast note and even faster note that's math at the beginning in choosing the number of lamps.
Going up and down octaves will require me to find a way to generate random numbers that are also the spacing between 2 notes from the same scale. Which will be made easier knowing which that C is a key a chord a note and a scale and looking up the reference. For now, i realize the robots using 5 spacing are playing notes : A2 D3 G3 C4 F4 A#4 D#5.

That correspond to the 5th 10 15 20 25 30 and 35th note in the list for sawtooth (not piano). This probably also means that the robots are playing bad notes when playing high pitch, because A#4 and D#5 are not in the same scale as the other notes they happen to be allowed to play. And also that they should instead use E and B notes. And they don't have to only use A2 they could also use A3 if that exist. It's the same note just 1 octave shifted.

adam_bise wrote: Thu Apr 04, 2024 1:49 pm Point is, you could program your device to decide "I am going to play 4 4/4 measures in the key of C" and then just pick out different notes in the C scale using a 1-2-3-4 pattern while tending to end each measure on C, E, or G

Then, to go forward to the next 4 measures, you could look up C chord progressions. like C-F-G. And so play 12 measures, 4 in C key, 4 in F key, and 4 in G key. And then perhaps a final measure back in the C key.

Hope it helps.
That's roughly what it was heading towards but not knowing why, it make more sense now. That sound like a lot of work x). But it will allow me to program the robot to extend the melody from the techno sample using notes randomly pick amongst a proper list. Or maybe to change just 1 note from the original melody after 8 repetition, then another note from the melody, and keep doing it randomly replacing 1 note by another. Not sure it will sound good x)

I didn't know you could change key inside the same song, i thought robots would be forced to use only 1 x) I see it can be done if changing after 4 measure. I realize i used the word progression improperly too. I think all this information need to be assembled into a robot that play piano so that it would sound like what people are used to when they hear pianist repeating or warming up.

It does help i think, i'm not sure my neighbour would share that view, it's giving me fuel for continuing experiments x)
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Thu Apr 04, 2024 3:03 pm D is the key D, there are many octaves of it. On a piano, D4 is D in the 4th octave, and C3 is C in the 3rd octave. C3 would be lower in pitch than C4.

You mentioned you are familiar with Do Re Mi Fa So La Ti Do, This is C, D, E, F, G, A, B, and C again at a higher octave.
In france, kids at school or at least me when i was, learned do ré mi fa sol la si do with the flute instrument at the age of 12 in the weekly 1 hour class of music. It was not something i imagined could be different for the describing same music until this week, and i'm 30 + yo. It is even more surprising to see than english speaker would use it for serious music :D. It will always sound like the childish way to call the notes for me, before i learned where it come from, like today and things like octave and minor or #.

adam_bise wrote: Thu Apr 04, 2024 3:03 pm Scale is just a series of notes relating to a root note. These notes almost always sound well together. There is no wrong order to play them in. They don't have to be in order, but they typically do generally go up and down.

Like the scale of E Minor, is E F# G A B C D. You could boringly just go up and down the scale, or jump around a bit like E, E, G, A, F#, D, E
I see, i hope this will help giving some feeling to a music, if i try to make a robot to mimic a certain style, the amount of jump or their timing may be helpful tool. So much to learn x)
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Thu Apr 04, 2024 1:49 pm If you were going to play a measure in the key of C then look at the C chord, it is C, E, G. You could play c-c-e-g, g-c-e-c, a-a-f-c Why choose A and F in this? They are part of the C scale. C E G are the chord notes, C being the root note. The C scale is C, D, E, F, G, A, B
Attempted to follow instructions, made a machine, calling it APP, very original name, stand for Autotuned Piano Player, robotic laugh ...
Autotuned Piano Plaver V1.jpg
Autotuned Piano Plaver V1.jpg (229.59 KiB) Viewed 6106 times



Will play only using C D E F G A B by keeping in memory a value that represent the middle of the keyboard (24 for piano) thanks to the power of modulo math . Then using random number generator will have 50% chance of going up and 50% chance of going down tones. If the note is not in the scale, mentionned, it will instead pick the note 1 tone higher that is in the scale.

There are 5 different "phases" that one can edit, by default phase one allow variation of 1 tone up or down every new note, the second phase, will play 1 note higher when going higher but 2 note lower when going lower, which leads to overall playing lower and lower, and it reset to the middle of the keyboard when it reaches the non existent keys too low. Next phase is the same but going up, and following phase are more jumpy, it goes 2 note up and 2 note down, and then last phase is 2 note up 3 note down. Those value can be changed easily to change the mood the robot can be in.

When the robot is not playing it keep thinking of its next play and loop around the different phases much faster but silently, showing with lamps what will be its mood when restarting.

My favourite phase is when neutral, the randomness is chaotic enough that it will go up and down anyway, just slower. I like repetitive sound.

It will also play following the beat, and sometimes add some notes ( play more notes in a single measure) to its pattern to make it more dramatic on purpose but rarely and not randomly. I wanted to make it sound like it is excited sometimes and fill in the gaps in the repeating note pattern.

It doesn't sound like "melody", unlike when attempting to follow more litterally the instruction, without randomness , i made something that sounded so repetitive with some modded sound, it felt like dangerous, it went like : FAGA CCEG GCEC AAFC CDEF CEFG FAGA CCEG GCEC AAFC CDEF ECFG, there's 12 of them, with a kick every 2 notes and a hi hat when no kick and only 2 note differ in between the two repetition, i think the tempo doesn't matter, it would have been obnoxious no matter, unlike melody made by professionnal, i can hear for hours repeating this one maybe it was the unproper division in measure or something, but it sounded terrible. And i could think of something in my head that would sound better, but when attempting to make it i couldn't, like trying a letter, and another, with spacing, and things but it never sounded like what i was trying to achieve.

That's when i started to think of the "auto-tune", to automate the process i was doing, looking up some which letters i was allowed to pick, counting the spacing in between signals and making rules that looked like this :
rulefornote.png
rulefornote.png (95.52 KiB) Viewed 6106 times
On the left are the note allowed in the scale, thanks for that receipe for melody x), the left column in the group of 2 in the middle, represent the number to send in circuit network to trigger the first note of that key listed in the speaker list, other column is the next number. This means the list of note in the speaker start with A (0) being the index, and then there is a note not in the scale (1) and then there is B (2) then C (3) then another note not in the scale (4) and so on
The number not in the scale are the "bad note" that will be autotuned if the robot ever try to play them.
One thing that is striking is that from the first to the second column it's always +12.

The "keyboard" for piano in game is composed of 84 notes, which is a multiple of 12 , so note 74 for example, it is possible to know which one it is doing modulo 12 operation, it will result in 2, this means it is a "B" it can be played by the robot. Whereas 73 modulo 12 result in 1, this is one of the "bad note", the robot will add 1 and count 73 as a 74. It would be more complicated but not impossible if adding 1 didn't work everytime to correct the note.

It may not be a proper autotuning, to my ear it sound sometimes not good when doing large jumps, and they are not delicate, it's not completly random, it will not make large jump, but it can go from any letter to any other letter, which may not be the proper use of the scale either. The rythm is quite basic, and not changing this time, i think it would require 2 robots, or a robot with to have both interesting and varying rythm and notes pattern.

I think i added some boundary on the notes too, to avoid playing note 83 82 83 82 83 82 in case the robot pitch would be around those value from a phase with variation, during the whole neutral phase, it reset when going to far away from the middle of the keyboard way before reaching non existing number. Those could/should be made dynamic along with the choice of the pitch for the note i suppose for a more classic approach.

Here is a blueprint of the "brain" of this robot with maybe slightly different settings regarding the relation between boundaries for notes and type of progression, once the tetris process to make it a robot with the picker dolly mod start, i don't try to change the settings it's too intricated, instead, i let the "tuned" robot play :).


schematics.jpg
schematics.jpg (153.99 KiB) Viewed 6106 times
  • 1) Clock
Set the tempo and "signature" here; each tick "T" is added to the counter, such counter is divided by "B" to give "M" which will be used to keep track of the moment in the measure. "M" is when a sound is played, it can go as high as the number that "B" is multiplied with. (64) means count from 0 to 63 and repeat.
  • 2) Speaker manager
Takes "M" and uses modulo operation to trigger speakers repeatdly when possible, sometimes 1 speaker is still playing previous sound. Repetitive sound are the beats, this place also tell when notes are allowed to be played.
  • 3) Speakers for beat
They will ring at fix interval based on the count of "M" or its modulo version, all 1 tick offset to avoid calling when M=0 for robots that can go to sleep. ( may need additionnal delay to sync with other speakers ).
  • 4) Speaker for Piano regular pattern
They will always be called no matter what, at periodic interval, they receive the note to play from part 10 and timing from part 2
  • 5)repetition counter
This part are memory cell that count how many time "M" has reached its value of 64 this is used both for additionnal speaker breaking the pattern sometimes, and for the "phase" progression of ascending and descending or neutral in the scale of the notes.
  • 6)Additionnal speakers for "improvisation"
Those follow weird rules, namely considering the previous memory cells, one count 0 1 2 3 4 and reset, the other same up to 6, and when the sum of both ( which can't exceed 10)s is either 2 5 or 8, then an addittionnal speaker will play a note during the moment 28 out of 32 for the notes, meaning it will play twice before M is increased by 1 because notes repeat their pattern twice when M goes from 0 to 64.
  • 7) phase counter
Reading from the memory cell in 5 that can count up to 100, it will divide it by 20 to make 5 different "phases" where the junction is. When the robot playing is in a different phase, one of constant combinator is read, and the value U or D that it containst are active for part 8, it tellss how many notes it can jump from one to the next.
  • 8)random walk sumation
This part takes a random number from part 9 and check wether or not it is a positive number or not, and will then add or remove the amount of note received from the phase counter that gives instruction on how to play the following note. (the "R" signal)
  • 9) RNG
This generate random numbers from a seed in the constant combinator every tick. When the constant is removed or turned off it keep doing it forever. Two robots with same seed will play exactly the same, not with different seed, turning off the constant in a robot sync with another one will make lose sync.
  • 10)note memory
This part make the pitch for note start in the middle of the keyboard ( or rather "24" ) and then every time a note needs to be played, it adds the result from the random walk and keep the new value in a combinator that is reset if the number gets too high or too low.
From math/circuit it actually start at "0" and store positive or negative number and then add 24 to (R) . and reset when sum would exceed 48 or be lower than 0.
  • 11)autotune
One combinator located in part 2 does a modulo 12 operation on the note that would have been played if there wasn't the autotune, and if it's a "bad note" meaning it leaves a remainder thar is either 1 4 6 9 or 11, it triggers the decider combinator to add 1 in the "R" signal. The signal "R" is delayed by 2 dummy combinator so this is happening before the speaker could receive the not autotuned note.

Combintors not in boxes are either dummy for delay or signal isolation i think.

It's not the most pleasing to hear of the robots for me, maybe beause my ears are not delicate i still prefer the duo that play random notes all the time x), then the brain that does impro on plucked string, and only last this robot. I found the way it does chord progression is still not very good, it's not repeating enough for it to be a melody ,and it's not random enough for it to trigger the positive vibes i found in the early robot.

But it can be turned on/off, and configured a little, the "music" is ok for me when the variation are set to neutral most of the time and the note are not high pitch.

Maybe i should try to make robot that follow a particular style, so i wouldn't have to judge the result on my poor taste and music ability but on the ressemblance with the original thing. And when trying to make things that sound good, i would not always follow the rules i'd be learning and applying to make some robot following a style. I want to make a techno-bot but they all sound awfull for now. A duo with an instrument with note and a rythm player would allow to do modification on one or the other part of the "duo" over successive iteration. Maybe an orchestra :D
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

Instrument Overload.jpg
Instrument Overload.jpg (241.36 KiB) Viewed 6019 times


Beware before adopting such robot, unlike kid's noisy toy this one will not run out of battery, it will share the power grid of your base forever. There is an on/off button on the forehead next to the lamp, but it has never been used, according to very serious statistics, every single adopter of a an I/O model is to this day still presently dancing with no sign of stopping anytime in the foreseable future.

Instrument Overload, (I/O for the fans) will provide original, if not entertaining or even appreciated music for small , medium and large base thanks to its ability to use global playback on all 6 instruments ! Obviously the more instruments the better, and the more notes too, as such all instruments were made to play many notes most of the time. It's not quite clear how to add even more instruments and still hear them all. Maybe if they were not all playing at the same time. One recommanded way to appreciate fully the music is to listen to it from another room, with thick wall. It can also be used as a scarecrow or you can leave it playing at your house to make it sound like a group of children are learning how to use a synthetizer. Loud enough it has dust cleaning property if the kick is strong enough in small area. Played in a farm, or in a garage the equalizer would require more kick but it is already at the max level. It is not recommended near animals anyway.

If you are wondering because you never heard something like that before, sorry, those are steel drums with a different pitch every time, when it gets high it sound like someone damaging a piano, but no piano were injured during the making of the robot and no piano is used, nor plucked string. I never heard of those before but they sound funny with the "autotune" so i wanted to use them, and also the bass with a lower pitch because i've seen that in tutorial video "how to make techno for noob". It still chooses some random notes with 1 octave difference for some instruments, like the bass and the lead too. It doesn't sound like techno, don't get baited, i only followed half of the tutorial for the head banging part and even that ... some sounds are easier to reproduce or more similar in factorio than others and not all effects are possible.

The hair are speakers, those using the signal R are higher pitch than those using the signal X by 12 signals, it doesn't sound like it because the celesta is still very high pitch, that's why it's low volume. You could do that to the vibraphone to soften a bit the robot's voice, if you have a big soundsystem or good headset too, it's even advised.

The constant combinator located under each tooth are containing settings of U and D which can be changed tp influence the play style of the robot. my favourite settings with this robot are U2 D-2 or U7 D-1 for the note variation pattern or the blank signal for U and D too with only 1 note and no variation it sound the most like a bridge for techno music i think it's the term, or progressive, maybe it's because it's relaxing after the others. The left most constant , the extra tooth is used to lock the robot in manual mode, and only the left most tooth will be used as pattern.


It's not the best, but it made me realize mistakes of conception in previous model like off by one errors ,and helps for future model.
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

Wow that is quite a contraption!

Heres a couple ideas to avoid overly random notes. Music is often repetitive. If you could then perhaps remember some measures. Then this would be your chorus. For the rest, you can try increment, decrement, and reverse.

Keep in mind I have never attempted anything like this.

C Magor is a large scale that you have been using. Notice, it is every note. BTW we leave out "major" typically unless it is minor, then we say minor.

First Measure generation 4/4 C Major: Try random C D E F G A B. Let's say 4 measures. 4/4 time is common enough that you could just stick with that.

Select from the scale 4 notes, apply a 50% chance to set the root note to the 1st note, then another 50% chance to set the root note as the last note. Since this is the first measure, we force the first note to be the root note.

C G B C

2nd measure generation: Choice of 50% random (above rules) 25% repeat, 25% mod {33%increment, 33%decrement, or 33%reverse} Let's say repeat wins this measure

C G B C - C G B C

3rd measure, same as above. This time increment wins.

C G B C - C G B C - D A C B -

4th measure: 50% repeat 50% mod. Force last note to be the root note. - Repeat wins

C G B C - C G B C - D A C B - D A C C

let's remember these 4 measures as the chorus.

Now let's generate 12 more measures, using the above rules, and then decide how to play them.

Let's say we decided to play the following, which could also be randomized.

4 measures in C, Chorus, 4 measures in E, Chorus, 4 measures in G

Finally, pick a note from C scale that will become your next root note, and start over in that key making a new chorus and using the new keys scale.

Not quite sure how you could handle octaves, though. You don't want to stay in the same octave the whole time or the whole thing will sound flat.

Perhaps randomly select starting octave or start at 4th octave, then each note is typically 4th octave with chance to be higher or lower and much smaller chance to be 2 octaves higher or lower. You may want to allow 2nd, 3rd, and 4th measures to also shift octaves.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Sun Apr 07, 2024 9:09 pm Wow that is quite a contraption!
Thank you, some time was spent to make it look cooler than it really is x). The robotification process allow to hide in the mess the fact that each part of the "brain" is not super optimal in terms of combinators. The second one is similar to the first one with just more instruments and different rythm. The difference in octave is just a difference of 12 in the signal called for the note, and sometimes it gives a negative number for some instruments so they don't play.
adam_bise wrote: Sun Apr 07, 2024 9:09 pm Heres a couple ideas to avoid overly random notes. Music is often repetitive. If you could then perhaps remember some measures. Then this would be your chorus. For the rest, you can try increment, decrement, and reverse. Keep in mind I have never attempted anything like this.
Thanks ! I have never attempted anything like this either, i noticed as kid, grown up were always happy to let me play piano when i asked, until they realized i was just enjoying the noise it made and didn't know how to play. But no-one's gonna tell me to go play outside now hehehe. It was pretty much the same when i first attempted to do some mixing at age 14 or so :D Much worse restrospectively than just recorded tape from the radio ! I learned a bit about sound design at university but in relation with documentaries like radio or cinema not music some things still apply but others i'm completly ignorant. "how music is made (by musicians) ?" is not the same as "how (do i) make music ?" Never really asked myself the second , more the first.
adam_bise wrote: Sun Apr 07, 2024 9:09 pm C Magor is a large scale that you have been using. Notice, it is every note. BTW we leave out "major" typically unless it is minor, then we say minor.
Yes, i have been searching other scales on the internet to see what i could do to change my horrible melody, i found on guitar/bass website they use the same letters which makes it easier for me to understand than with the partition with black dots in lines for piano that i have forgotten how to read. But then many scales have say "#" or "bemol" i think , the # is also in factorio, but not the "bemol". In techno video tutorial they said to use the F phrygian scale for a particular example, with an explanation and demonstration of the how and why it is different than the major scale that's when i realized. It made it more obvious to me what a scale is or could be than the example containing all the notes. I tried to look at the rick roll chord progression as midi sequence are available online just to make sure , no robots can accidentally rickroll i think, due to them not being allowed to play the same notes with bemol , but they may play some part of other melody recognizable due to my ignorance of them and randomness. In the end i decided to stick an easy one for now, unless i'd try to replicate a certain style and it could help adapating the tonalities.
adam_bise wrote: Sun Apr 07, 2024 9:09 pm First Measure generation 4/4 C Major: Try random C D E F G A B. Let's say 4 measures. 4/4 time is common enough that you could just stick with that.
[...]
Perhaps randomly select starting octave or start at 4th octave, then each note is typically 4th octave with chance to be higher or lower and much smaller chance to be 2 octaves higher or lower. You may want to allow 2nd, 3rd, and 4th measures to also shift octaves.
Woa thanks a lot for those inputs ! It makes it more straightforward to start trying to implement with the combinators. I have reworked a bit the different parts and i have a version where it has 4 differents memory cell , one for each note in a measure that are stored in a single combinator as 4 different signals but it act as 4 different counter that have no knowledge of the state of the counters. So it may end up that 1 is very high pitch (45) and the other very low (12). Considering 1 octave per measure would change this as counters wouldn't have to keep track of it. They would only have to keep a number from 0 to 11 in magnitude. And octave be applied later( math is [input note between 0 and 11]+[octave number]*[12] 12 being the number of notes between say F3 and F4 in all instrument i think),

It's tricky then to keep track of when the progression would go for A B => C, as this would mean a change in octave for a smooth progression but if the octave is set for the measure it's going to play A3 B3 C3 instead of A3 B3 C4 or C2 not sure x).

I can make for now the measure either repeat or change randomly but i'm still not sure how to implement keeping track of what is chorus, it need not just reworking some parts but adding a new module to manage those. There is a 5th memory cell to remember 1 measure, and it would require maybe another one or two so the robot would also store the reverse sequence, maybe it should just have some speakers that activate in reverse sometimes instead of storing the reverse sequence and randomly playing it.

It's harder to do 33% reverse / incremement/ decrement than doing 50% reverse, 25% increment 25% decrement i think. I will try to go the later easier version to begin with.

I'm tempted to overengineer things so it would keep track of many measure and repeat them in some pattern, and wonder things like, "how much time the chorus should be remembered without any variation by the robots", "should there be a setting ?" and such x). Maybe it would be more productive to try and adapt more the rythm and the notes to work together for bridges and chorus with slightly different beat or have some measure with and without speaker play bass at low volume some long notes. Those would need to fit with brides or prebridges, or "drop" in techno music :)

I'll try a bit of both and see what gives the more results anyway !
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

mmmPI wrote: Mon Apr 08, 2024 12:12 pm It's tricky then to keep track of when the progression would go for A B => C
I would say by default the closest note. Like B3 to C4 since C4 is closer to B3 than C3. But would still apply octave shift chance on each note, shift from default.
mmmPI wrote: Mon Apr 08, 2024 12:12 pm how much time the chorus should be remembered without any variation by the robots
Not sure. It probably depends on the style of music. It would need to be played at least twice, otherwise there is no point remembering it and you lose that effect. It is probably one of those things that you would want to try out and tweak.

I can't even imagine the combinator black magic all of this would take lol

Oh yea, you should give your robots a mohawk or earrings. Check out this actual robot band! https://www.youtube.com/watch?v=TaY7vohLXK4
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Tue Apr 09, 2024 2:54 pm I would say by default the closest note. Like B3 to C4 since C4 is closer to B3 than C3. But would still apply octave shift chance on each note, shift from default.
I think i solved this problem by changing the way the memory cell work. Instead of storing 4 random notes independant from each others that could themselves be on very different octave making it difficult to apply a change to the whole measure. I started to restrict the interval of each note to try and have them be on the same octave, it didn't really work, it ended up making the same notes too often. But it gave me the idea to store only 1 note, the first one, and then the other 3 numbers would be the amount of variation to apply to the first note.

Instead of storing 4 number from 0 to 45 say , [12 , 33, 27, 41] which would each be the number to call for a note, it instead does something that is to be understood as [ 12, +4 , -6, +3] which will be "decoded into [ 12, 16, 6, 15 ] and those be used as number to call for a note.
This make sure it is possible to control the interval for notes in the melody to control where notes are higher or lower pitch ( low high low high) ( low low high high) ( highest high medium low). I think it's like a scale on the scale or something ^^.

adam_bise wrote: Tue Apr 09, 2024 2:54 pm Not sure. It probably depends on the style of music. It would need to be played at least twice, otherwise there is no point remembering it and you lose that effect. It is probably one of those things that you would want to try out and tweak.

I can't even imagine the combinator black magic all of this would take lol
I can share the experiments and try to explain it's a lot, but it's also for me, for later in case i stop doing and want to restart i'd be lost otherwise x) :



This one Pianist "brain" A , is a version that store 4 different note on different counter, so not the best on this. To play pause use the top left constant combinator, it was also an experiment on possibility to dynamically adjust the number of kicks when the tempo is set to high or low. Changing T will make the machine play faster or slower, and depending on the number choosen from like 60 to 290 or so supposedly the lamps would "skip" or "add" kicks to avoid the bpm being too high but sometimes it fails playing some notes because the memory cells are working on the "M" signal for the measure to detect a repeat, and this is a mistake, the "M" signal is not a real clock signal, sometimes it stays on for more than just 1 pulse. i have to rework this part.
It has some hardcoded speaker, to play the sequence in reverse, and with some note inversion and a section with 2 missing notes. It's cheating, it was to test the music resulting to know what sound good to know how to make the next machine.

The other setting are U for update and F for frequency: The note are changing at the F number, and everytime the U number is reached a counter of green signal is incremented.
F need to be 16 32 48 64 for the note change to occur after 4 or 8 or 12 or 16 notes (1/4). Putting another number will make the sound irregular not looping.
The green signal counter associated with "U" is used to know when to use lower octave by subtracting 12 on a memory cell that unfortunaly fails to register the notes half of the time at high speed tempo.

This makes the machine "remember" a set of notes for the duration of "F" ticks. If F is set to higher than "U", the opposite of the blueprint, like U=128 and F=1024, then it means the note will change only after 8 green signal counter increment. It is then possible to hear a melody, once, then with 2 notes shifted 1 octave up and then the same by the other 2 notes shifted 1 octave down.

It is not exactly what the plan was , but part of the experiment are not the circuitry but also what sound good :D


And this second "brain" B also a Pianist :


This one stores 1 main note at first and 3 different variation level of this notes, the most recent developments. With different types of memory cell all showing some sort of failures which can't be heard because it's playing one that didn't fail, but it doesn't allow for as good control over the measure as i wished, ideally it would store an array of different measures say like 10 give them name A B C D ... and play them as chorus prebriges verses and so on based on the number of "pink" signal maybe , that was the idea.

Both work by taking the same random number and reading the different bit. Considering the number in binary as 0100 1000 1110 .... the left most bit represent the sign in factorio so this number no matter the other bits at the end will be positive because it start with 0. If we do a bitwise shift left ( operation << in arithmetic), then it becomes 1001 0001 110... All the bits are shifted left. Such number is negative, because it start with a 1, if we shift again, the number will be positive, and again, then negative , then positive 3 time, then negative 3 time.

So when the "F" count is reached, a random number is selected. The first bit is read to add or remove U and D stored in the constant combinator for the first main note. If the note was 24, it can become 22 or 26 which eventually may become 23 or 27 before being played if 22 or 26 happened to not be in the C scale choosen for the robot. It will try to be at the value "M" with a maximum of M+H and a minimum of M+L (24 +/- 5 in the example).

The second bit is used by the second note, to add U for Up or remove D for down. This will store a number between the Low (L) and the High (H). The second note has preset of 2 for H and -12 for low, this means the counter can go from -12 to 2 as range , exceeding it will reset to 0 meaning no variation between second note and first note of the measure. Otherwise the second note can be 12 or 11 or 10 notes lower than the first, up to a maximum of 2 tone higher, but that will rare.

The third and fourth note works the same using the 3rd and 4rth bit of the number, but they are set to different preset, 18H and -2L, making them higher pitch than the first two, for a melody than will usually sound like (NoteX) , (LowerthanX), (HigherthanX) (HigherthanX).

The only black magic in there is the "autotune", err i mean the black and gray signal, they are used because i couldn't use the signal [2] and [4] for both the 2nd and 4rth note of the measure AND also having the signal [2] and [4] be used to store the value of the "bad notes". The signal list has notes not in the scale in position 2 and 4, so the value "2" and the value "4" needed to be stored somewhere. That's a difference between the autotune for the first note, which uses [2]=2 and [4)=4 and [6]=6 [9]=9 and =11 to store the notes that should be corrected if their remainder modulo 12 is one of those number.

The beats on this one are nasty, i wouldn't recommend playing it faster otherwise the beat skipping part allows for faster development while preserving ears, because i can test/hear how the logic reset and sound faster.

brain b.png
brain b.png (294.54 KiB) Viewed 5830 times
A) => RNG

B) => clock

C) => green signal counter and constant to make octave change on all notes

D) => handling of different notes memory cells and increment/decrement logic

E) => autotune for notes 2 3 4 and places where the variation is "decoded/applied".

F)=> memory cell that that update and store signal [1] [2] [3] [4] with as value the pitch of the note to play

1) autotune value, note to avoid for the first note
1 bis) duplicated information for other notes

2) M = 24 is the pitch of the main note
H =5 meaning cannot exceed 24+5 as pitch
L =-5 meaning cannot be lower than 19 as pitch

3) U = 3, next time "F" reach max, add 3 to the pitch if the RNG says so
D = -3, next time "F" reach max, remove 3 to the pitch if the RNG says so

4) 5) 6) Settings for notes 2 3 4
HL and UD having same meaning.

The other combinators are there to either delay signal or control time with modulo operation, or act as filters like M+0 output F.

Part of the question "how to solve the technical problem" i feel is related to the style of music, because depending on it the logic can be different, repeating a melody or constant progression or lots of instrument and change in tempo or beats would need to be done differently for different music. As such i think it's easier to make "robots" that play 1 type of improvisation rather than machine that could be configured to do all with many settings. It allow to use parts and discard them easily without changing the whole system. I have made plenty of those experiments in editor map, i turn it off, duplicate it aside, modify the new version, duplicate , modify the new, duplicate. It creates long line of builds so i can go back and listen to previous version to compare and check the builds and things i already attempted. I have plenty of those duplication line that end on tests maps, that form a trees and at the top of the branches are contraption that plays music, i try to only select the worth sharing but i'm not sure i could ever make music that sound appealing.

adam_bise wrote: Tue Apr 09, 2024 2:54 pm Oh yea, you should give your robots a mohawk or earrings. Check out this actual robot band! https://www.youtube.com/watch?v=TaY7vohLXK4
Hahaha nice one ! That makes total sense to match the style of the robot with the style of the music, and this is metal no ? :D

For reference here what i found appealing and inspiring for the dazzling duo of guitar : Rodrigo y Gabriela Hanuman With energetic vibes and plenty of notes. I think choosing the proper beat would help to make a sound that reminds of. I keep telling robots to play like that without success so far x).

For the guitarist that play solo and try a different emotion, also many notes, i found this video from song i really like by estas tonne :
It shows the pattern with notes that i can read :)

For the Instrument Overload, i was influenced by the song Newjack from Justice

For things that "do not have plenty of note" as i keep saying this, i think of things like this Deep house / chill house mix
maybe it's just me who do not realize there are many notes, i have the impression that the melody are good, and repeated many many times. There exist many of those deep house chill mix also "ethnic" or "afro" where the sounds are relaxingto me or the beats are interestings.

Now if we are talking about making music with combinators, i have done some research, in real life i think some techno is getting quite close : https://www.youtube.com/watch?v=gjpqD9sBH08 , but in factorio it's all digital so i think it's closer to this : https://www.youtube.com/watch?v=vRUpMe3Mb9M . I also found there exist some generative music capabilities whose functionning is not based on the recent AI neural networks, but like previous link on modular synthetizer :https://www.youtube.com/watch?v=F1Covw8Xuvg

I found out some program for sound making also allow to have the program randomly select a sequence of frequence, similar to note but doesn't have to be, and play them in sequence, that's a built in option to task the program to improvise with those and the settings are oddly similar to what i'm attempting to do.
adam_bise
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Robots generating endlessly new "music"

Post by adam_bise »

That is a lot of combinators lol. Makes my brain melt!

Here are some fills to consider, especially for classical or rock style.

Arpeggios: A fast staircase style fill like C D E F G A B C, or C D E F G F E C. These are eighth notes. Each of these 2 examples would fit in a single 4/4 measure.

Tremolos: A fast sequence of 2 or more notes like C G E G E G E G, or C E G E C E G E. These are also eighth notes.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

adam_bise wrote: Wed Apr 10, 2024 1:50 pm That is a lot of combinators lol. Makes my brain melt!
I tried to limit the amount to make "robots" but it's more difficult to use less and try to compress. I had to let go a bit in order to achieve a machine that could play arpeggios, tremolos, chorus, and random sequence, which i think "technically" does the job, but it's not satisfying too hear x)

It look like this :
melody player annoted.jpg
melody player annoted.jpg (1.42 MiB) Viewed 5704 times


Compared to the previous experiments, it only uses 2 note selector. I thought it would make it smaller at first :|

I managed to fix the memory cells issues, but this version cannot play in "polyphony" because the sync is not always good, by default one can't hear as it's not set up for it, but trying it is not recommended. The sound is not very appealing, it was made for the technical side experimentation, and i didn't attempted to make it sound good with things that may make it more complicated to read/understand.

It works with several clocks and counters, the "main clock" has the tempo for the music, when it reset, it triggers another timer that by default shows 200, but goes to 0 when triggered and then regrow to 200 at 1 per tick speed. This secondary clock is used to refresh the memory of the notes and read the RNG to invent future notes and melody.

The "settings" are like previous contraptions variation compared to the "root note",but such note is not really a note that is played anymore, it is a concept that serve to align the other note on an octave. It is choosen by the first note selector, and stored in the 3 blocks of the memories cells at the top that have no number in them.

There are 3 copies of the root note, but also 3 chorus, 3 arpeggios, 3 tremolos, and 3 random sequences, everything, this allow in theory for the machine to play 1 of the column, while the other one is being refreshed, and 1 is availble for a seemless transition at all time.

The lamps turning red indicate wether the left most center or right most column is being currently refreshed, not played.

When the green signal, on green wire, running on substations a bit everywhere is regrowing from 0 to 200, it will first pick "chorus", then "note 0" it will do the operation of adding or subtracting the amount of notes written in the settings based on the randomness, it shift a random number right by 3 which is not important, it could be be any on the right, then do modulo 5 operation, this gives as possible results -4 -3 -2 -1 0 1 2 3 4. So there is a slight chance that the note stays unchanged, but if it's positive or negative , then only the sign is read. And the magnitude of the transformation applied is the one in the settings.

This allow i thought in theory to set up notes so they follow each other by settings intervals that follow each other, or to have notes set up in relation higher/lower compared to any other notes of the group of 8. And also set up complete random, and various bounds.

A group of 8 notes choosen this way compose either the "chorus" "arpeggios" or "tremolos" or is "random".

Then the machine will order which sequence of those to play based on hard noted settings on the top right. I made it hardcoded and visible which sequence is being played, it does : "random" " arpeggios" "chorus" "tremolos" "random" " arpeggios" "chorus" "tremolos". This from the middle column, then this from the right most column, then this from the left most column and at this point column contain a different set of notes in it.

This is more of a proof of concept, for now each time "random" or "chorus" or any of those is "played" , it means the 8 notes stored in memory for it are played twice 0123456701234567. If no notes are stored in memory, it will use the "root note" instead because this means there was no variation.

Problems : The arpeggios and tremolo can't really be heard, i tried to set up some parameter to that it would reproduce the staircase or moment felt by tremolos, but when i hardcode the note, or when i give bouns for random notes, it makes a sound really different. At this point it feel just 1 or 2 notes in the 8 changes how it feels. So an "arpeggio" with 2 notes that are properly ordered compared to the others is not an arpeggio i would say ? It's just not working. It should be mre rigid and less random i guess for the notion to really feel the same when done by robots.

Other problem is the rythm, this machines can only play 1 note every "moment" it sound bad / annoying very quickly despite the variation of notes.

I attempted to change this by adding another mechanism, that would pick a random number of 32 bits, then take only 8 bits and copy paste them so that the 32 bits would look like a repeating pattern and play only notes when bits are "on" or "off", bit = beat :D

Next Version :


The synchronization problem is even worse. I'm not sure what causes it, i feel some it is caused by the non equal amount of time allocated to "0" when counting from 0 to 63 or 0 to 8 or 0 to 128 for the music from my clocks. It may also be caused by a signal say "i" to take more time to arrive at its final value everytime it needs to compared to signal "M" or "P" as sometimes M is used to calculate "i" and sometimes not, it's difficult to syncs the information from : what note to play, is it time to play, is speaker allowed to play in the current rythm.

Whereas when attempting to make "music that sound goood" rather than following the rules, if something appears off timing, it's possible to build on it, remove things to make it the ne timing, if the end goal is a robot small and easy to deploy, it's easier to develop i found than a machine that can be set up to play certain things that need to follow strict rules.


Like this other version copy of the older machine :


I thought to add the second hand of pianist, i was watching tutorial video and notice that my robots play with one finger at first, then one hand, i added a second row of speaker to play the same note as the first one but 2 octave lower thinking it would be like the second, if the second hand was doing the exact same as the first naively. Then i attempted to not play the notes at the same time but right in the middle of 2 other others. It was super noisy, but with the plucked string, i though if there was a way to control when the repetition occur it could like more like music. It only knows "chorus", it will show the lamps purple when playing it repeadly, otherwise lamps shows which note are used in the current selection of 32 notes and make it visible which notes are avoided by the autotune or missed by how i treated the randomness. There is no second hand of pianist in this version, nor on the more complicated one with all the memory cells. I think i'm going to try vibraphone next time or something that realistically is played with only 2 "notes"/ "stick" at a time. It may sound more like music when played by such machines.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

Melody Player Next Version :
Melody machine.jpg
Melody machine.jpg (5.18 MiB) Viewed 5569 times


This one has no more sync problem provided the tempo isn't changed. It can invent melody and rythm altogether. It shows on top a screen with which note was played that moves to the left after the robot played them, in case it plays something that sound nice it is possible to see what it was.

Blue indicate the Vibraphone played the note, yellow is for the Celesta, the other instruments plays all the notes but not those two they alternate. It is possible to mute individual instrument by turning "on" the constant combinator under the green lamps, it will make them red and mute the sound so one can hear only the piano or the bass or the steel drum or the celesta/vibraphone playing the same melody.

It works well when in editor, copying the whole blueprint at once, powering it up, and then turning it on. There is nothing else to do. But turning it on/off repeatdly shouldn't break it.

The row of lamps under the "main screen" shows the rythm, notes are played only on lit lamps, and the bottom row shows where the robots currently is on the rythm that shows just above. This number is randomized quite often , but then each rythm is repeated with a different set of notes.

It doesn't sound like "music" more like kid synthetizer on shuffle/random mode. But i'm quite happy with it anyway. It's still not perfect, the settings needed 1 duplicate field for all the notes to be registered in memory which shows somewhere there are 3 ticks too many as delay. And that makes it difficult to know what settings correspond to which exact notes. Plus when the rythm "mute" some note, it doesn't really sound like arpgeggio or tremolos, but sometimes the rythms doesn't mute many notes, and it happens that some can be heard, and the staircase is visible on the lamps. Those do not show different octaves, a C is a C no matter C3 or C4 or C5, but it would be possible with more lamps.

I think the next step is to try and make the instruments have their own rythm instead of all of them following the same, maybe all different notes. That sound more risky to me. I don't know much music x)

There are room for other instruments, it is possible to manually add some to play only at certain notes, and disconnecting the "structure manager" which is a green wire from a substation (holding cyan signal) will make the machine keep the same rythm until it is re-attached supposedly. But otherwise it is in "demo" and will change notes an rythm quite rapidly but repeat them to show what it can do.
Post Reply

Return to “Combinator Creations”