Minecraft - Noteblocks, looping bass, and adding melody
I've been trying to tackle the whole noteblock thing in Minecraft to reproduce a song that I like.
I just found out how to loop like a normal bass layout. Now what I wanted to do was add the whole melody to it while the bass is still looping.
So the idea is to play the bass on its own once, and then when it's about to loop again, I want the melody to kick in. But only once! I don't want it to loop every time the bass loops.
Right now this is what I have. It's a bit janky and not the best, and my melody loops every time my bass starts over :
(The blue is the bass and the red is the melody I added).
Also, I'm guessing in order to hear the song from anywhere you're standing, you'd have to make it vertically happen ? Because if I extend the song too far there will be a point where I won't be able to hear the bass anymore for example. Is there a way to avoid that ?
Also, if you have any tips and tricks to make the whole thing better I would highly appreciate that as well!
Thanks in advance
The circuitry is way bigger than it needs to be, but it's made to convey the ideas you need to make it as you need, not to be optimal.
Comparator is your friend. Oversimplifying its function - It's a silent element that can pass signal from back to front - or stop it if powered from the side.
You start the bass loop using a button in lower right - passing the signal through a pulse shortener (yellow). We want our signals to be short, because 'tails' of overly long traveling signal may cause trouble. So, the button powers the comparator, and a 4-tick repeater, which will disable the comparator in 4 ticks - so only the 'head' of it passes; the button produces power for 1.5s but we get only about 0.2s from the 'head' of the pulse.
And so it powers the bass loop (brown, clockwise), to play it for the first time. It passes the comparator marked in blue unobstructed, and loops back down to repeat the bass loop - but also branches t the 'tricky part', a memory circuit marked in white, one that when powered, denotes 'song in progress' and blocks all subsequent pulses from the bass line.
Now for the tricky (white) part: the pulse passes the first comparator unhindered, passes the repeater, and branches down, through a comparator - right into the back of the same repeater! It's long enough that there's no break, and this little loop right of the blue block latches itself permanently in powered state, never losing power. It also sends the power down to the repeater into the side of the comparator (so any subsequent pulses will be extinguished) and up into a pulse shortener (yellow), so that the song circuit (red) gets a pulse, not a permanent always-on power that would force you to wait the entire duration of the song to drain until you could play it again.
So, bass is looping, song is playing, any loop from the bass stops dead at the first comparator of the white circuit. All is well, except for the ending.
As the pulse reaches the end of the main song (red), you want bass to stop playing. That's the 'down' branch. To avoid need to synchronize timing perfectly, I added a pulse extender (orange) so that the bass line is 'snuffed' (blue repeater into blue comparator) for a good while. The pulse won't pass, bass won't repeat. And then there's the pulse into the blue repeater into the white circuit. Remember that little repeater-comparator loop that never ends? Well, here it ends. The blue repeater snuffs the signal through the comparator, and the circuit unpowers. You can press the button to play the song again.
If you want to stop the melody from looping you could simply use a piston that activates when the melody plays that then cuts the the circuit until you put it back