File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -667,10 +667,14 @@ class Singer {
667667 */
668668 static setMasterVolume ( logo , volume , blk ) {
669669 const activity = logo . activity ;
670- const firstConnection = activity . logo . blockList [ blk ] . connections [ 0 ] ;
671- const lastConnection = last ( activity . logo . blockList [ blk ] . connections ) ;
672670 volume = Math . min ( Math . max ( volume , 0 ) , 100 ) ;
673- logo . synth . setMasterVolume ( volume , firstConnection , lastConnection ) ;
671+ if ( blk ) {
672+ const firstConnection = activity . logo . blockList [ blk ] . connections [ 0 ] ;
673+ const lastConnection = last ( activity . logo . blockList [ blk ] . connections ) ;
674+ logo . synth . setMasterVolume ( volume , firstConnection , lastConnection ) ;
675+ } else {
676+ logo . synth . setMasterVolume ( volume ) ;
677+ }
674678 for ( const turtle of activity . turtles . turtleList ) {
675679 for ( const synth in turtle . singer . synthVolume ) {
676680 turtle . singer . synthVolume [ synth ] . push ( volume ) ;
You can’t perform that action at this time.
0 commit comments