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: 3575
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

Modular version number 1 ( the first that worked when reassembled)
In the continuation of the previous experiment, i developped less the "robot" aspect, and tried to give more settings to configure for the users so that it's less playing a certain music by itself with many variations on its own, but rather improvise music in a range that is narrowed by user, such as random rythm or defined rythm, and possibility control more precisely what is playing what and when.

Part of the reasonning being that many instruments could reuse part of the same logic, so i attempted to make the original machine into distinct modules that could be easily added or removed from the core machine, to add instruments and vizualize what's happening better.

What is presented here is not in a "final" state, it shows steps of progressions that i have built enough upon afterwards that i think it was a good decision to try this and wanted to share some progress, i'm open to feedback positive or negative :).

Here is an overview of the machine re-assembled :
Assembled.jpg
Assembled.jpg (4.94 MiB) Viewed 1129 times

It look quite similar to the previous one and it works surprisingly, i was not sure it was a good idea to attempt reorganizing everything. Sometimes i can't put everything back together, but this time it worked. It was made from many different modules that successfully reconnected when pasted together :
clock & counters.jpg
clock & counters.jpg (174.73 KiB) Viewed 1129 times


This part is the base of the machine, the clock signal is sent everywhere to sync the music. This part also provide the random number for the other modules that require it. It also provide a signal of activation. It also provide a signal that count how many repetition occured keeping track of time for other modules that need it.

All the constant combinators containing "OUT" visible on it are turned off, they are used for routing signals, This is the clock, it's not receiving any signal, instead it's only "OUT".

This is also the part that contain the play/pause button.

Here is how it look when it's connected to the bus that transmit signals in other modules :
clock plugged in.jpg
clock plugged in.jpg (289.07 KiB) Viewed 1129 times
All the lane on the signal bus are made from turned off constant combinators, it's written "in" on every single constant except those that are used to connect to the "out" like the clock, to make it easy to manually plug additionnal modules, and to know which modules "read" or "write" on the bus. This particular version has lots of signals in the bus, but it was reduced later, this is the maximum it ever had so far.

Here is the second module :
RNG to Note.jpg
RNG to Note.jpg (174.01 KiB) Viewed 1129 times


This part receive some signals from the other modules through the plug "in R", that is for the random number coming from the clock module, in SE represent the connextion by which "settings" are received to handle the transformation of the random number into different notes. The signal "in green" is used to receive synchronization signal from other modules.

This part output signals " out N" which is the root note, dealt with by the upper part, and "out 0-7", which will be the different notes from the bottom part of that modules.

This is also the part where the "autotune" is active, current version shows the C major scale, but i have also made little variations that can play different scale like F#major, and only using #notes, it require little adaptation but it sound good.

Here is another module and an illustration of what is easy to do once it's made into little module :
note memory.jpg
note memory.jpg (302.19 KiB) Viewed 1129 times
note memory 2.jpg
note memory 2.jpg (391.19 KiB) Viewed 1129 times
blueprint : viewtopic.php?p=609419#p609419

The first version is just a very compressed version of the original block of 12 memory cells, with the same treatment for input and output signals dealt with a "bus". The fact that's it's a "module" or a "patch" they say in video about modular synthetizer that's i've watched for inspiration makes it easy to customize it with some buttons or display to show which cell of the memory block is accessed, and what is its content. This additionnal display part is not necessary for the machine to function, is not connected to the main bus of signal, it's just reading part of what this module is sending to main "bus of signals", intercepting the signal as they are sent to the main bus.

This part alone doesn't make much sense though, i realized when attempting to rebuild other machines, in such state it works only when another module is also present, such rules being annoying i remade the 2 modules that can't work on their own into a single module that will be displayed later. Such version was working though.

Here is the other module required for this one to function :
settings for note.jpg
settings for note.jpg (1019.13 KiB) Viewed 1129 times


It was not even placed next to the correct one in the version pictured at first, it is the module where manual settings for the range allowed of randomness for each note is choosen manually.
There are 4 groups in this version, so it is possible to set up 4 different pattern of notes, supposedly one for the chorus, one for arpeggio, one for tremolo, and one for whatever sound pleasing, each time it's choosing 8 range that are allowed compared to a root note choosen in the "RNG to note module". That also is not ideal that's why it's wip. 4 group of patterns, and 3 version of each are stored in memory, that makes it 12 cells, that's the 12 lamps in the previous modules, each cell having 8 values, displayed when they are accessed. Those value are the pitch of the note basically, so 42 would correspond to note 42 in the list. And the settings works by selecting +5 -6 let's say, on a "root note" that if is 40 would yield notes either 34 or 35 or 36 .... 45, but then if it's not a note in the choosen scale it's modified to the next note of higher pitch that is in the choosen scale.

