Trigger different logic depending on a numerical value?
I sculpted a working mini piano, and it’s possible to play it with th imp. The keys move, musical clips (consisting of one note each) are triggered. It’s fun, but I wanted to take it a step further and turn it into a Westworld style player piano.
I was hoping to have different notes in a music clip trigger different keyframes, but there’s no obvious way of doing it. In the outputs for music clips there’s a “composite note data” output, which when fed through a splitter gives (among other things) note data expressed as a number. 0 is middle C, positive numbers are higher notes, negative numbers are lower notes.
Is there a way of converting this number into something I can actually use? Essentially saying “if this number is 0, play this keyframe, if it’s 1, play that keyframe” etc.
I feel like I might be asking entirely the wrong question, so if anyone has any suggestions for a better way to make an automatic player piano, I’m all ears
👂👂
👂👂👂👂
👂👂
-
One way: Create a Selector, increase its number of ports, and wire the number up to the selector's "Active Port" in the tweak menu. Wire each selector output up to a keyframe.
I think a selector is limited to 10 ports so you may need a bunch of selectors.
Alternate way: Use a bunch of Calculator gadgets: set the mode to =, connect the note number to the first input and set the second number to the number you want to compare to. -
The calculator works perfectly, thank you!
Now I just need to do that on... *checks notes*...88 microchips.
This might take a while ? -
Yeah, that sounds pretty tedious and difficult given how number editing works.
Since the number tweaking is so fiddly, you might save some time on the number tweaking if you set the number to compare against like so:
Create a multiply Calculator, set it to 100 x 0, connect that to the second input of the =.
Since the number tweaking on Calculators happens in hundredths, you can just tweak the second number to 0.01, 0.02, 0.03 etc to get the number to compare against, so you don't spend as much time tweaking digits to get to exactly 1.00, 2.00, etc. -
It’s not too bad so far (I’ve been prototyping on the mini piano before I attempt a full sized one), especially once I figured out you can increase any value slider incrementally with the D pad.
It’ll still be a slow process, but I’ve figured out a workaround of my own to hopefully save some time (not tried it out yet so I’m not sure it’ll work).
Each whole number = 1 octave, so if (for example) middle C was 1.25, the C an octave above that would be 2.25.
I’m thinking once I’ve done one octave I can save that on a microchip (excluding the keyframes) copy and paste it 7 times, do a check to see if the number fits within the relevant range, subtract one whole number per octave and send it to the relevant chip. My flu addled brain could be way off beam here, but I THINK that’ll work.
If I sculpt one octave of piano keys, group the keyframes with the sculpts and clone the group a bunch of times, then it’s just a case of carefully wiring everything up.
I have hit an annoying snag though (one that I should have seen coming!):
As the output is one number, it can only play one keyframe at once, so I can’t animate more than one key at a time. I’m wondering if there’s a workaround for *that*, but I’m not hopeful. -
Only workaround I can think of for polyphony is to clone your music clip as many times as you have simultaneous notes and remove notes so each clip only plays one at a time. Then you'll have multiple note signals to make use of. I'd like to see your piano when its done!
-
Hi! Where did you get to with this? I managed to create a player piano - a ‘pianola’ which I released a few days ago. There’s a full microchip for up to 80-something keys now. Take a look, but I’m curious if there was a better way of doing it...
Please sign in to leave a comment.