@@ -276,6 +276,10 @@ pub enum Block {
276276 ChangePenSaturation ,
277277 ChangePenBrightness ,
278278 ChangePenTransparency ,
279+ PlayDrum1 ,
280+ PlayDrum2 ,
281+ PlayNote ,
282+ SetInstrument ,
279283 Rest ,
280284 SetTempo ,
281285 ChangeTempo ,
@@ -434,6 +438,24 @@ impl Block {
434438 field : "colorParam" ,
435439 default : "transparency" ,
436440 } ) ,
441+ Self :: PlayDrum1 => Some ( Menu {
442+ opcode : "music_menu_DRUM" ,
443+ input : "DRUM" ,
444+ field : "DRUM" ,
445+ default : "1" ,
446+ } ) ,
447+ Self :: PlayDrum2 => Some ( Menu {
448+ opcode : "music_menu_DRUM" ,
449+ input : "DRUM" ,
450+ field : "DRUM" ,
451+ default : "1" ,
452+ } ) ,
453+ Self :: SetInstrument => Some ( Menu {
454+ opcode : "music_menu_INSTRUMENT" ,
455+ input : "INSTRUMENT" ,
456+ field : "INSTRUMENT" ,
457+ default : "1" ,
458+ } ) ,
437459 _ => None ,
438460 }
439461 }
@@ -445,6 +467,7 @@ impl Block {
445467 "say" => & [ Self :: Say2 , Self :: Say1 ] ,
446468 "think" => & [ Self :: Think2 , Self :: Think1 ] ,
447469 "clone" => & [ Self :: Clone0 , Self :: Clone1 ] ,
470+ "play_drum" => & [ Self :: PlayDrum1 , Self :: PlayDrum2 ] ,
448471 _ => & [ ] ,
449472 }
450473 }
@@ -550,6 +573,11 @@ impl Block {
550573 ( "change_pen_saturation" , _) => Some ( Self :: ChangePenSaturation ) ,
551574 ( "change_pen_brightness" , _) => Some ( Self :: ChangePenBrightness ) ,
552575 ( "change_pen_transparency" , _) => Some ( Self :: ChangePenTransparency ) ,
576+ ( "play_drum" , 1 ) => Some ( Self :: PlayDrum1 ) ,
577+ ( "play_drum" , 2 ) => Some ( Self :: PlayDrum2 ) ,
578+ ( "play_drum" , _) => Some ( Self :: PlayDrum1 ) ,
579+ ( "play_note" , _) => Some ( Self :: PlayNote ) ,
580+ ( "set_instrument" , _) => Some ( Self :: SetInstrument ) ,
553581 ( "rest" , _) => Some ( Self :: Rest ) ,
554582 ( "set_tempo" , _) => Some ( Self :: SetTempo ) ,
555583 ( "change_tempo" , _) => Some ( Self :: ChangeTempo ) ,
@@ -653,6 +681,10 @@ impl Block {
653681 Self :: ChangePenSaturation => "change_pen_saturation" ,
654682 Self :: ChangePenBrightness => "change_pen_brightness" ,
655683 Self :: ChangePenTransparency => "change_pen_transparency" ,
684+ Self :: PlayDrum1 => "play_drum" ,
685+ Self :: PlayDrum2 => "play_drum" ,
686+ Self :: PlayNote => "play_note" ,
687+ Self :: SetInstrument => "set_instrument" ,
656688 Self :: Rest => "rest" ,
657689 Self :: SetTempo => "set_tempo" ,
658690 Self :: ChangeTempo => "change_tempo" ,
@@ -750,6 +782,9 @@ impl Block {
750782 "change_pen_saturation" ,
751783 "change_pen_brightness" ,
752784 "change_pen_transparency" ,
785+ "play_drum" ,
786+ "play_note" ,
787+ "set_instrument" ,
753788 "rest" ,
754789 "set_tempo" ,
755790 "change_tempo" ,
@@ -852,6 +887,10 @@ impl Block {
852887 Self :: ChangePenSaturation => "pen_changePenColorParamBy" ,
853888 Self :: ChangePenBrightness => "pen_changePenColorParamBy" ,
854889 Self :: ChangePenTransparency => "pen_changePenColorParamBy" ,
890+ Self :: PlayDrum1 => "music_playDrumForBeats" ,
891+ Self :: PlayDrum2 => "music_playDrumForBeats" ,
892+ Self :: PlayNote => "music_playNoteForBeats" ,
893+ Self :: SetInstrument => "music_setInstrument" ,
855894 Self :: Rest => "music_restForBeats" ,
856895 Self :: SetTempo => "music_setTempo" ,
857896 Self :: ChangeTempo => "music_changeTempo" ,
@@ -954,6 +993,10 @@ impl Block {
954993 Self :: ChangePenSaturation => & [ "VALUE" ] ,
955994 Self :: ChangePenBrightness => & [ "VALUE" ] ,
956995 Self :: ChangePenTransparency => & [ "VALUE" ] ,
996+ Self :: PlayDrum1 => & [ "BEATS" ] ,
997+ Self :: PlayDrum2 => & [ "DRUM" , "BEATS" ] ,
998+ Self :: PlayNote => & [ "NOTE" , "BEATS" ] ,
999+ Self :: SetInstrument => & [ "INSTRUMENT" ] ,
9571000 Self :: Rest => & [ "BEATS" ] ,
9581001 Self :: SetTempo => & [ "TEMPO" ] ,
9591002 Self :: ChangeTempo => & [ "TEMPO" ] ,
@@ -1058,6 +1101,10 @@ impl Block {
10581101 Self :: ChangePenSaturation => None ,
10591102 Self :: ChangePenBrightness => None ,
10601103 Self :: ChangePenTransparency => None ,
1104+ Self :: PlayDrum1 => None ,
1105+ Self :: PlayDrum2 => None ,
1106+ Self :: PlayNote => None ,
1107+ Self :: SetInstrument => None ,
10611108 Self :: Rest => None ,
10621109 Self :: SetTempo => None ,
10631110 Self :: ChangeTempo => None ,
@@ -1145,8 +1192,10 @@ impl Repr {
11451192 }
11461193 }
11471194
1148- pub fn overloads ( _name : & str ) -> & ' static [ Self ] {
1149- & [ ]
1195+ pub fn overloads ( name : & str ) -> & ' static [ Self ] {
1196+ match name {
1197+ _ => & [ ] ,
1198+ }
11501199 }
11511200
11521201 pub fn from_shape ( name : & str , args : usize ) -> Option < Self > {
0 commit comments