123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- /**
- * @license Licensed under the Apache License, Version 2.0 (the "License"):
- * http://www.apache.org/licenses/LICENSE-2.0
- */
- /**
- * @fileoverview Ardublockly JavaScript for the Blockly resources and bindings.
- */
- /*
- 'use strict';
- goog.provide('Blockly.Blocks.music');
- goog.require('Blockly.Blocks');
- // goog.require('Blockly.Types');
- Blockly.Blocks['music_setup'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Music Setup");
- this.setPreviousStatement(true, null);
- this.setNextStatement(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_set_beat'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Beat")
- .appendField(new Blockly.FieldDropdown([["1/8","1/8"], ["1/4","1/4"], ["1/2","1/2"], ["1","1"], ["2","2"], ["4","4"]]), "beat_option");
- this.setOutput(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_set_bpm'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("BPM")
- .appendField(new Blockly.FieldDropdown([["80","80"], ["120","120"], ["140","140"]]), "bpm");
- this.setOutput(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_instrument'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Instrument")
- .appendField(new Blockly.FieldDropdown([["Classic Piano","1"], ["Electric Piano","5"], ["Music Box","11"], ["Electric Guitar","28"], ["Acoustic Bass","33"], ["Cello","43"], ["Whistle","73"], ["Baritone Sax","68"]]), "instru");
- this.setOutput(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_volume'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Volume")
- .appendField(new Blockly.FieldNumber(0, 0, Infinity, 1), "music_volume");
- this.setPreviousStatement(true, null);
- this.setNextStatement(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_customize_melody'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Use ");
- this.appendValueInput("instru")
- .setCheck(null);
- this.appendDummyInput()
- .appendField("play")
- .appendField(new Blockly.FieldTextInput("myMelody"), "melody_name");
- this.appendStatementInput("composition")
- .setCheck(null);
- this.setPreviousStatement(true, null);
- this.setNextStatement(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_change_tempo'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Temporary Beat")
- .appendField(new Blockly.FieldDropdown([["1/8","1/8"], ["1/4","1/4"], ["1/2","1/2"], ["1","1"], ["2","2"], ["4","4"]]), "beat");
- this.appendStatementInput("melody")
- .setCheck(null);
- this.setPreviousStatement(true, null);
- this.setNextStatement(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_rest'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Rest for ")
- .appendField(new Blockly.FieldTextInput("1"), "beat")
- .appendField("beat");
- this.setPreviousStatement(true, null);
- this.setNextStatement(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- Blockly.Blocks['music_combination'] = {
- init: function() {
- this.appendDummyInput()
- .appendField("Use");
- this.appendValueInput("instrument")
- .setCheck(null);
- this.appendDummyInput()
- .appendField("play note");
- this.appendValueInput("note")
- .setCheck(null);
- this.appendDummyInput()
- .appendField("for");
- this.appendValueInput("beat")
- .setCheck(null);
- this.appendDummyInput()
- .appendField("beat");
- this.setPreviousStatement(true, null);
- this.setNextStatement(true, null);
- this.setColour(230);
- this.setTooltip("");
- this.setHelpUrl("");
- }
- };
- */
|