Go back 1 song part even through to previous song

// this was part of a much larger script. I have most of the extraneous removed.

On ControlChangeEvent(m : ControlChangeMessage) Matching 1,20,21,22,67,68,96,97,102 from M1

  Incc : integer
  InValue : integer
  cc1 : controlChangeMessage
  CurrentPart : integer
  CurrentSong : Integer
  NumParts : integer
 Incc = GetCCNumber(m);
 InValue = GetCCValue(m)
//my cc for going back is 68
 If Incc == 68 then
If InValue>0 then
//is it the first song part?
 //Print (CurrentPart);
 If CurrentPart>0 then
// not the first song part so we just go back 1 song part
  elsif CurrentPart==0 then // going to previous song
//it is the first song part so we have to go back a song  
  if CurrentSong>0 then // not the first song
  PrevSong() // go to previous song
  NumParts=GetSongPartCount()// how many song parts
  //Print (NumParts);
  SetSongPart(NumParts-1)// set to last song part
1 Like

Please remember to put triple backquotes before and after your script so that it’s more easily readable. I have edited your post accordingly

1 Like