It receive the green signal for synchronization from the clock at the same time as the memory that will store the notes after the RNG is modified by those settings. This allow all modules to stay synchronized no matter where they are located on the machine, as long as they have direct connection to the signal bus. This kind of organisation works really well i found, and i'm not very good at organizing usually, so i need method that are efficient and easy. I can only recommend x).

The next "logical" step for the machine is done by this module :
memory decoder.jpg
memory decoder.jpg (453.45 KiB) Viewed 1129 times


This is the place that will assign the 8 original notes values obtained through previous process into 32 notes to play sequencially, the diferent notes could be stored as :
signal 0 : 32
signal 1 : 30
signal 2 : 28
signal 3 : 26
signal 4 : 24
signal 5 : 20
signal 6 : 24
signal 7 : 18

That would be contained in 1 memory cell, but when played, this module will assign

note 1 : signal 0
note 2 : signal 1
note 3 : signal 2
...
note 8 : signal 7
note 9 : signal 7
note 10 : signal 6
note 11 : signal 5
note 12 signal 4
...
note 16 : signal whatever you prefer
...
note 32 : last note why not pick the note of the 8 that is the lowest ?

Not sure the explanations is very good, roughly it will always do the same things regarding the 8 different pitch value given to it, but it will yield 32 notes in total, which means some of them will repeat. The repetition that this couldd create is hidden using other modules.

In the latter version i'm attempting to make many of those modules "per instrument" but so far, in this presented version, the output of this memory decoder is sent to the signal bus and every instrument plugged will read the same notes at the same time.

This allow to have the piano and the vibraphone playing the same note if wished, and it's possible to have the vibraphone play only half the notes, or the opposite, why not, since instrument are different modules , it is possible to do modifications on the particular module.

Here is another module :
Rythm plugins.jpg
Rythm plugins.jpg (741.34 KiB) Viewed 1129 times


This one is receiving a random number through the bus channel from the clock, and it can be used to determine when the note will be played, since random numbers are 32 bits, the randomizer when creating a random 32 bit number will then have the instrument only play when the bits are 1 ( or 0 ), half of the time on average, but with some acceleration and slow down.

This pluggins also allow to forget about the randomness and instead use rythm manually inputed, one can turn off the combinator that hold the red color to instead use the lamp pattern as rythm. This was a small version so it's only possible to choose a 8 bit number as the rythm, and then it's made into a 32 bit number where the original 8 bit pattern repeat 2 or 4 times. When only 2 there are silences, it's slower music.

This is the plugin that made me want the most to have things working "per instrument", instead of having one of such module and customizing instrument modules afterward, rather embed the rythm plugins in the instruments. ( Shown later maybe x) ).

This module is not functionning on its own, that again a mistake coming from that very early version, it require another module to synchronize properly the notes and the random/choosen rythm coming from this module. It look like this :
beat and note synchronize.jpg
beat and note synchronize.jpg (980.81 KiB) Viewed 1129 times


This module is also used to extract some display information since its output is synchronized for the speaker to play from its output, it was the proper place to do i thought. But in later version i just removed the rythm module and the synchronizer and instead embedded them with the instruments. It feels easier to use, each instrument can have its own rythm. But in this version it is the module that output the content for the "screen". It means it's also where colors are codded for display of notes in its own lamp that helps follow what's going on too.

Its main role though is to shift the number that represent the rythm by the moment in the music, and detect if the beat is 0 or 1 to then let the note goes through or not. That was not done in the previous module, only the creation of the number. This one thus receive the rythm number ( the yellow channel ), but it also manage when the rythm is made into "random" the reseting memory cell that update a new random number as base for the rythm. thanks to the cyan channel. The notes coming from the D for decoded channel.

At this point there are already 10 pictures attached in this post, so the next modules will have to go in the next post.
Last edited by mmmPI on Tue Apr 30, 2024 4:21 am, edited 1 time in total.

mmmPI
Smart Inserter
Smart Inserter
Posts: 3575
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

So the last module before the speakers can finally play look like this :
Structure manager.jpg
Structure manager.jpg (516.66 KiB) Viewed 1118 times


