Hi,
i want to make simple sequencer. I have 8 buttons and i can tap it to change its backgroundcolor to red or second tap to back it on color white. I made also connection that when background color is red the “ukryty_01_mute” button take “1” in its text.
What i want to do is to make my Player sound when button has background color red (and so ukryty_01_mute button takes “1”). When backgroundcolor is white (ukryty_01_mute button is “0”) there should be no sound.
App has to go from button 1 to 8 by one and check the background color.
I couldn’t make it correct. I also tried to made a list “colorRed” and i put there ealier 8 “backgroundcolor” buttons and tried to compare it if color is red but it doesn’t work.
Is there a way my app could go and check the actual background color or if “ukryty_mute” button is “0” or “1”?
Thanks but maybe i wasn’t clear, it would work only if i use exactly as you show:
‘’’
if button.backgroundColor1 = red
do start.player1
‘’’
but i can’t do that beacuse i want app goes from button 1 to 8 (not play it all simultanously).
That’s the case - to check if ButtonColor1 is red (if is red then play sound), then go to ButtonCollor2 to check if is red (if is red then play sound), then go to …
Clock Timer will not help unfortunately because it will check each time the backgroundColor of Button1, then 2,…,.
So if Button 1 color is red (plays sound) and Button 2 color is white (should be no sound) but Clock Timer will start checking from start and will see that Button1 is red so will tell Player to make volume audible.
This xylophone tutorial i read at start with this project but it shows how to play sounds automaticly when you press button. In my case you cilck start and app should go through all 8 buttons and check on each step if play sound or mute.
To answer your question
“Will pressing another button change the button1 colour to white and stop the player (for button1) ?”
I don’t exactly follow what you mean. If i.e. button3 is white it should be muted and then app should check if button4 is red or white.
Can we take a step back and look at your workflow?
Do you want the sounds to play in sequence from 1 - 8 automatically and use the buttons to show (by colour) which sound is playing? (from what you have said it seems to be around the other way, which is more complicated - if the button is red play the sound, don’t play the other sounds.
Could you please explain your workflow in detail, then we can find a solution
Ok
Let’s say i want to make a loop of 8 steps. That’s why it is 8 buttons.
When i hit Play button and all buttons from 1 to 8 are red app should make a 8 sounds one after another.
And i.e. when only buttons nr 1, 3, 5, 7 are red you hear only 4 sounds (because step 2,4,6,8 should be muted or we can program it to be just lower at volume to illustrate better).
So app always play 8 sounds but one after another, just the volume is different because of the color of each step.
OK, so pressing a button should not play a sound, it should just change the colour of the button to tell the sequencer whether it should be played or not, when the sequencer is started ?