Skip to content

Commit e0b1ba4

Browse files
author
Antonino Tramontana
committed
Added python code for note block
1 parent 887e711 commit e0b1ba4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/Activity.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,14 @@ export default {
17361736
};
17371737
17381738
1739+
Blockly.Python['coderbot_music_note_std'] = function(block) {
1740+
var dropdown_note = block.getFieldValue('note');
1741+
var dropdown_instrument = block.getFieldValue('instrument');
1742+
var value_duration = Blockly.Python.valueToCode(block, 'duration', Blockly.Python.ORDER_ATOMIC);
1743+
var code = 'get_music().play_note("'+dropdown_note+'","'+dropdown_instrument+'","'+value_duration+'")\n';
1744+
return code;
1745+
}
1746+
17391747
Blockly.Python['coderbot_audio_listen'] = function(block) {
17401748
// Boolean values true and false.
17411749
var model = block.getFieldValue('MODEL');

0 commit comments

Comments
 (0)