This one was quite annoying to synchronize and to be fair it's not properly done as every time it changes column, there is 1 note that is not synchronized during 2 out of its 6 ticks duratio, this is visible on the screen that display notes, instead of having a flat bar of 6 lamps, there are 4 lamps in 2 that are not in the proper area isolated. Once every minutes or so maybe, it is possible to avoid it by not playing a note on the first time of the 32 notes, because that would be the one that is butchered if it is playing when the column changes.

The columns are from the memory cell, the chorus , tremolos ,arpeggios, and randoms, all those have 3 version, this modules define when those are played. I'm still unsure how to rework it in the future version, maybe it could be "per instrument", but maybe there could be another module to manage all the instrument "over time", to choose which of their pattern they play, and instrument given their own struture manager.

Again those are not "top notch", the combinators are most likely suboptimal, i'm often shown how to do things more efficiently, more time was spend to try and organize the logic and make it easy to build and improve later. I'm saying this here as a disclaimer because it's almost the end of this build , and i don't want to end the whole thing on a bad note.
There are countless things that i had to put aside to go forward despite them not being as good as wished all things to be. The modularity also allow to rework a specific part later. That's the main point i want to emphasize, with the bus of signals this version is MODULAR, it's not good, but any module can be replaced by higher quality one with dedication , that's the plan, when/if making a "song" instead of "random impro", that could "come handy" i thought.


Ok and now finally the module with speakers :
Speaker.jpg
Speaker.jpg (656.99 KiB) Viewed 1118 times


This version contains 5 instrument, each column is a different one that can be turned on or off by turnin on/off the constant combinator at the top of the column. In such case they are "always on" with a negative signal pitch which is silent with vanilla speakers.

There are only 16 of them, so they each play twice when going through a 32 notes sequence that is also the length of the rythm pattern that's why they have 2 combinators gating them on the left, the first one play at moment 0 and 16, the one under it 1 and 17 and then 2 and 18 and so on. It is possible to change or add instrument easily, but it's not easy to have them play differently. The example is the vibraphone/celesta that play not at the same time like in previous version.

Now i also have made a module for modded speakers :

https://mods.factorio.com/mod/musical-speaker-fixed
modded speaker.jpg
modded speaker.jpg (1.25 MiB) Viewed 1118 times


This particular blueprint is setup to play Sitar or Harp i'm not sure which one. The settings is held in the constant combinator near the green light that is not containing the green signal. It is using the "default" signals of the mods, C for category I for instrument and V for volume, the latter being stored in the same combinator than the green signal, it allows to turn it off by muting it, V=0.

Otherwise it is a bit more complicated than previous setup because it transform the pitch of the note into a pulse that is then stored a definite amount of ticks for the speaker to play. With such modded speaker, not all instrument need the same time to play a note, percussion can be very short sound of 3 ticks whereas with voices chorus of Aaaahhh, this need to be sustained for 12 to 16 ticks for the sound to be ok to my hear. in the current example it's stored for 65 ticks for each note which is very long, considering a note is played for 6 ticks before another one is played, this means a note can still resonate while the 9th note that came after it is being played. That works well for synth or "warm pad", or whistles to create a harmonic background they said on youtube tutorials.

