So for a project that’ve been doing is the Piano app that I found a tutorial on YouTube. The problem that I’m having an addition to it. I’m adding three buttons that act as octave keys where the when clicked the buttons will change from the original sound it was before.
I’m pretty sure I have an idea what I’m doing but at the same time I don’t.
This is basically my idea and I have no clue if I should more. I’ve checked and I don’t think anyone has asked about this problem but correct me if I’m wrong! (I have to do this for a high and low and then back to the middle octave)
First, please use the AI2 Download Blocks Image facility to make nice sharp block images for us.
Do not burn down your house with that tripod and flash powder.
What you have is a list manipulation problem.
You should have have three tables, one per rank (low, middle, high), each one a two column table with the button component in column 1 and the sound file for that button for that rank in column 2.
You also need a fourth table, that would be reloaded from whichever of those three prior tables was selected.
The fourth table is where you would use an Any Button Click event to look up the sound file for that button.
That's a joke...
Please do not take photos of your blocks, do it like this
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
I forgot to ask, what is the point of disabling the individual note buttons?
Are you doing record keeping on the side to re-enable them when the Player they launched finished their note?
You would need a pool of available players for that.
Search this board for Cacophony to find a code sample for multiple players in a pool.
Similar problems in the time dimension are handled in Morse Code players.
Regarding my earlier three table idea, in retrospect I would line up an 88 sound file list and jump my base index by rank length. 12 notes per octave in modern music?
The point is when you click the octave you want (Low, high, or middle) the piano keys change for that corresponding octave. To make it simple on myself, I’m just using three octaves.
In your blocks, I see you are using the global lowoctave in two different ways:
a sound file
a list of true/false values?
Those are contradictory.
P.S. I read your code.
Now it's your turn to read your code.
Read it to me, block by block, and explain what data is being transferred and how it is supposed to work.