HomeProductsDownloadOrderSupportSearch
  
Myriad Forum « Script only works on First Staff of score? »
 Welcome, Guest.
 You can read all messages, but to be able to post,
 please Login or Register.
Mar 28th, 2024, 12:02pm 
   Myriad Forum
   MyrScript Language
(Moderator: Forum Administrator)
   Script only works on First Staff of score?
« Previous topic | Next topic »
Pages: 1  Reply | Notify of replies | Print
   Author  Topic: Script only works on First Staff of score?  (Read 735 times)
jazmaan
Board Junior Member
**




Bebop Spoken Here! (Virtual Singer!)

   


Gender: male
Posts: 83
Script only works on First Staff of score?   Twisted_5_Difffernt_Ways.myr
« on: Apr 6th, 2019, 12:07am »
Quote | Modify

I have this colorize harmonica notes script.  (Below).   It only seems to work on the first staff of my score.  (attached)  When you see the multi-staff score, it will look like all the notes are colorized, but only the first staff is colorized correctly and it won't let me run the script on any of the other staffs, even if I change the view to only display that staff.   My workaround has been to copy that staff to a new file and then run the script.  But is there a way to fix the script, or the score so that all the staffs are colorized by the script?   Thanks.
 
-----------------
 
------- COMMON SECTION ------
--CREATOR: Didier  Guillion - Myriad Software
--Myriad
--MENU_LOCATION: Edit>Appearance
--DIFFUSION_MODE: 1
--VERSION: 1.0.0
------ ENGLISH SECTION -------
--DATE: January 2010
--NAME_IN_MENU: Colorize harmonica notes
 
 
Include "MSDefine"
score=FrontScore()
if score ~=nil then
 score.Preserve()
 staff=score.FirstStaff
 while staff ~=nil do
  if staff.Tablature~=nil and  staff.Tablature.Type==HARMONICA_TABLATURE then
   symbol=staff.FirstSymbol
   while symbol ~=nil do
    if symbol.TabCell >=0  then
     if(symbol.IsDraw==false) then  
      if(symbol.IsSlide==true) then
       symbol.Color=IDX_COLOR_MAGENTA      else
       symbol.Color=IDX_COLOR_BLUE      end
     else  
      if(symbol.IsSlide==true) then
       symbol.Color=IDX_COLOR_ORANGE      else
       symbol.Color=IDX_COLOR_GREEN
      end
     end  
    end
    symbol=symbol.Next
   end  
   return
  end
 staff=staff.Next
 end  
else
  Alert("No score loaded")
end
offline
bubu42
Board Master
*****





   


Gender: male
Posts: 10505
Re: Script only works on First Staff of score?  
« Reply #1 on: Apr 6th, 2019, 8:55am »
Quote | Modify

At first sight, there is that "return" command (line 39) that stops the procedure before turning to the next staff. If you get rid of it, all the staves should be processed.
« Last Edit: Apr 6th, 2019, 8:56am by bubu42 » offline

Harmony Assistant - Ubuntu + Wine et Windows XP sur machine virtuelle. VS, OMeR, PDF2M
jazmaan
Board Junior Member
**




Bebop Spoken Here! (Virtual Singer!)

   


Gender: male
Posts: 83
Re: Script only works on First Staff of score?  
« Reply #2 on: Apr 6th, 2019, 4:51pm »
Quote | Modify

on Apr 6th, 2019, 8:55am, bubu42 wrote:
At first sight, there is that "return" command (line 39) that stops the procedure before turning to the next staff. If you get rid of it, all the staves should be processed.

 
 
THAT FIXED IT!  Thanks so much!
offline
Pages: 1  Reply | Notify of replies | Print

« Previous topic | Next topic »

« Myriad Forum » Powered by YaBB 1 Gold - SP 1.1!
YaBB © 2000-2002,
Xnull. All Rights Reserved.

Top of page
Legal information Cookies Last update:  (c) Myriad