The mod allows up to 189 instruments when downloading the whole archive from the github, instead of just the large piano that will be heard if the other sounds are not present in the modpack when/if this blueprint is used. The large piano has a bigger range of notes and do not start with the same first note as the vanilla speakers, which means this blueprint is going to yield bad notes if the P signal is not shifted by 7 up. ( instead of note 12 in vanilla, this should be playing note 19 to be playing the same from my experiments but i'm bad at differenciating notes if they are not written so i would advise to double check x).

That the purpose of the screen check on the right of this module :
Screen.jpg
Screen.jpg (547.93 KiB) Viewed 1118 times


This needs to be adapted when the scale C major, B major ... is changed to make it reflect notes allowed and the others.

Here is how look like a version that uses several of those modded instruments :
Modular version 2 the last that worked before i changed some risky things again
Large machine.jpg
Large machine.jpg (3.44 MiB) Viewed 1118 times
I also added some more display things on existing modules, it's one the last version i built using the described piece of blueprints. It features a rework of some things mentionned along the description, also additionnal display to transform the number of the note into its letter for nixies tube :)

Sometimes i'm exporting 5 minutes of the jam that the machine produce as mp3 copy the whole thing , change the instrument, adapt the timers ,add other instrument , change the rythm, randomize a few things differently in the settings, and export another 5 minutes instead of actually improving the machine, once it exist under this form it's quite easy to do.

That's when i decided to dig a bit more into different scales and made this thing to help me :
scales.jpg
scales.jpg (475.45 KiB) Viewed 1118 times


It holds the value for the note that are not part of the scale indicated, and each part can be copy pasted on the "screen" module, to match the value from the autotune. The F# major is a bit special because i think it has 1 less note than the others, maybe i made a mistake, but i had to change the autotune to add 2 combinator to make it work that's why they are also attached.

It needs to be attached to the "memory decoder module" , the previous one or this newer version more bling bling with flashy lamps :
memory decoder shiny.jpg
memory decoder shiny.jpg (864.35 KiB) Viewed 1118 times


Notice the constant combinator holding value for signal 1 3 5 8 ? in the top left, it has 2 combinator acting on the P signal next to it, those are what i'm talking about. The necessary addon when wishing to use th F# scale. The machine is not able to change scale on its on randomly. I am not sure this is allowed in music theory, or when it is possible to do so, and how it sound.

This version will lit a lamp at the intersection of number from 0 to 31 that correspond a to a moment in time, and the note from 0 to 7 represented as column that are played, so the lit lamp move in diagonal and do zigzag, because why not.

I'm still unsure how i will manage to have the settings module expand the same as the memory module, the footprint and timing are ok, but i'm not sure yet how to name the new cell if the module is made to be expandable for more than 12 cells.

Here are some other developments :
controllable timing for note.jpg
controllable timing for note.jpg (3.39 MiB) Viewed 1118 times
The blueprint will be in following post because it doesn't fit in this one, This is a module that can be plugged onto the others, it is a modded instrument module that allow to configure easily the time each note will be heard by setting up value in constant combinator, i've seen that on tutorial video for sound making, that's my way of increasing the sustain time. One can set a base note duration in ticks, and then each constant with the value K attached to the column containing a speaker will add the base duration. 1 2 3 4 5 times ... this can help to make it sound it's a musician that make note last longer when they are played in slow succession, and make note last less long when played in quick succession.

It was also used as test when giving a drumkit as instrument to the machine instead of a pitched/tonal/melodic one. The machine doesn't know how to group sound by itself in kicks/ hihats/ snares and so on because the mod adds many and i haven't sorted them all out to hardcode properly a drum machine yet. But with some tweaks to remove the more non-drumesque sound like whistle it's possible to make it play some okish percussion i found, only percussion sound at least. Not sounding like a beat made to be regular, but rather random complement to the melodic, and addition of non-tonal sound of different frequencies.

mmmPI
Smart Inserter
Smart Inserter
Posts: 3575
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

Previous blueprint :

mmmPI
Smart Inserter
Smart Inserter
Posts: 3575
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

I don't know if it's a good idea to post those in here, they may be oversized a little, it's more as illustrating purpose, that it's quite easy to modify a module, while still using the others on the same machine, one instrument can be using one type of module , and another one another, if need be.

I made this other version that uses a push button to gather a random signal from the bus and use it to activate or not the notes when the randomizer is active, while the note active will be played during the duration set by the constants, and there's 2 rows of lamps that decreases when the note is played.

Only purple notes are played when the randomizer is activated.

This particular blueprint of it is done with vanilla speakers, so it's needlessly big and cannot handle the change of instrument with signals but it works also with the modded speaker they are not hard to replace given the wiring and conditions used :
noteventhefinalformehehe.jpg
noteventhefinalformehehe.jpg (5.59 MiB) Viewed 1111 times




On a side note, i followed online instruction to use audacity to export the sounds made in the game into wav or MP3 ogg whatever , i made a little compilation of some demo of what those machines are playings also including some of the music from the early robots like instrument overload, or just basic melody machine there are 6 different sounds from 6 different machines , it's not quite the good mixtape yet, and i have no guarantee it will get better at some point, but i'm open to sugestions x) :
some impro.zip
(35.69 MiB) Downloaded 30 times

mmmPI
Smart Inserter
Smart Inserter
Posts: 3575
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

Blueprint of the memory block forgotten earlier :


Tayday
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Jul 22, 2024 12:30 am
Contact:

Re: Robots generating endlessly new "music"

Post by Tayday »

Love this.....wow

mmmPI
Smart Inserter
Smart Inserter
Posts: 3575
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Robots generating endlessly new "music"

Post by mmmPI »

Tayday wrote:
Mon Jul 22, 2024 1:30 am
Love this.....wow
Thanks ! feel free to make a copy of it and post it on youtube

Post Reply

Return to “Combinator Creations”