Play A Sequence of Notes Using Any-Component Blocks

Trying Any Component feature usage to reduce repetitive code. See aia file and url. Screen1 colour_buttons works OK. Screen1 code plays the note sequence listed for the three buttons. Screen2 attempts at Any-Component code for identical operation not successful.
http://ai2.appinventor.mit.edu/reference/other/any-component-blocks.html

Play_Note_Sequence.aia ~ Play_Note_Sequence.aia - Google Drive

My grandfather, when asked for directions to somewhere, always asked where the person had come from. Following their response, he said "I wouldn't have started from there..."

Perhaps consider the following blocks approach for your first screen as an example, which you can develop on from here. the key is to use only one player, and iterate over a list of notes...

You can use the same player for other buttons too.

Thanks for the feedback.
I tried using your sample code but I am only hearing the first note non-stop.
See updated file attached.

Play_Note_Sequence (1).aia (501.7 KB)

You did not copy the blocks correctly:

Your blocks

My blocks

And you should be able to do everything on Screen3 with just one player component

Sorry. THANKS.
Correction made. It works.

Followed up on your suggestion to use "just one player component".
The following blocks work:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.