TL community
Published

TokyMusicBox

The TokyLabs Music Box is an easy weekend project to make your own soundbox.

BeginnerFull instructions provided1 hour596
TokyMusicBox

Things used in this project

Hardware components

Tokymaker
TokyLabs Tokymaker
×1
Speaker
×1
Wires
×1
LED strip
×1
Light sensor
×1
Cardboard
×1
Box cutter
×1

Story

Read more

Code

Music-Box-11.xml

XML
<xml xmlns="http://www.w3.org/1999/xhtml"><variables><variable type="" id="3%4.3XCE7?XH!OIcl`el">value</variable><variable type="" id="JgxDC`KNB:2B@.9K5((B">red</variable><variable type="" id=",G;84$#_n%*v@s+.thT=">green</variable><variable type="" id="D_nV1aLxonB(|/6}))?P">blue</variable><variable type="" id="P;4qO8zA/8elWp;4MdlN">redup</variable><variable type="" id="o#avp_8,XR.ZN!-Yk{aH">greenup</variable><variable type="" id="^A@YA~~*S|q}h*AFSw?U">blueup</variable><variable type="" id="BLXSFm6P)0vhlDYjNc^Z">L</variable><variable type="" id="-tuM{5%LFLNbDH|yUo3w">I</variable><variable type="" id="KmeB3DN}`A0h*)kC;f:e">O</variable></variables><block type="variables_set" id="a3A49j:VW`VS7j(SrNJN" x="-774" y="-738"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field><value name="VALUE"><block type="math_number" id="fwm9XJXCZC2qZqXN#bAK"><field name="NUM">60</field></block></value><next><block type="variables_set" id="_v[UWtBZ(fms~6T(8J@0"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field><value name="VALUE"><block type="math_number" id="Mm00$nzl}WsT|#Nk:*_-"><field name="NUM">60</field></block></value></block></next></block><block type="main_repeat" id="GO!jH%Ta5ipe)8$A.m!5" x="-1026" y="-486"><statement name="repeat_code"><block type="controls_if" id="0kQB/BRlIP8K]A#9DRGL"><mutation elseif="6" else="1"></mutation><value name="IF0"><block type="logic_operation" id="QM8D29z1nLc~O6,-bgX|"><field name="OP">AND</field><value name="A"><block type="logic_operation" id="sQuU9-4MVn9ixs1;AI#Q"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="HsZKpqxE*(Ok-@g]Vhv}"><field name="OP">GTE</field><value name="A"><block type="read_input" id="%TpeObJM0ScnJ6=Yi[2_"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="ayzgnt8D(HJ-T_25aPKO"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value><value name="B"><block type="logic_compare" id="l3[KeT?NQ5JE+3yC],dM"><field name="OP">GTE</field><value name="A"><block type="read_input" id="#xHtIC}V#:?rw)I_`v};"><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="`p2/kq=@|iuE!6gb:Zy3"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id="r=mgEhPWaRnncH|Y2z;_"><field name="OP">LTE</field><value name="A"><block type="read_input" id="BX59z7n[3oDVG9L1GKz!"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="aJgKI0^B?q/TcSg4Rfu="><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><statement name="DO0"><block type="clear_screen" id="H$({fH;1tnPG:I74n+ty"><next><block type="print_screen" id="M;)q4Wd:_y7@:B:ih]r*"><value name="content"><block type="text" id="sb,uvy{~9.lqsO=yao:q"><field name="TEXT">C</field></block></value><next><block type="playnote" id="8L9L-e0Mc$Vf*OuC7|x%"><field name="output_number">23</field><field name="octave">4</field><field name="note">0</field></block></next></block></next></block></statement><value name="IF1"><block type="logic_operation" id="k~Nj=oW%xwYMexET(?*%"><field name="OP">AND</field><value name="A"><block type="logic_operation" id="m_Z1N1~/#d)adNdtMoxm"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="]jx)Rz1uA#6~2g@{+pw8"><field name="OP">GTE</field><value name="A"><block type="read_input" id="4#7?x{?2Yux8`D}gusPP"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="8Y/}Q0`4RCwxA@1/eKQm"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value><value name="B"><block type="logic_compare" id="/ym4R1MF8d3~0[Ik9(ln"><field name="OP">LTE</field><value name="A"><block type="read_input" id="a!UMvo{831AJ#B1iG:;6"><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="33C9q.#NYQO3JmvOknW~"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id="eZpa~(xjG!1%Sn/yGv,T"><field name="OP">GTE</field><value name="A"><block type="read_input" id="zKSG$u$Gr+NCMfU9B/g?"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="7SItJOLc6xZbH{xq{/MO"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value></block></value><statement name="DO1"><block type="clear_screen" id="+@RfGhAEHU-Mj[u]$~e_"><next><block type="print_screen" id="OtiCs-r8oON^XDhAGv#@"><value name="content"><block type="text" id="0L4Hj7Sgt*n1}NIEv+-7"><field name="TEXT">D</field></block></value><next><block type="playnote" id="r@f]wY}.y@2uSXXPn}%%"><field name="output_number">23</field><field name="octave">4</field><field name="note">2</field></block></next></block></next></block></statement><value name="IF2"><block type="logic_operation" id="pEE4}+u6{5Hn)$+=/~9G"><field name="OP">AND</field><value name="A"><block type="logic_operation" id="qcp.xVpd7$=JY-v/`HTS"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="B(.F?~DO,6qilU1{DNYi"><field name="OP">GTE</field><value name="A"><block type="read_input" id="=V?A=/H@n1n3*7R@jrxg"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="Vu|l6gtRjkC{t}M[M6(@"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value><value name="B"><block type="logic_compare" id=":@P!AUD:%-BOBNw8m[eu"><field name="OP">LTE</field><value name="A"><block type="read_input" id="=1DAG{RUa#O*p[Ud7Va5"><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="dgiFxB*XZpPH1r{fEfpd"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id="riy21d]i,(6*pAmGur/f"><field name="OP">LTE</field><value name="A"><block type="read_input" id="L{n9*4yPL+][c0qjsa]u"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="i}F%BsuYZ.OMra3Qjz;m"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><statement name="DO2"><block type="clear_screen" id="nvP6!q1is]XR~vp#7K%m"><next><block type="print_screen" id="SzJ?eWiP(p9VcVPJJI;o"><value name="content"><block type="text" id="jaWD|hlYs+(6pdsU:ZCX"><field name="TEXT">E</field></block></value><next><block type="playnote" id="/BIHP443hZ#*}e@N]c|7"><field name="output_number">23</field><field name="octave">4</field><field name="note">4</field></block></next></block></next></block></statement><value name="IF3"><block type="logic_operation" id="TL@|[1B#n!sxclyl)Z_="><field name="OP">AND</field><value name="A"><block type="logic_operation" id="P@FXhbs{9S~]K9D7,Pzt"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="q`3b(iHKhHHUAzhe6s;+"><field name="OP">LTE</field><value name="A"><block type="read_input" id="b|BZfM;:ZN#+lsfUu5kt"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="R@gk~Qm?t+fgsBVF/5kt"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value><value name="B"><block type="logic_compare" id="%:fU9=`-ssL.iUfVKS]K"><field name="OP">GTE</field><value name="A"><block type="read_input" id="r1gl2Rk[+RsU-..NC)}f"><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="1rP,yp*^02O7*d;5i}L."><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id=")7@/5cd9r{;{Js/lhv]d"><field name="OP">GTE</field><value name="A"><block type="read_input" id="B+U4RXS^TqTMt/)XJ+Bs"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="6kZB`!a|s38Sb,qiDp%2"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value></block></value><statement name="DO3"><block type="clear_screen" id="*)Il$`n^y@UX5Yx2MNju"><next><block type="print_screen" id="B+~*.z5)M*_p?I*-7Nj:"><value name="content"><block type="text" id="edziUX2l:X]Y9c%6I{WF"><field name="TEXT">F</field></block></value><next><block type="playnote" id="*?}ACE;*+FYjE9p2A1M3"><field name="output_number">23</field><field name="octave">4</field><field name="note">5</field></block></next></block></next></block></statement><value name="IF4"><block type="logic_operation" id="CR9h]]!5HnLn=o=;h:,y"><field name="OP">AND</field><value name="A"><block type="logic_operation" id="@4+2Zk^3CZeZi!pwz]_G"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="5[TKRSKf!E#*h?1NV.~R"><field name="OP">LTE</field><value name="A"><block type="read_input" id="A6$d*=~|M;N)(huby3Tt"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="A6{N)|J9o6uvPr/T|v!("><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value><value name="B"><block type="logic_compare" id="T2BS/aoWN8vwL_k,[vuJ"><field name="OP">GTE</field><value name="A"><block type="read_input" id="L)/L;0`s+))A2a{iT[[."><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="qc?ZkFGd@|)1KWffDfK4"><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id="lk7zBQB8ZRT~8T2U0yh#"><field name="OP">LTE</field><value name="A"><block type="read_input" id="q4E_GRhn;nSIom=/6]=/"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="5g_-`8*||y%8P#rSVw9?"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><statement name="DO4"><block type="clear_screen" id="dY)X[_oXP{{+n[33;:[O"><next><block type="print_screen" id="+gL,1}[Q2b66-h/@{om|"><value name="content"><block type="text" id="IpM`Y:WfU5SHM#}EZB(v"><field name="TEXT">G</field></block></value><next><block type="playnote" id="Ljab4QEChi)CS)IoacGq"><field name="output_number">23</field><field name="octave">4</field><field name="note">7</field></block></next></block></next></block></statement><value name="IF5"><block type="logic_operation" id="q{U#ip|7IXsL@1wdHJN9"><field name="OP">AND</field><value name="A"><block type="logic_operation" id="XOHC+n1@sH4s+#5.([qP"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="%q,]0bpjVQsdvn}Aq0Xx"><field name="OP">LTE</field><value name="A"><block type="read_input" id="UoqAvp!B:!_I+Jv@8RYQ"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="WpTKu@P3Q2#t;z^1j3f:"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value><value name="B"><block type="logic_compare" id="(*#g-86`OnB`sE+y^Xa3"><field name="OP">LTE</field><value name="A"><block type="read_input" id="_w30xmQQa$v,dk.y|$r%"><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="M8?X4!;0OHDIGATTXI/;"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id="{Zv)ahoI[;=$[rfBW-E9"><field name="OP">GTE</field><value name="A"><block type="read_input" id="[B2}ID8~~qD*hzjP`Xuj"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="zMpvhbP%@pftQv051l[["><field name="VAR" id="-tuM{5%LFLNbDH|yUo3w" variabletype="">I</field></block></value></block></value></block></value><statement name="DO5"><block type="clear_screen" id="AX_@v`Wa#?hl2^IMi11Y"><next><block type="print_screen" id="D$V+6V%%;]dtO0n6J7M6"><value name="content"><block type="text" id="rgo*R(:yN40x|A0FUIB5"><field name="TEXT">A</field></block></value><next><block type="playnote" id="du+0t1GmjavpN~1u.[e:"><field name="output_number">23</field><field name="octave">4</field><field name="note">9</field></block></next></block></next></block></statement><value name="IF6"><block type="logic_operation" id="W{i/Y}2$/NfZO`pgdZD^"><field name="OP">AND</field><value name="A"><block type="logic_operation" id="|`/ZUI`MWN=Ba6ese,AY"><field name="OP">AND</field><value name="A"><block type="logic_compare" id="xXHebN=YS7V;h-e$L]!o"><field name="OP">LTE</field><value name="A"><block type="read_input" id="Mm=G#kqF%SnXCL4`=aXo"><field name="input_number">34</field></block></value><value name="B"><block type="variables_get" id="~Ra0tsT#n;0na4S4so[["><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value><value name="B"><block type="logic_compare" id="_pW?Id[fq{6H/Vu`UvNv"><field name="OP">LTE</field><value name="A"><block type="read_input" id="PPc)2u-,fQl.-XDNSwIS"><field name="input_number">33</field></block></value><value name="B"><block type="variables_get" id="+/i@t!UwJu[2|w{gMHR3"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><value name="B"><block type="logic_compare" id="lGpnM}D)O~eUbYGs(*~*"><field name="OP">LTE</field><value name="A"><block type="read_input" id="o2[dhSa(w_U20hvF.uj8"><field name="input_number">32</field></block></value><value name="B"><block type="variables_get" id="NjIZB2Dw9nZaRogLg:if"><field name="VAR" id="KmeB3DN}`A0h*)kC;f:e" variabletype="">O</field></block></value></block></value></block></value><statement name="DO6"><block type="clear_screen" id="1]r_{AmWx5@?*t6A|@?O"><next><block type="print_screen" id="h7;-;k2,$k~QmRUJhx!+"><value name="content"><block type="text" id="42=/@%Zwa[#lZps(Wlcf"><field name="TEXT">B</field></block></value><next><block type="playnote" id="#]RxbAsqG.q+ON-eub:H"><field name="output_number">23</field><field name="octave">4</field><field name="note">11</field></block></next></block></next></block></statement><statement name="ELSE"><block type="clear_screen" id="$)Gst^5i]~Y}5Le(vDUc"><next><block type="print_screen" id="K](-tfCWLD),wppNPhs("><value name="content"><block type="text" id="?NBmO}XVWnM/arXYr,Uj"><field name="TEXT">-</field></block></value><next><block type="muteout" id="e)sR/R^zEUv`|tUa_ndH"><field name="pin">23</field></block></next></block></next></block></statement><next><block type="setserialrgb" id="eAb[amY_@il7(9s8#!OA"><field name="pin">26</field><value name="red"><block type="math_number" id="9laUbz1lEeD!r8OwNRxV"><field name="NUM">25</field></block></value><value name="green"><block type="math_number" id="5{_MLPmXVIq0s,*yE]),"><field name="NUM">25</field></block></value><value name="blue"><block type="math_number" id="#lGm:twWx/F7hwaCESsU"><field name="NUM">25</field></block></value><value name="index"><block type="math_number" id="jem=39AT,jn,HqgaU=ix"><field name="NUM">1</field></block></value><next><block type="setserialrgb" id="TH`IXdT=~STyG|M,jyCI"><field name="pin">26</field><value name="red"><block type="math_number" id="k5m_jW6vxO4KUyEDKILO"><field name="NUM">25</field></block></value><value name="green"><block type="math_number" id="E7Aj=fm=lT)@~`n!/v6}"><field name="NUM">25</field></block></value><value name="blue"><block type="math_number" id="ZO_o3LL4LY1@Z{Szab,M"><field name="NUM">25</field></block></value><value name="index"><block type="math_number" id="TBVs*aL[R.;95siU)[($"><field name="NUM">4</field></block></value><next><block type="setserialrgb" id="3Gs375VZW`yjWOQsg@,("><field name="pin">26</field><value name="red"><block type="math_number" id="Fg~;%w`rrB9Fu0x(4i+D"><field name="NUM">25</field></block></value><value name="green"><block type="math_number" id=")*@qzz#tggoJYD?#~;fa"><field name="NUM">25</field></block></value><value name="blue"><block type="math_number" id="X^,cf4/I+xDk:MW:9!`-"><field name="NUM">25</field></block></value><value name="index"><block type="math_number" id="`8U=jl7krR89qrASjdHE"><field name="NUM">8</field></block></value><next><block type="print_screen" id="Op@4:ZJ6JB6)g5`];xoB"><value name="content"><block type="text_join_str_num" id="W|RYJ@ht%{`%yflXpe=N"><value name="label"><block type="text" id="ZEx~O3-=vb:PRImNf^6q"><field name="TEXT">         IN 1:</field></block></value><value name="data"><block type="read_input" id="|rQ/Lzu,f-/v/iRwQJ(h"><field name="input_number">34</field></block></value></block></value><next><block type="print_screen" id="kC*G%T;3feCYt7~pmTmY"><value name="content"><block type="text_join_str_num" id="iw(OIfVb9fGWUijS;o#%"><value name="label"><block type="text" id="s`Utouz@|=*{69rYfw1}"><field name="TEXT"> IN 2:</field></block></value><value name="data"><block type="read_input" id="amob=47jK0Ilr/6~yekE"><field name="input_number">33</field></block></value></block></value><next><block type="print_screen" id="{KTGmV,%s]X9w[Tu#sTI"><value name="content"><block type="text_join_str_num" id="I?=xF*}S.mVj|AhlRezY"><value name="label"><block type="text" id="Ic:?c4fhO[4Kcm^=k)+|"><field name="TEXT"> IN 3:</field></block></value><value name="data"><block type="read_input" id="`}0FjRDfxIm1xlRQE2qE"><field name="input_number">32</field></block></value></block></value><next><block type="update_screen" id="KoQQ#HH2-+tJfBh2#h5B"></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>

Credits

TokyLabs Community

Posted by TL community

Comments

Please log in or sign up to comment.