Music and Drawing
Music
How do I play an instrument?
Check out all of the sound code blocks to see different instruments you can use. For example, you can use the {"func":"blockSoundPlayDrum"}
or the {"func":"blockSoundSetInstrument"}
blocks.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockSoundPlayDrum","values":[{"type":"choice","value":"37 Side Stick"},{"type":"number","value":"5"}],"containers":[],"next":{"func":"blockSoundSetInstrument","values":[{"type":"choice","value":"3 Electric Grand Piano"}],"containers":[],"next":{"func":"blockSoundPlayNote","values":[{"type":"number","value":"60"},{"type":"number","value":"0.5"}],"containers":[],"next":{"func":"blockSoundPlayNote","values":[{"type":"number","value":"65"},{"type":"number","value":"0.5"}],"containers":[],"next":{"func":"blockSoundPlayNote","values":[{"type":"number","value":"70"},{"type":"number","value":"0.5"}],"containers":[]}}}}}}
Add to my Backpack
Sample Projects:
Music maker
How do I add a soundtrack to my project?
Click on the Sounds tab in one of your Actor’s code. Then click on Add Sound to browse the Media Library.
How can you play a music file when you click an Actor?
Attach the {"func":"blockSoundPlay"}
below the {"func":"registerSpriteTrigger"}
block and select a sound. If there are no options to choose from, go add some sounds in the sounds tab!
Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"bounce"}],"containers":[]}}
Add to my Backpack
Sample Projects:
Rock Band, Evil Alien Planet
How can you keep playing a music file continuously?
Add a {"func":"blockSoundPlayUntilDone"}
block in the Stage’s code under the {"func":"registerFlagTrigger"}
block. If you want it to play forever, put it inside a forever loop.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockControlForever","values":[],"containers":[{"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":"Bedtime"}],"containers":[]}]}}
Add to my Backpack
Sample Projects:
Background Music, Four Seasons
{"func": "mcjava_blockSoundPlay","values": [{"type": "string","value": "add location block here"},{"type": "string","value": "soundType"},{"type": "string","value": "note"}]}
Play Sound (Minecraft)
"Play Sound" is a block that plays a Minecraft game sound from the specified location at the specified pitch.
Parameters:
Location: This parameter is the location in the Minecraft world that the sound will emanate from.
Sound type: This parameter defines which Minecraft sound file will play.
Note: This parameter determines which pitch the sound will be played at.
Related Blocks:
{"func":"blockWorldSpawnParticleAt"}
Sample Code:
{"func": "registerPlayerRightClicked","values": [{"type": "wrapper","func": "valueParam","name": "player"},{"type": "wrapper","func": "valueParam","name": "block"}],"next": {"func": "mcjava_blockSoundPlay","values": [{"type": "wrapper","func": "valueLocationFromEntityOrBlock","values": [{"type": "wrapper","func": "valueParam","name": "block"}]},{"type": "string","value": "entity_donkey_angry"},{"type": "string","value": "C1"}]}}
Add to my Backpack
{ "_id": "uDzLdMr9tn", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": "0.2" } ], "x": 40, "y": 409}
Tocar percusión
"Tocar percusión" reproduce el tipo de sonido de percusión especificado durante el número indicado de pulsos.
Parameters:
Tipo de percusión: este parámetro es el tipo de percusión que deseas reproducir. Hay muchas opciones para elegir.
NumPulsos: este parámetro es el tiempo que quieres que suene la percusión, en pulsos.
Related Blocks:
{"func":"blockSoundPlayDrumNonBlocking"},
{"func":"blockSoundRest"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "MGzZjX6MmJ", "func": "blockSoundSetTempo", "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "M2nhKVRu1W", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "TgPn7JAIrQ", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "42 Closed Hi Hat" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "5fGOfR3J5V", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "39 Hand Clap" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "47O3tJPsz2", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "42 Closed Hi Hat" }, { "type": "number", "value": 0.5 } ] } } } } }, "x": 88, "y": 86.83334350585932}
Add to my Backpack
{"func":"blockSoundPlayUntilDone"}
Play Sound Until Done
"Play Sound Until Done" plays the specified sound and waits until it is finished before continuing the script.
Parameters:
Soundtrack: This parameter should be one of the sounds you have added to the project under the "sounds" tab.
Related Blocks:
{"func":"blockSoundPlay"},
{"func":"blockSoundStopAll"}
Sample Code:
{"func":"registerSpriteTrigger","next":{"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":"female laugh"}]}}
Add to my Backpack
{ "_id": "uDzLdMr9tn", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": "0.2" } ], "x": 40, "y": 409}
Tocar percusión
"Tocar percusión" reproduce el tipo de sonido de percusión especificado durante el número indicado de pulsos.
Parameters:
Tipo de percusión: este parámetro es el tipo de percusión que deseas reproducir. Hay muchas opciones para elegir.
NumPulsos: este parámetro es el tiempo que quieres que suene la percusión, en pulsos.
Related Blocks:
{"func":"blockSoundPlayDrumNonBlocking"},
{"func":"blockSoundRest"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "MGzZjX6MmJ", "func": "blockSoundSetTempo", "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "M2nhKVRu1W", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "TgPn7JAIrQ", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "42 Closed Hi Hat" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "5fGOfR3J5V", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "39 Hand Clap" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "47O3tJPsz2", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "42 Closed Hi Hat" }, { "type": "number", "value": 0.5 } ] } } } } }, "x": 88, "y": 86.83334350585932}
Add to my Backpack
{ "_id": "8Lsck8PZOS", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.2" } ], "x": 59, "y": 471.00000000000006}
Silencio por pulsos
"Silencio por pulsos" deja de tocar sonidos durante el número especificado de pulsos.
Parameters:
NumPulsos: este parámetro es el número de pulsos que quieres hacer silencio.
Related Blocks:
{"func":"blockSoundPlayDrum"},
{"func":"blockSoundPlayDrumNonBlocking"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundPlayNoteNonBlocking"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "OB2UD6CiRg", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "J9JorQ257s", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "8VBFKK0btC", "func": "blockSoundPlayNoteNonBlocking", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "next": { "_id": "OowozOkubZ", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ] } } ] } }, "x": 43, "y": 505.8333435058594}
Add to my Backpack
{"func":"blockSoundPlay"}
Play Sound
"Play Sound" block plays the specified sound while the current script is executing.
Parameters:
Soundtrack: This parameter should be one of the sounds you have added to the project under the "sounds" tab.
Related Blocks:
{"func":"blockSoundPlayUntilDone"},
{"func":"blockSoundStopAll"}
Sample Code:
{"func":"registerBackgroundChange","values":[{"type":"string","value":"Game Over"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"gamesound8"}]}}
Add to my Backpack
{ "_id": "8Lsck8PZOS", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.2" } ], "x": 59, "y": 471.00000000000006}
Silencio por pulsos
"Silencio por pulsos" deja de tocar sonidos durante el número especificado de pulsos.
Parameters:
NumPulsos: este parámetro es el número de pulsos que quieres hacer silencio.
Related Blocks:
{"func":"blockSoundPlayDrum"},
{"func":"blockSoundPlayDrumNonBlocking"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundPlayNoteNonBlocking"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "OB2UD6CiRg", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "J9JorQ257s", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "8VBFKK0btC", "func": "blockSoundPlayNoteNonBlocking", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "next": { "_id": "OowozOkubZ", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ] } } ] } }, "x": 43, "y": 505.8333435058594}
Add to my Backpack
{ "_id": "lW06lQtl5z", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "x": 59, "y": 533}
Tocar nota
"Tocar nota" toca la nota especificada durante la cantidad indicada de pulsos.
Parameters:
Nota: este parámetro es una nota, indicada por un número. Cuanto mayor es el número, más aguda es la nota.
NumPulsos: este parámetro es la duración de la nota, en pulsos.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNoteNonBlocking"},
{"func":"blockSoundSetInstrument"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "Dnn5cnsfhJ", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ] } ] } }, "x": 371, "y": 449.5}
Add to my Backpack
{ "_id": "lW06lQtl5z", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "x": 59, "y": 533}
Tocar nota
"Tocar nota" toca la nota especificada durante la cantidad indicada de pulsos.
Parameters:
Nota: este parámetro es una nota, indicada por un número. Cuanto mayor es el número, más aguda es la nota.
NumPulsos: este parámetro es la duración de la nota, en pulsos.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNoteNonBlocking"},
{"func":"blockSoundSetInstrument"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "Dnn5cnsfhJ", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ] } ] } }, "x": 371, "y": 449.5}
Add to my Backpack
{ "_id": "IfwxsMjaKF", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "x": 40, "y": 645}
Fijar instrumento
"Fijar instrumento" configura como instrumento actual al instrumento especificado por el parámetro.
Parameters:
Instrumento: puedes elegir entre varias opciones de instrumentos para este parámetro, incluyendo "Gran piano acústico", "Xilofón", "Órgano percusivo" y otros.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundPlayNoteNonBlocking"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 2 } ], "next": { "_id": "kQcoYwoLOL", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "41 Violin" } ], "next": { "_id": "0rWZF6xlaE", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": 64 }, { "type": "number", "value": 2 } ] } } } }, "x": 355.00000000000006, "y": 522.2999999999979}
Add to my Backpack
{"func":"blockSoundChangeVolume"}
Change Volume
"Change Volume" increments the volume by the number specified.
Parameters:
Volume Change: "Change Volume" will increment the volume by the number specified by this parameter. Use a negative number to make the volume lower.
Related Blocks:
{"func":"blockSoundSetVolume"},
{"func":"valueSoundVolume"}
Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlRepeatUntil","values":[{"type":"wrapper","func":"valueOpNot","values":[{"type":"wrapper","func":"valueVar","name":"Playing"}]}],"containers":[{"func":"blockSoundChangeVolume","values":[{"type":"number","value":"1"}]}]}}
Add to my Backpack
{ "_id": "IfwxsMjaKF", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "x": 40, "y": 645}
Fijar instrumento
"Fijar instrumento" configura como instrumento actual al instrumento especificado por el parámetro.
Parameters:
Instrumento: puedes elegir entre varias opciones de instrumentos para este parámetro, incluyendo "Gran piano acústico", "Xilofón", "Órgano percusivo" y otros.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundPlayNoteNonBlocking"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 2 } ], "next": { "_id": "kQcoYwoLOL", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "41 Violin" } ], "next": { "_id": "0rWZF6xlaE", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": 64 }, { "type": "number", "value": 2 } ] } } } }, "x": 355.00000000000006, "y": 522.2999999999979}
Add to my Backpack
{"func":"blockSoundSetVolume"}
Set Volume
"Set Volume" sets the volume as the specified percentage.
Parameters:
Percentage: This parameter is the percentage of the maximum volume that the volume will be set to. The maximum value is 100.
Related Blocks:
{"func":"blockSoundChangeVolume"},
{"func":"valueSoundVolume"}
Sample Code:
{"func":"registerSpriteTrigger","next":{"func":"blockSoundSetVolume","values":[{"type":"number","value":"100"}],"next":{"func":"blockSoundSetTempo","values":[{"type":"number","value":"60"}],"next":{"func":"blockSoundPlayDrum","values":[{"type":"choice","value":"35 Acoustic Bass Drum"},{"type":"number","value":"0.2"}]}}}}
Add to my Backpack
{ "_id": "HisLeshTxo", "func": "blockSoundChangeTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": "20" } ], "x": 40, "y": 704}
Cambiar tempo
"Cambiar tempo" cambia el tempo del proyecto al número especificado de pulsos por minutos.
Parameters:
Cambio de tempo: el tempo aumentará en este valor. Utiliza un valor negativo para hacer el tempo más lento.
Related Blocks:
{"func":"blockSoundSetTempo"},
{"func":"valueSoundTempo"}
Sample Code:
{"func":"blockSoundChangeTempo","values":[{"type":"number","value":"20"}],"next":{"func":"blockSoundRest","values":[{"type":"number","value":"0.2"}],"next":{"func":"blockSoundSetInstrument","values":[{"type":"choice","value":"1 Acoustic Grand Piano"}],"next":{"func":"blockSoundPlayNote","values":[{"type":"number","value":"60"},{"type":"number","value":"10"}]}}}}
Add to my Backpack
{ "_id": "HisLeshTxo", "func": "blockSoundChangeTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": "20" } ], "x": 40, "y": 704}
Cambiar tempo
"Cambiar tempo" cambia el tempo del proyecto al número especificado de pulsos por minutos.
Parameters:
Cambio de tempo: el tempo aumentará en este valor. Utiliza un valor negativo para hacer el tempo más lento.
Related Blocks:
{"func":"blockSoundSetTempo"},
{"func":"valueSoundTempo"}
Sample Code:
{"func":"blockSoundChangeTempo","values":[{"type":"number","value":"20"}],"next":{"func":"blockSoundRest","values":[{"type":"number","value":"0.2"}],"next":{"func":"blockSoundSetInstrument","values":[{"type":"choice","value":"1 Acoustic Grand Piano"}],"next":{"func":"blockSoundPlayNote","values":[{"type":"number","value":"60"},{"type":"number","value":"10"}]}}}}
Add to my Backpack
{"func":"valueSoundVolume"}
Volume
"Volume" returns the project’s current volume.
Parameters:
None.
Related Blocks:
{"func":"blockSoundChangeVolume"},
{"func":"blockSoundSetVolume"}
Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueSoundVolume"},{"type":"string","value":"100"}]}],"containers":[{"func":"blockSoundSetVolume","values":[{"type":"number","value":"0"}]}]}
Add to my Backpack
{ "_id": "9M6kv6NS7L", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": "60" } ], "x": 39.999999999999986, "y": 763}
Fijar tempo
"Fijar tempo" establece el número de pulsos por minutos indicado como tempo del proyecto.
Parameters:
BPM: el tempo se establece al valor de este parámetro, un número que indica cuántos pulsos por minuto (Beats Per Minute) van a sonar tus instrumentos.
Related Blocks:
{"func":"blockSoundChangeTempo"},
{"func":"valueSoundTempo"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "zGaeAo7gdw", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "Dnn5cnsfhJ", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 1 } ] } } ] } }, "x": 355.00000000000006, "y": 522.2999999999979}
Add to my Backpack
{ "_id": "9M6kv6NS7L", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": "60" } ], "x": 39.999999999999986, "y": 763}
Fijar tempo
"Fijar tempo" establece el número de pulsos por minutos indicado como tempo del proyecto.
Parameters:
BPM: el tempo se establece al valor de este parámetro, un número que indica cuántos pulsos por minuto (Beats Per Minute) van a sonar tus instrumentos.
Related Blocks:
{"func":"blockSoundChangeTempo"},
{"func":"valueSoundTempo"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "zGaeAo7gdw", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "Dnn5cnsfhJ", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 1 } ] } } ] } }, "x": 355.00000000000006, "y": 522.2999999999979}
Add to my Backpack
{ "_id": "0veRweuSc5", "type": "wrapper", "func": "valueSoundTempo", "tags": [ "music" ], "values": [], "x": 40, "y": 822}
Tempo
"Tempo" devuelve el tempo actual del proyecto.
Parameters:
Ninguno.
Related Blocks:
{"func":"blockSoundChangeTempo"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "YkrjRo2AXc", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "vap1C3OpQ7", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": 150 } ], "next": { "_id": "tHJwVDiz6G", "func": "blockLooksSayFor", "tags": [ "bubble", "talk", "output", "time" ], "values": [ { "_id": "NJnJFgfFt8", "type": "wrapper", "func": "valueSoundTempo", "tags": [ "music" ], "values": [] }, { "type": "number", "value": "2" } ] } }, "x": 26, "y": 741}
Add to my Backpack
{ "_id": "0veRweuSc5", "type": "wrapper", "func": "valueSoundTempo", "tags": [ "music" ], "values": [], "x": 40, "y": 822}
Tempo
"Tempo" devuelve el tempo actual del proyecto.
Parameters:
Ninguno.
Related Blocks:
{"func":"blockSoundChangeTempo"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "YkrjRo2AXc", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "vap1C3OpQ7", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": 150 } ], "next": { "_id": "tHJwVDiz6G", "func": "blockLooksSayFor", "tags": [ "bubble", "talk", "output", "time" ], "values": [ { "_id": "NJnJFgfFt8", "type": "wrapper", "func": "valueSoundTempo", "tags": [ "music" ], "values": [] }, { "type": "number", "value": "2" } ] } }, "x": 26, "y": 741}
Add to my Backpack
{"func":"blockSoundPlayUntilDone"}
Tocar sonido hasta que termine
"Tocar sonido hasta que termine" reproduce el sonido especificado y espera a que termine de sonar antes de continuar con la secuencia de comandos.
Parameters:
Banda de sonido: este parámetro debe ser uno de los sonidos que añadiste al proyecto en la pestaña "Sonidos".
Related Blocks:
{"func":"blockSoundPlay"},
{"func":"blockSoundStopAll"}
Sample Code:
{"func":"registerSpriteTrigger","next":{"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":"female laugh"}]}}
Add to my Backpack
{"func":"blockSoundPlayUntilDone"}
Tocar sonido hasta que termine
"Tocar sonido hasta que termine" reproduce el sonido especificado y espera a que termine de sonar antes de continuar con la secuencia de comandos.
Parameters:
Banda de sonido: este parámetro debe ser uno de los sonidos que añadiste al proyecto en la pestaña "Sonidos".
Related Blocks:
{"func":"blockSoundPlay"},
{"func":"blockSoundStopAll"}
Sample Code:
{"func":"registerSpriteTrigger","next":{"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":"female laugh"}]}}
Add to my Backpack
{"func":"blockSoundPlay"}
Tocar sonido
El bloque "tocar sonido" reproduce el sonido especificado mientras se ejecuta la secuencia de comandos actual.
Parameters:
Banda de sonido: este parámetro debe ser uno de los sonidos que añadiste al proyecto en la pestaña "Sonidos".
Related Blocks:
{"func":"blockSoundPlayUntilDone"},
{"func":"blockSoundStopAll"}
Sample Code:
{"func":"registerBackgroundChange","values":[{"type":"string","value":"Game Over"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"gamesound8"}]}}
Add to my Backpack
{"func":"blockSoundPlay"}
Tocar sonido
El bloque "tocar sonido" reproduce el sonido especificado mientras se ejecuta la secuencia de comandos actual.
Parameters:
Banda de sonido: este parámetro debe ser uno de los sonidos que añadiste al proyecto en la pestaña "Sonidos".
Related Blocks:
{"func":"blockSoundPlayUntilDone"},
{"func":"blockSoundStopAll"}
Sample Code:
{"func":"registerBackgroundChange","values":[{"type":"string","value":"Game Over"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"gamesound8"}]}}
Add to my Backpack
{"func":"blockSoundChangeVolume"}
Cambiar volumen
"Cambiar volumen" incrementa el volumen en el valor indicado.
Parameters:
Cambiar volumen: "Cambiar volumen" incrementará el volumen en la cantidad indicada en este parámetro. Utiliza un número negativo para bajar el volumen.
Related Blocks:
{"func":"blockSoundSetVolume"},
{"func":"valueSoundVolume"}
Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlRepeatUntil","values":[{"type":"wrapper","func":"valueOpNot","values":[{"type":"wrapper","func":"valueVar","name":"Playing"}]}],"containers":[{"func":"blockSoundChangeVolume","values":[{"type":"number","value":"1"}]}]}}
Add to my Backpack
{"func":"blockSoundChangeVolume"}
Cambiar volumen
"Cambiar volumen" incrementa el volumen en el valor indicado.
Parameters:
Cambiar volumen: "Cambiar volumen" incrementará el volumen en la cantidad indicada en este parámetro. Utiliza un número negativo para bajar el volumen.
Related Blocks:
{"func":"blockSoundSetVolume"},
{"func":"valueSoundVolume"}
Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlRepeatUntil","values":[{"type":"wrapper","func":"valueOpNot","values":[{"type":"wrapper","func":"valueVar","name":"Playing"}]}],"containers":[{"func":"blockSoundChangeVolume","values":[{"type":"number","value":"1"}]}]}}
Add to my Backpack
{"func":"blockSoundSetVolume"}
Fijar volumen
"Fijar volumen" fija el volumen al porcentaje especificado.
Parameters:
Porcentaje: este parámetro es el porcentaje en que aumentará el volumen. Utiliza un número menor a 100 para disminuir el volumen.
Related Blocks:
{"func":"blockSoundChangeVolume"},
{"func":"valueSoundVolume"}
Sample Code:
{"func":"registerSpriteTrigger","next":{"func":"blockSoundSetVolume","values":[{"type":"number","value":"100"}],"next":{"func":"blockSoundSetTempo","values":[{"type":"number","value":"60"}],"next":{"func":"blockSoundPlayDrum","values":[{"type":"choice","value":"35 Acoustic Bass Drum"},{"type":"number","value":"0.2"}]}}}}
Add to my Backpack
{"func":"blockSoundSetVolume"}
Fijar volumen
"Fijar volumen" fija el volumen al porcentaje especificado.
Parameters:
Porcentaje: este parámetro es el porcentaje en que aumentará el volumen. Utiliza un número menor a 100 para disminuir el volumen.
Related Blocks:
{"func":"blockSoundChangeVolume"},
{"func":"valueSoundVolume"}
Sample Code:
{"func":"registerSpriteTrigger","next":{"func":"blockSoundSetVolume","values":[{"type":"number","value":"100"}],"next":{"func":"blockSoundSetTempo","values":[{"type":"number","value":"60"}],"next":{"func":"blockSoundPlayDrum","values":[{"type":"choice","value":"35 Acoustic Bass Drum"},{"type":"number","value":"0.2"}]}}}}
Add to my Backpack
{"func":"valueSoundVolume"}
Volumen
"Volumen" devuelve el volumen actual del proyecto.
Parameters:
Ninguno.
Related Blocks:
{"func":"blockSoundChangeVolume"},
{"func":"blockSoundSetVolume"}
Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueSoundVolume"},{"type":"string","value":"100"}]}],"containers":[{"func":"blockSoundSetVolume","values":[{"type":"number","value":"0"}]}]}
Add to my Backpack
{"func":"valueSoundVolume"}
Volumen
"Volumen" devuelve el volumen actual del proyecto.
Parameters:
Ninguno.
Related Blocks:
{"func":"blockSoundChangeVolume"},
{"func":"blockSoundSetVolume"}
Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueSoundVolume"},{"type":"string","value":"100"}]}],"containers":[{"func":"blockSoundSetVolume","values":[{"type":"number","value":"0"}]}]}
Add to my Backpack
{"func":"blockTynkerVMSetTempo","values":[{"type":"number","value":"120"}]}
Set Tempo To Beats Per Minute
"Set Tempo" will set the tempo of the micro:bit to the given value.
Parameters:
Number: This parameter sets the tempo.
Related Blocks:
{"func":"blockTynkerVMRest"},
{"func":"blockTynkerVMPlayNote"},
{"func":"blockTynkerVMPlaySong"},
{"func":"blockTynkerVMPlayFrequency"}
Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockTynkerVMSetTempo","values":[{"type":"number","value":"120"}],"next":{"func":"blockTynkerVMPlayNote","values":[{"type":"number","value":"40"},{"type":"number","value":"0"},{"type":"number","value":"4"}]}}}
Add to my Backpack
{"func":"blockTynkerVMRest","values":[{"type":"number","value":"4"}]}
Play A Rest For Beats
"Play Rest" will play a rest for the given amount of beats.
Parameters:
Number: This determines how many beats to rest for.
Related Blocks:
{"func":"blockTynkerVMSetTempo"},
{"func":"blockTynkerVMPlayNote"},
{"func":"blockTynkerVMPlaySong"},
{"func":"blockTynkerVMPlayFrequency"}
Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockTynkerVMSetTempo","values":[{"type":"number","value":"120"}],"next":{"func":"blockTynkerVMRest","values":[{"type":"number","value":"4"}]}}}
Add to my Backpack
{"func":"blockTynkerVMPlayNote","values":[{"type":"number","value":"40"},{"type":"number","value":"0"},{"type":"number","value":"4"}]}
Play Note On Pin For Beats
"Play Note" will play the given note for the given amount of beats.
Parameters:
Number1: This determines which note to play.
Number2: This parameter determines which pin to play the note on.
Number3: This parameter determines how many beats to play the note for.
Related Blocks:
{"func":"blockTynkerVMSetTempo"},
{"func":"blockTynkerVMRest"},
{"func":"blockTynkerVMPlaySong"},
{"func":"blockTynkerVMPlayFrequency"}
Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockTynkerVMSetTempo","values":[{"type":"number","value":"120"}],"next":{"func":"blockTynkerVMPlayNote","values":[{"type":"number","value":"40"},{"type":"number","value":"0"},{"type":"number","value":"4"}]}}}
Add to my Backpack
{"func":"blockTynkerVMPlaySong","values":[{"type":"string","value":"fur elise"},{"type":"number","value":"0"}]}
Play Song On Pin
"Play Song" will play the given song on the given pin.
Parameters:
Number: This parameter determines which pin to play the note on.
Related Blocks:
{"func":"blockTynkerVMSetTempo"},
{"func":"blockTynkerVMRest"},
{"func":"blockTynkerVMPlayNote"},
{"func":"blockTynkerVMPlayFrequency"}
Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockTynkerVMPlaySong","values":[{"type":"string","value":"fur elise"},{"type":"number","value":"0"}]}}
Add to my Backpack
{"func":"blockTynkerVMPlayFrequency","values":[{"type":"number","value":"261.6"},{"type":"number","value":"0"},{"type":"number","value":2000}]}
Play Frequency Hz On Pin For Ms
"Play Frequency" will play the given frequency for the given amount of time.
Parameters:
Number1: This determines which frequency to play.
Number2: This parameter determines which pin to play the frequency on.
Number3: This parameter determines how long to play the frequency for.
Related Blocks:
{"func":"blockTynkerVMSetTempo"},
{"func":"blockTynkerVMRest"},
{"func":"blockTynkerVMPlayNote"},
{"func":"blockTynkerVMPlaySong"}
Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockTynkerVMPlayFrequency","values":[{"type":"number","value":"261.6"},{"type":"number","value":"0"},{"type":"number","value":2000}]}}
Add to my Backpack
{ "_id": "uDzLdMr9tn", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": "0.2" } ], "x": 40, "y": 409}
Play Drum for Beats until done
"Play Drum for Beats until done" plays the specified kind of drum for the specified number of beats, and waits until it is finished before continuing the script.
Parameters:
Drum type: This parameter is the type of drum you want to play. There are many options to choose from.
NumBeats: This parameter is the number of beats you want the drum to play for.
Related Blocks:
{"func":"blockSoundPlayDrumNonBlocking"},
{"func":"blockSoundRest"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "MGzZjX6MmJ", "func": "blockSoundSetTempo", "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "M2nhKVRu1W", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "TgPn7JAIrQ", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "42 Closed Hi Hat" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "5fGOfR3J5V", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "39 Hand Clap" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "47O3tJPsz2", "func": "blockSoundPlayDrum", "values": [ { "type": "choice", "value": "42 Closed Hi Hat" }, { "type": "number", "value": 0.5 } ] } } } } }, "x": 88, "y": 86.83334350585932}
Add to my Backpack
{ "_id": "AW3YrKZCtD", "func": "blockSoundPlayDrumNonBlocking", "tags": [ "music" ], "values": [ { "type": "choice", "value": "35 Acoustic Bass Drum" }, { "type": "number", "value": "0.2" } ], "x": 40, "y": 350}
Play Drum for Beats
"Play Drum for Beats" plays the specified kind of drum for the specified number of beats while the current script is executing.
Parameters:
Drum type: This parameter is the type of drum you want to play. There are many options to choose from.
NumBeats: This parameter is the number of beats you want the drum to play for.
Related Blocks:
{"func":"blockSoundPlayDrum"},
{"func":"blockSoundRest"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "MGzZjX6MmJ", "func": "blockSoundSetTempo", "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "3Xa0028wPj", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "gjSTV3nVSf", "func": "blockSoundPlayDrumNonBlocking", "tags": [ "music" ], "values": [ { "type": "choice", "value": "51 Ride Cymbal 1" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "9qLFMaEpeS", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ], "next": { "_id": "QMSOtiP7EL", "func": "blockSoundPlayDrumNonBlocking", "tags": [ "music" ], "values": [ { "type": "choice", "value": "51 Ride Cymbal 1" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "aq0kXeQLbz", "func": "blockSoundPlayDrumNonBlocking", "tags": [ "music" ], "values": [ { "type": "choice", "value": "44 Pedal Hi-Hat" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "5VMGIes6S5", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ] } } } } } ] } }, "x": 88, "y": 6.149999999999949}
Add to my Backpack
{ "_id": "8Lsck8PZOS", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.2" } ], "x": 59, "y": 471.00000000000006}
Rest for Beats
"Rest for Beats" stops playing for the specified number of beats, and waits until that number of beats has passed before continuing the script.
Parameters:
NumBeats: This parameter is the number of beats you want the drums or instrument to rest for.
Related Blocks:
{"func":"blockSoundPlayDrum"},
{"func":"blockSoundPlayDrumNonBlocking"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundPlayNoteNonBlocking"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "OB2UD6CiRg", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "J9JorQ257s", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "8VBFKK0btC", "func": "blockSoundPlayNoteNonBlocking", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "next": { "_id": "OowozOkubZ", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ] } } ] } }, "x": 43, "y": 505.8333435058594}
Add to my Backpack
{ "_id": "lW06lQtl5z", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "x": 59, "y": 533}
Play Note for Beats until done
"Play Note for Beats until done" plays the specified note for the specified number of beats and waits until it is finished before continuing the script.
Parameters:
Pitch: This parameter is a number indicating how high or low you want to play a note on the scale.
NumBeats: This parameter is the number of beats you want to note to play.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNoteNonBlocking"},
{"func":"blockSoundSetInstrument"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "Dnn5cnsfhJ", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ] } ] } }, "x": 371, "y": 449.5}
Add to my Backpack
{ "_id": "RmazaVF7o5", "func": "blockSoundPlayNoteNonBlocking", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "x": 399, "y": 523}
Play Note for Beats
"Play Note for Beats" plays the specified note for the specified number of beats while the script is executing.
Parameters:
Pitch: This parameter is a number indicating how high or low you want to play a note on the scale.
NumBeats: This parameter is the number of beats you want to note to play.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundSetInstrument"}
Sample Code:
{ "_id": "yJZioVqweQ", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "OB2UD6CiRg", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "J9JorQ257s", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "8VBFKK0btC", "func": "blockSoundPlayNoteNonBlocking", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": "0.5" } ], "next": { "_id": "OowozOkubZ", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ] } } ] } }, "x": 43, "y": 505.8333435058594}
Add to my Backpack
{ "_id": "IfwxsMjaKF", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "x": 40, "y": 645}
Set Instrument to
"Set Instrument to" sets the current instrument to the instrument specified by the parameter.
Parameters:
Instrument: you have many instrument options to choose from for this parameter, including "Acoustic Grand Piano," "Xylophone," "Percussive Organ," and more.
Related Blocks:
{"func":"blockSoundRest"},
{"func":"blockSoundPlayNote"},
{"func":"blockSoundPlayNoteNonBlocking"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 2 } ], "next": { "_id": "kQcoYwoLOL", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "41 Violin" } ], "next": { "_id": "0rWZF6xlaE", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": 64 }, { "type": "number", "value": 2 } ] } } } }, "x": 355.00000000000006, "y": 522.2999999999979}
Add to my Backpack
{ "_id": "HisLeshTxo", "func": "blockSoundChangeTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": "20" } ], "x": 40, "y": 704}
Change Tempo by
"Change Tempo by" changes the project's tempo by the specified number of beats per minute.
Parameters:
Tempo Change: The tempo will increase by this number. Use a negative number to make the tempo slower.
Related Blocks:
{"func":"blockSoundSetTempo"},
{"func":"valueSoundTempo"}
Sample Code:
{"func":"blockSoundChangeTempo","values":[{"type":"number","value":"20"}],"next":{"func":"blockSoundRest","values":[{"type":"number","value":"0.2"}],"next":{"func":"blockSoundSetInstrument","values":[{"type":"choice","value":"1 Acoustic Grand Piano"}],"next":{"func":"blockSoundPlayNote","values":[{"type":"number","value":"60"},{"type":"number","value":"10"}]}}}}
Add to my Backpack
{ "_id": "9M6kv6NS7L", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": "60" } ], "x": 39.999999999999986, "y": 763}
Set Tempo to BPM
"Set Tempo to BPM" sets the project's tempo to the specified number of beats per minute.
Parameters:
BPM: The tempo will be set to this parameter, a number that indicates how many beats per minute your instruments should play.
Related Blocks:
{"func":"blockSoundChangeTempo"},
{"func":"valueSoundTempo"}
Sample Code:
{ "_id": "RmU1msccWf", "func": "registerSpriteTrigger", "values": [], "next": { "_id": "zGaeAo7gdw", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": 120 } ], "next": { "_id": "Dnn5cnsfhJ", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "QQijUSuS6M", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "SQc7N7xS4v", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 1 } ] } } ] } }, "x": 355.00000000000006, "y": 522.2999999999979}
Add to my Backpack
{ "_id": "0veRweuSc5", "type": "wrapper", "func": "valueSoundTempo", "tags": [ "music" ], "values": [], "x": 40, "y": 822}
Tempo
"Tempo" returns the current project's tempo
Parameters:
None.
Related Blocks:
{"func":"blockSoundChangeTempo"},
{"func":"blockSoundSetTempo"}
Sample Code:
{ "_id": "YkrjRo2AXc", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "vap1C3OpQ7", "func": "blockSoundSetTempo", "tags": [ "music" ], "values": [ { "type": "number", "value": 150 } ], "next": { "_id": "tHJwVDiz6G", "func": "blockLooksSayFor", "tags": [ "bubble", "talk", "output", "time" ], "values": [ { "_id": "NJnJFgfFt8", "type": "wrapper", "func": "valueSoundTempo", "tags": [ "music" ], "values": [] }, { "type": "number", "value": "2" } ] } }, "x": 26, "y": 741}
Add to my Backpack
{ "_id": "0iPMwV8sna", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Reverb" }, { "type": "number", "value": "100" } ], "x": 56, "y": 1023.6666870117188}
Set Effect to
"Set Effect to" sets the specified audio effect to the specified value.
Parameters:
Effect: This parameter indicates what type of audio effect you want to set. Options include "reverb", "echo", and "distortion".
Intensity: This parameter is a number that indicates the intensity of the effect.
Related Blocks:
{"func":"blockChangeEffectBy"},
{"func":"blockClearEffects"}
Sample Code:
{ "_id": "YkrjRo2AXc", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "4Zg66iWey0", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "type": "choice", "value": "1 Acoustic Grand Piano" } ], "next": { "_id": "Z3HCHOk6qS", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Reverb" }, { "type": "number", "value": 0 } ], "next": { "_id": "w8qOL7Qbe5", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 1 } ], "next": { "_id": "7kZeCU3Z3H", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 1 } ], "next": { "_id": "l9Bm9uHunV", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Reverb" }, { "type": "number", "value": "100" } ], "next": { "_id": "z9FIB2tNFN", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": 60 }, { "type": "number", "value": 1 } ] } } } } } }, "x": 26, "y": 746.7249999999988}
Add to my Backpack
{ "_id": "OqdAF9w61M", "func": "blockChangeEffectBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Reverb" }, { "type": "number", "value": "10" } ], "x": 42, "y": 1095}
Change Effect by
"Change Effect by" changes the specified audio effect by the specified value.
Parameters:
Effect: This parameter indicates what type of audio effect you want to set. Options include "reverb", "echo", and "distortion".
Intensity: This parameter is a number that indicates the intensity of the effect.
Related Blocks:
{"func":"blockSetEffectTo"},
{"func":"blockClearEffects"}
Sample Code:
{ "_id": "3o5UBW1qUX", "func": "registerFlagTrigger", "values": [], "next": { "_id": "RDVBtoeNK5", "func": "blockClearEffects", "tags": [ "music" ], "values": [], "next": { "_id": "Va1wYOmr1S", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Distortion" }, { "type": "number", "value": 0 } ], "next": { "_id": "wzSe3I52MG", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "cAqicZy9xc", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "45 Low Tom" }, { "type": "number", "value": 1 } ], "next": { "_id": "llkG7IC8nL", "func": "blockChangeEffectBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Distortion" }, { "type": "number", "value": 25 } ] } } ] } } }, "x": 54.00000000000006, "y": 1325.3333740234375}
Add to my Backpack
{ "_id": "8vhPYhUXmM", "func": "blockClearEffects", "tags": [ "music" ], "values": [], "x": 48, "y": 1159.3333740234375}
Clear Effects
"Clear Effects" resets all the audio effects of the current script.
Parameters:
None.
Related Blocks:
{"func":"blockSetEffectTo"},
{"func":"blockChangeEffectBy"}
Sample Code:
{ "_id": "JxxXkdx2PM", "func": "registerFlagTrigger", "values": [], "next": { "_id": "UexetZ15Zo", "func": "blockClearEffects", "tags": [ "music" ], "values": [], "next": { "_id": "Gc9mROvUy0", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Distortion" }, { "type": "number", "value": 50 } ], "next": { "_id": "xhFXdMrvEq", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "45 Low Tom" }, { "type": "number", "value": 2 } ], "next": { "_id": "KG8YfMxREq", "func": "blockClearEffects", "tags": [ "music" ], "values": [], "next": { "_id": "d5c0vGdNnc", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Echo" }, { "type": "number", "value": 50 } ], "next": { "_id": "EnxWGRDRo4", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "45 Low Tom" }, { "type": "number", "value": 2 } ] } } } } } }, "x": 366, "y": 1608.5}
Add to my Backpack
{ "_id": "LB7Bynxzbg", "func": "blockSetEchoDelayTo", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "x": 34, "y": 1243.6666870117188}
Set Echo Delay to Beats
"Set Echo Delay to Beats" sets the echo delay time of the echo effect to the specified number of beats.
Parameters:
NumBeats: this parameter will determine how many beats behind a played note the echo will be.
Related Blocks:
{"func":"blockSetEffectTo"},
{"func":"blockChangeEffectBy"},
{"func":"blockClearEffects"}
Sample Code:
{ "_id": "JxxXkdx2PM", "func": "registerFlagTrigger", "values": [], "next": { "_id": "UexetZ15Zo", "func": "blockClearEffects", "tags": [ "music" ], "values": [], "next": { "_id": "d5c0vGdNnc", "func": "blockSetEffectTo", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Echo" }, { "type": "number", "value": 50 } ], "next": { "_id": "t4xXRBwBoj", "func": "blockControlScriptVar", "tags": [ "variable", "variables" ], "cat": "var", "label": "script variables {scriptvar:i}{varargs:valueScriptVar}", "values": [ { "_id": "SaYlSg06tA", "type": "wrapper", "func": "valueScriptVar", "name": "i" } ], "next": { "_id": "BkJFIyVPZq", "func": "blockVarSet", "tags": [ "variable", "variables" ], "values": [ { "type": "string", "value": "i" }, { "type": "string", "value": "1" } ], "next": { "_id": "IJWs84OVs6", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": "10" } ], "containers": [ { "_id": "EnxWGRDRo4", "func": "blockSoundPlayDrum", "tags": [ "music" ], "values": [ { "type": "choice", "value": "45 Low Tom" }, { "type": "number", "value": 2 } ], "next": { "_id": "OrQJtmf3pT", "func": "blockSetEchoDelayTo", "tags": [ "music" ], "values": [ { "_id": "tjKcVlK0nM", "type": "wrapper", "func": "valueOpDivide", "tags": [ "divide by", "division" ], "values": [ { "type": "number", "value": 1 }, { "_id": "aIKypfza4k", "type": "wrapper", "func": "valueScriptVar", "name": "i" } ] } ], "next": { "_id": "NHpAi2Lt2t", "func": "blockVarChangeBy", "tags": [ "variable", "variables" ], "values": [ { "type": "string", "value": "i" }, { "type": "number", "value": "1" } ] } } } ] } } } } }, "x": 19, "y": 1670.5}
Add to my Backpack
{ "_id": "juXqLFkKAr", "func": "blockSynthOnFor", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "x": 82, "y": 1392.3333435058594}
Synth On for Beats
"Synth On for Beats" turns the synth on and plays its current note for the specified number of beats, while the script is executing.
Parameters:
NumBeats: this parameter will determine how many beats you want to turn the synth on for.
Related Blocks:
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOn"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "oQAURE5Q1j", "func": "registerFlagTrigger", "values": [], "next": { "_id": "a3xL4zjhEy", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "VMpeLDSYOi", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "6ir0OR0Q97", "func": "blockSynthOnFor", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "6jQzor1ssX", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ], "next": { "_id": "cn4B2cr44T", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "64" } ], "next": { "_id": "H8Ifq9tDkr", "func": "blockSynthOnFor", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "vjmalWxQoA", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 0.5 } ] } } } } } } ] }, "x": 38, "y": 126}
Add to my Backpack
{ "_id": "HYhvwCmXZ9", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "x": 51, "y": 1465}
Synth On For Beats and Wait
"Synth On For Beats and Wait" turns the synth on and plays its current note for the specified number of beats and waits until it is finished before continuing the script.
Parameters:
NumBeats: this parameter will determine how many beats you want to turn the synth on for.
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOn"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "qkmU9p86kc", "func": "registerFlagTrigger", "values": [], "next": { "_id": "mNh10ofxL2", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Note" }, { "type": "number", "value": "60" } ], "next": { "_id": "h7K822fILP", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "EfKxqDSrAG", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Note" }, { "type": "number", "value": 64 } ], "next": { "_id": "iMmVHPDjO3", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ] } } } }, "x": 241, "y": 2136.5}
Add to my Backpack
{ "_id": "q30CpV6Asl", "func": "blockSynthOn", "tags": [ "music" ], "values": [], "x": 51, "y": 1544.3333435058594}
Synth On
"Synth On" turns the synth on and plays its current note until the synth is turned off.
Parameters:
None.
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "fXaVf8Yr7K", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "9vNBN2Vqqx", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "Y0b6SiDFpZ", "func": "blockSynthOn", "tags": [ "music" ], "values": [], "next": { "_id": "kYT6kHoRNx", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 4 } ], "next": { "_id": "wz0pfyoY8J", "func": "blockSynthOff", "tags": [ "music" ], "values": [] } } } }, "x": 378, "y": 138}
Add to my Backpack
{ "_id": "J1zcwJPYX4", "func": "blockSynthOff", "tags": [ "music" ], "values": [], "x": 54, "y": 1602.6666870117188}
Synth Off
"Synth Off" turns the synth off.
Parameters:
None.
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "fXaVf8Yr7K", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "9vNBN2Vqqx", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "Y0b6SiDFpZ", "func": "blockSynthOn", "tags": [ "music" ], "values": [], "next": { "_id": "kYT6kHoRNx", "func": "blockSoundRest", "tags": [ "music" ], "values": [ { "type": "number", "value": 4 } ], "next": { "_id": "wz0pfyoY8J", "func": "blockSynthOff", "tags": [ "music" ], "values": [] } } } }, "x": 378, "y": 138}
Add to my Backpack
{ "_id": "0vcrMgRyAH", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Note" }, { "type": "number", "value": "60" } ], "x": 57, "y": 1678}
Synth Set To
"Synth Set To" sets the synth's pitch or frequency to the specified value.
Parameters:
NoteType: This parameter will determine if the synth will play a note using "pitch" or "frequency". When playing a note using "pitch", the notes may be perceived on a musical scale. When playing a note using "frequency", the notes are not necessarily related in this way, and can fall inbetween the pitches in a musical scale as well.
Value: This parameter will set the synth's pitch or frequency to the specified value. If using "pitch", this value is a MIDI number. If using "frequency", this value is a frequency in Hertz (Hz).
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "fXaVf8Yr7K", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "9vNBN2Vqqx", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "dm3cN4p2uR", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "D20EasCltv", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ] } ], "next": { "_id": "NfC4MVQDTl", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Frequency" }, { "type": "string", "value": "60" } ], "next": { "_id": "fokd6nQuDz", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "i3n1EgcVcx", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ] } ] } } } }, "x": 377.99999999999994, "y": 138}
Add to my Backpack
{ "_id": "gp3CsmCfZk", "func": "blockSynthChangeBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Note" }, { "type": "number", "value": "1" } ], "x": 81, "y": 1746.3333740234375}
Synth Change by
"Synth Change by" changes the synth's pitch or frequency by the specified value.
Parameters:
NoteType: This parameter will determine if the synth will play a note using "pitch" or "frequency". When playing a note using "pitch", the notes may be perceived on a musical scale. When playing a note using "frequency", the notes are not necessarily related in this way, and can fall inbetween the pitches in a musical scale as well.
Value: This parameter will change the synth's pitch or frequency by the specified value. If using "pitch", this value is a MIDI number. If using "frequency", this value is a frequency in Hertz (Hz).
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "fXaVf8Yr7K", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "9vNBN2Vqqx", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "dm3cN4p2uR", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "D20EasCltv", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "GUa8qb1qD4", "func": "blockSynthChangeBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "number", "value": "1" } ] } } ], "next": { "_id": "NfC4MVQDTl", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Frequency" }, { "type": "string", "value": "60" } ], "next": { "_id": "fokd6nQuDz", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "i3n1EgcVcx", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "3KT71iVvrd", "func": "blockSynthChangeBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Frequency" }, { "type": "number", "value": 50 } ] } } ] } } } }, "x": 378, "y": 138}
Add to my Backpack
{ "_id": "tZsCnbBuCu", "type": "wrapper", "func": "valueSynthFreqControl", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Note" } ], "x": 46, "y": 1828}
Synth
"Synth" returns the synth's current pitch or frequency.
Parameters:
NoteType: This parameter will determine what units to return the synth's current note's high or low value. When playing a note using "pitch", the notes may be perceived on a musical scale, and will be returned as a MIDI number. When playing a note using "frequency", the notes are not necessarily related in this way, and can fall inbetween the pitches in a musical scale as well. This will be returned as a decimal frequency value in Hertz (Hz).
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOn"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "QQHkqIxhos", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "VFulrPte2G", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "yNGK31nuYp", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 10 } ], "containers": [ { "_id": "3zA2mOyGLY", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "EayIyoPkq4", "func": "blockSynthChangeBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "number", "value": "1" } ], "next": { "_id": "TDVnPWLHig", "func": "blockLooksSetEffect", "tags": [ "transparent", "visual", "special effect", "alpha", "opacity" ], "values": [ { "type": "choice", "value": "color" }, { "_id": "ZF7hqjHjf1", "type": "wrapper", "func": "valueOpAdd", "tags": [ "plus", "addition" ], "values": [ { "type": "number", "value": 30 }, { "_id": "RyMIRniRbU", "type": "wrapper", "func": "valueSynthFreqControl", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" } ] } ] } ] } } } ], "next": { "_id": "DWQgN7Yh8A", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Frequency" }, { "type": "string", "value": "440" } ], "next": { "_id": "dUuS5Dd7NM", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 10 } ], "containers": [ { "_id": "SvhHdivUv2", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ], "next": { "_id": "z34fpypGFX", "func": "blockSynthChangeBy", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Frequency" }, { "_id": "Y1N3Nt3WVS", "type": "wrapper", "func": "valueOpRandom", "tags": [ "gamble", "any", "chance", "choice" ], "values": [ { "type": "number", "value": -30 }, { "type": "number", "value": 30 } ] } ], "next": { "_id": "61asmAtRJO", "func": "blockMotionGoTo", "tags": [ "movement", "motion", "goto", "move" ], "values": [ { "_id": "FR42VQeML8", "type": "wrapper", "func": "valueOpAdd", "tags": [ "plus", "addition" ], "values": [ { "_id": "ckW9qnXFHw", "type": "wrapper", "func": "valueSensingScreenLeft", "tags": [ "border", "edge", "value" ], "values": [] }, { "_id": "GZYZiciicW", "type": "wrapper", "func": "valueSynthFreqControl", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Frequency" } ] } ] }, { "type": "number", "value": "0" } ] } } } ] } } } }, "x": 110.5, "y": 87.5}
Add to my Backpack
{ "_id": "FOxmuulpws", "func": "blockCreateSynth", "tags": [ "music" ], "values": [ { "type": "string", "value": "my theremin" } ], "x": 57, "y": 1891.3333740234375}
Create Synth and Name it
"Create Synth and Name it" creates a synth with the parameters set by the synth widget and gives it the specified name.
Parameters:
SynthName: The name of the synth to be created.
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "fXaVf8Yr7K", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "R40rhwgEZ0", "func": "blockCreateSynth", "tags": [ "music" ], "meta": { "id": "brasscircuit", "name": "brass circuit", "oscillatorType": "sawtooth", "filterType": "lowpass", "filterQ": 2, "amplitudeEnvelopeAttack": 0.1, "amplitudeEnvelopeDecay": 0.1, "amplitudeEnvelopeSustain": 0.6, "amplitudeEnvelopeRelease": 0.5, "filterEnvelopeBaseFrequency": 2000, "filterEnvelopeAttack": 0.05, "filterEnvelopeDecay": 0.8, "filterEnvelopeSustain": 0.4, "filterEnvelopeRelease": 1.5, "$$hashKey": "object:2000" }, "values": [ { "type": "string", "value": "my theremin" } ], "next": { "_id": "OrURcdJi3l", "func": "blockLoadSynth", "tags": [ "music" ], "values": [ { "type": "string", "value": "my theremin" } ], "next": { "_id": "dm3cN4p2uR", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "9vNBN2Vqqx", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "D20EasCltv", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ] } } ] } } }, "x": 377.99999999999994, "y": 138}
Add to my Backpack
{ "_id": "oe4FiCY2wU", "func": "blockLoadSynth", "tags": [ "music" ], "values": [ { "type": "string", "value": "" } ], "x": 129, "y": 2023.6666870117188}
Load Synth
"Load Synth" loads the specified synth to use as the current synth.
Parameters:
SynthName: The name of the synth to be loaded as the current synth.
Related Blocks:
{"func":"blockSynthOnFor"},
{"func":"blockSynthOnForAndWait"},
{"func":"blockSynthOff"},
{"func":"blockSynthSet"},
{"func":"blockSynthChangeBy"},
{"func":"valueSynthFreqControl"},
{"func":"blockCreateSynth"},
{"func":"blockLoadSynth"}
Sample Code:
{ "_id": "fXaVf8Yr7K", "func": "registerFlagTrigger", "tags": [ "hat block", "event", "start", "begin", "program", "play" ], "values": [], "next": { "_id": "R40rhwgEZ0", "func": "blockCreateSynth", "tags": [ "music" ], "meta": { "id": "brasscircuit", "name": "brass circuit", "oscillatorType": "sawtooth", "filterType": "lowpass", "filterQ": 2, "amplitudeEnvelopeAttack": 0.1, "amplitudeEnvelopeDecay": 0.1, "amplitudeEnvelopeSustain": 0.6, "amplitudeEnvelopeRelease": 0.5, "filterEnvelopeBaseFrequency": 2000, "filterEnvelopeAttack": 0.05, "filterEnvelopeDecay": 0.8, "filterEnvelopeSustain": 0.4, "filterEnvelopeRelease": 1.5, "$$hashKey": "object:2000" }, "values": [ { "type": "string", "value": "my theremin" } ], "next": { "_id": "OrURcdJi3l", "func": "blockLoadSynth", "tags": [ "music" ], "values": [ { "type": "string", "value": "my theremin" } ], "next": { "_id": "dm3cN4p2uR", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 4 } ], "containers": [ { "_id": "9vNBN2Vqqx", "func": "blockSynthSet", "tags": [ "music" ], "values": [ { "type": "choice", "value": "Pitch" }, { "type": "string", "value": "60" } ], "next": { "_id": "D20EasCltv", "func": "blockSynthOnForAndWait", "tags": [ "music" ], "values": [ { "type": "number", "value": "0.5" } ] } } ] } } }, "x": 377.99999999999994, "y": 138}
Add to my Backpack
{ "_id": "8dOiABAIMu", "type": "wrapper", "func": "valueSoundInstrumentId", "tags": [ "music" ], "values": [], "x": 81.98497009277344, "y": 496}
Instrument id
"Instrument id" returns the current instrument's id number as an integer. Returns 1 if no instrument was set.
Parameters:
None.
Related Blocks:
{"func":"blockSoundSetInstrument"},
{"func":"valueSoundInstrumentName"}
Sample Code:
{ "_id": "1mEQkBwbNb", "func": "registerFlagTrigger", "values": [], "next": { "_id": "NFF2zLfcFH", "func": "blockControlScriptVar", "tags": [ "variable", "variables" ], "cat": "var", "label": "script variables {scriptvar:instrument number}{varargs:valueScriptVar}", "values": [ { "_id": "2AqLBcGKDV", "type": "wrapper", "func": "valueScriptVar", "name": "instrument number" } ], "next": { "_id": "qToVYuzPjf", "func": "blockVarSet", "tags": [ "variable", "variables" ], "values": [ { "type": "string", "value": "instrument number" }, { "type": "string", "value": "1" } ], "next": { "_id": "UqAjXuf3xv", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 127 } ], "containers": [ { "_id": "QkUs7TBIVH", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "_id": "p2QEYusoLf", "type": "wrapper", "func": "valueScriptVar", "name": "instrument number" } ], "next": { "_id": "PAfTPZlv7o", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "DEWC6yd7GS", "func": "blockLooksSay", "tags": [ "talk" ], "values": [ { "_id": "fhvjnnA1Uy", "type": "wrapper", "func": "valueSoundInstrumentId", "tags": [ "music" ], "values": [] }, { "type": "string", "value": ": " }, { "_id": "xAu3fgOW6Q", "type": "wrapper", "func": "valueSoundInstrumentName", "tags": [ "music" ], "values": [] } ], "next": { "_id": "P6tthKQvtL", "func": "blockVarChangeBy", "tags": [ "variable", "variables" ], "values": [ { "type": "string", "value": "instrument number" }, { "type": "number", "value": "1" } ] } } } } ] } } }, "x": 30, "y": 30}
Add to my Backpack
{ "_id": "3LB1CprSxb", "type": "wrapper", "func": "valueSoundInstrumentName", "tags": [ "music" ], "values": [], "x": 206.7088623046875, "y": 496}
Instrument name
"Instrument name" returns the current instrument's name in the script as a string without the number prefix.
Parameters:
None.
Related Blocks:
{"func":"blockSoundSetInstrument"},
{"func":"valueSoundInstrumentId"}
Sample Code:
{ "_id": "1mEQkBwbNb", "func": "registerFlagTrigger", "values": [], "next": { "_id": "NFF2zLfcFH", "func": "blockControlScriptVar", "tags": [ "variable", "variables" ], "cat": "var", "label": "script variables {scriptvar:instrument number}{varargs:valueScriptVar}", "values": [ { "_id": "2AqLBcGKDV", "type": "wrapper", "func": "valueScriptVar", "name": "instrument number" } ], "next": { "_id": "qToVYuzPjf", "func": "blockVarSet", "tags": [ "variable", "variables" ], "values": [ { "type": "string", "value": "instrument number" }, { "type": "string", "value": "1" } ], "next": { "_id": "UqAjXuf3xv", "func": "blockControlRepeat", "tags": [ "loop", "finite loop", "repitition" ], "values": [ { "type": "number", "value": 127 } ], "containers": [ { "_id": "QkUs7TBIVH", "func": "blockSoundSetInstrument", "tags": [ "music" ], "values": [ { "_id": "p2QEYusoLf", "type": "wrapper", "func": "valueScriptVar", "name": "instrument number" } ], "next": { "_id": "PAfTPZlv7o", "func": "blockSoundPlayNote", "tags": [ "music" ], "values": [ { "type": "string", "value": "60" }, { "type": "number", "value": 0.5 } ], "next": { "_id": "DEWC6yd7GS", "func": "blockLooksSay", "tags": [ "talk" ], "values": [ { "_id": "fhvjnnA1Uy", "type": "wrapper", "func": "valueSoundInstrumentId", "tags": [ "music" ], "values": [] }, { "type": "string", "value": ": " }, { "_id": "xAu3fgOW6Q", "type": "wrapper", "func": "valueSoundInstrumentName", "tags": [ "music" ], "values": [] } ], "next": { "_id": "P6tthKQvtL", "func": "blockVarChangeBy", "tags": [ "variable", "variables" ], "values": [ { "type": "string", "value": "instrument number" }, { "type": "number", "value": "1" } ] } } } } ] } } }, "x": 30, "y": 30}
Add to my Backpack
Drawing
Draw with an Actor?
You can use an Actor to lead the pen around the Stage by having the pen draw the Actor’s path. Just use the {"func":"blockPenDown"}
block in the Actor’s code and control the Actor with movement code.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockPenDown","values":[],"containers":[],"next":{"func":"blockPenClear","values":[],"containers":[],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"containers":[],"next":{"func":"blockPenDrawRectangle","values":[{"type":"number","value":"10"},{"type":"number","value":"10"},{"type":"number","value":"10"},{"type":"number","value":"25"}],"containers":[],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"containers":[],"next":{"func":"blockPenDrawTriangle","values":[{"type":"number","value":"-50"},{"type":"number","value":"-50"},{"type":"number","value":"-45"},{"type":"number","value":"-45"},{"type":"number","value":"-50"},{"type":"number","value":"-45"}],"containers":[],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"containers":[],"next":{"func":"blockPenDrawEllipse","values":[{"type":"number","value":"50"},{"type":"number","value":"50"},{"type":"number","value":"10"},{"type":"number","value":"10"}],"containers":[]}}}}}}}}}
Add to my Backpack
Sample Projects:
Geometric Shapes, Flower Art
How do I change something’s color?
If you want to change an Actor’s color, you should add a Costume and change the Costume. However, if you want to change the pen’s color, remember that colors are represented by numbers in programming. Choose an initial color on the visual spectrum and then add or subtract from that number with the {"func":"blockPenChangeHue"}
code block.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockLooksShow","values":[],"containers":[],"next":{"func":"blockPenDown","values":[],"containers":[],"next":{"func":"blockControlForever","values":[],"containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"containers":[],"next":{"func":"blockPenChangeHue","values":[{"type":"number","value":"10"}],"containers":[],"next":{"func":"blockMotionBounceOnEdge","values":[],"containers":[]}}}]}}}}
Add to my Backpack
Sample Projects:
Flower Art, Simple Painting, Sketch Racer
How do I make the pen thicker?
Use the {"func":"blockPenChangeSize"}
block to make the pen appear thicker.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockLooksShow","values":[],"containers":[],"next":{"func":"blockPenDown","values":[],"containers":[],"next":{"func":"blockPenChangeSize","values":[{"type":"number","value":"5"}],"containers":[],"next":{"func":"blockControlForever","values":[],"containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"containers":[],"next":{"func":"blockMotionBounceOnEdge","values":[],"containers":[]}}]}}}}}
Add to my Backpack
Sample Projects:
Flower Art
How do I draw shapes?
The pen section has a lot of code blocks for drawing shapes at a particular x and y value with a certain width/height.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockPenDown","values":[],"containers":[],"next":{"func":"blockPenClear","values":[],"containers":[],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"containers":[],"next":{"func":"blockPenDrawRectangle","values":[{"type":"number","value":"10"},{"type":"number","value":"10"},{"type":"number","value":"10"},{"type":"number","value":"25"}],"containers":[],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"containers":[],"next":{"func":"blockPenDrawTriangle","values":[{"type":"number","value":"-50"},{"type":"number","value":"-50"},{"type":"number","value":"-45"},{"type":"number","value":"-45"},{"type":"number","value":"-50"},{"type":"number","value":"-45"}],"containers":[],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"containers":[],"next":{"func":"blockPenDrawEllipse","values":[{"type":"number","value":"50"},{"type":"number","value":"50"},{"type":"number","value":"10"},{"type":"number","value":"10"}],"containers":[]}}}}}}}}}
Add to my Backpack
Sample Projects:
Flower Art, Drawing Shapes, Spiral
How do I stop drawing?
The {"func":"blockPenUp"}
block will stop the pen from drawing.
Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"space"}],"containers":[],"next":{"func":"blockPenUp","values":[],"containers":[]}}
Add to my Backpack
Sample Projects:
Simple Painting, Pom Pom
What kinds of visual effects can I apply?
The {"func":"blockLooksChangeEffect"}
block has a bunch of effects for you to use. For example, you can use ghost, brightness, color, fisheye, whirl, pixelate, and mosaic effects.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockLooksSetEffect","values":[{"type":"choice","value":"pixelate"},{"type":"number","value":"10"}],"containers":[]}}
Add to my Backpack
Sample Projects:
Ghost UFO
How do I print words on the Stage?
Writing text can involve a lot of code blocks. You can use the {"func":"blockPenDrawText"}
code block and specify a location to draw the text. Sometimes, you’ll have two strings of text, in which case you need to join them with the {"func":"valueOpJoin"}
block.
Sample Code:
{"func":"registerFlagTrigger","values":[],"containers":[],"next":{"func":"blockPenClear","values":[],"containers":[],"next":{"func":"blockPenSetFont","values":[{"type":"choice","value":"normal"},{"type":"choice","value":"24"},{"type":"choice","value":"Arial,Helvetica,sans-serif"}],"containers":[],"next":{"func":"blockPenDrawTextAt","values":[{"type":"wrapper","func":"valueOpJoin","values":[{"type":"string","value":"hello "},{"type":"string","value":"world!"}]},{"type":"number","value":"-50"},{"type":"number","value":"0"}],"containers":[]}}}}
Add to my Backpack
Sample Projects:
Using fonts, What’s Your Name?, Asking Questions
- Getting Started
- Welcome to Tynker
- Minecraft Guide
- Tools
- Workshop
- Character Creator
- Level Editor
- Backpack
- Debugger
- Sharing
- LEGO WeDo
- Tips & Tricks
- Video Tutorials
- Working with Actors
- Music and Drawing
- Physics Engine
- Game Design
- Other Topics
- Tech Setup
- Glossary
- Blocks Reference
- Events
- Control
- Motion
- Animation
- Looks
- Sensing
- Sound
- Operator
- Pen
- Physics
- Variables
- Lists
- Functions
- Level Design
- Hardware
- Library Reference
- Platformer
- Top Down