| 1 | <xml xmlns="https://developers.google.com/blockly/xml"> |
| 2 | <description> |
| 3 | <![CDATA[ |
| 4 | |
| 5 | ## Play Happy Birthday |
| 6 | |
| 7 | + Create a string of notes to play the first line of the Happy Birthday song |
| 8 | + C,C,D,C,F,E |
| 9 | + Split the string using the comma delimiter to create a list. |
| 10 | + Play the contents of this list [C,C ..E] one by one. |
| 11 | + Wait half a second before playing each note. |
| 12 | |
| 13 | ]]> |
| 14 | </description> |
| 15 | |
| 16 | <variables> |
| 17 | <variable id="o+S3/T[!LUE{c-j2BeYI">notes</variable> |
| 18 | <variable id="}KE@V7,)cpEQ-Df=Q3r(">mynote</variable> |
| 19 | </variables> |
| 20 | <block type="add_piano" id="XvN)V-r4VX~8T@brh*bd" x="0" y="20"> |
| 21 | <next> |
| 22 | <block type="variables_set" id="%]#|]:gVX_:G^_dWHa8Y"> |
| 23 | <field name="VAR" id="o+S3/T[!LUE{c-j2BeYI">notes</field> |
| 24 | <value name="VALUE"> |
| 25 | <block type="lists_split" id="B),{G$J7U,:BlR-xTnP-"> |
| 26 | <mutation mode="SPLIT"></mutation> |
| 27 | <field name="MODE">SPLIT</field> |
| 28 | <value name="INPUT"> |
| 29 | <block type="text" id="dZkP4XuxHUbfjEG,6vPq"> |
| 30 | <field name="TEXT">C,C,D,C,F,E</field> |
| 31 | </block> |
| 32 | </value> |
| 33 | <value name="DELIM"> |
| 34 | <shadow type="text" id="$@b~F2t,@p@5qnuPMu1F"> |
| 35 | <field name="TEXT">,</field> |
| 36 | </shadow> |
| 37 | </value> |
| 38 | </block> |
| 39 | </value> |
| 40 | <next> |
| 41 | <block type="controls_forEach" id="4$$@%iO}YyMQ?.@9kGS/"> |
| 42 | <field name="VAR" id="}KE@V7,)cpEQ-Df=Q3r(">mynote</field> |
| 43 | <value name="LIST"> |
| 44 | <block type="variables_get" id="R|F5:kR*vbhf6Vd9/cvj"> |
| 45 | <field name="VAR" id="o+S3/T[!LUE{c-j2BeYI">notes</field> |
| 46 | </block> |
| 47 | </value> |
| 48 | <statement name="DO"> |
| 49 | <block type="play_piano" id=".h[Si?;07jUjl?LsKBG."> |
| 50 | <value name="NOTE"> |
| 51 | <shadow type="text" id="}eaU)/bKe[@zK2.t+p/T"> |
| 52 | <field name="TEXT">C</field> |
| 53 | </shadow> |
| 54 | <block type="variables_get" id="OA7`V6U:p:U,$]ltz|JO"> |
| 55 | <field name="VAR" id="}KE@V7,)cpEQ-Df=Q3r(">mynote</field> |
| 56 | </block> |
| 57 | </value> |
| 58 | <next> |
| 59 | <block type="wait_seconds" id="%]Tcx;K5P)#u@gN08PW#"> |
| 60 | <field name="SECONDS">0.5</field> |
| 61 | </block> |
| 62 | </next> |
| 63 | </block> |
| 64 | </statement> |
| 65 | </block> |
| 66 | </next> |
| 67 | </block> |
| 68 | </next> |
| 69 | </block> |
| 70 | </xml> |