@@ -1126,14 +1126,20 @@ int SeqFile::importMIDI(File midifile, ValueTree midiopts){
11261126 value = (int )midiopts.getProperty (" mutebhv" , 0x20 );
11271127 want = wantAction (" Mute Behavior" , 0 );
11281128 wantProperty (want, " Value" , value);
1129- section.addChild (createCommand (want), cmd, nullptr );
1130- cmd++;
1129+ want = createCommand (want);
1130+ if (want.isValid ()){
1131+ section.addChild (want, cmd, nullptr );
1132+ cmd++;
1133+ }
11311134 // Mute Scale (previously Sequence Type) (D5 32)
11321135 value = (int )midiopts.getProperty (" mutescale" , 0x32 );
11331136 want = wantAction (" Mute Scale" , 0 );
11341137 wantProperty (want, " Value" , value);
1135- section.addChild (createCommand (want), cmd, nullptr );
1136- cmd++;
1138+ want = createCommand (want);
1139+ if (want.isValid ()){
1140+ section.addChild (want, cmd, nullptr );
1141+ cmd++;
1142+ }
11371143 // Channel Enable (D7 XXXX)
11381144 want = wantAction (" Channel Enable" , 0 );
11391145 wantProperty (want, " Bitfield" , chanBitfield);
@@ -1333,8 +1339,11 @@ int SeqFile::importMIDI(File midifile, ValueTree midiopts){
13331339 // Set Long Notes, previously known as Chn Reset (C4)
13341340 if (sectimeidx == 0 ){
13351341 want = wantAction (" Set Long Notes" , 1 );
1336- section.addChild (createCommand (want), cmd, nullptr );
1337- cmd++;
1342+ want = createCommand (want);
1343+ if (want.isValid ()){
1344+ section.addChild (want, cmd, nullptr );
1345+ cmd++;
1346+ }
13381347 }
13391348 // Create track headers
13401349 for (layer=0 ; layer<max_layers; layer++){
0 commit comments