Myriad Forum « myscript Score.TimeToChord problem »
 Welcome, Guest.
 You can read all messages, but to be able to post,
 please Login or Register.
Oct 18th, 2017, 2:23am 
   Myriad Forum
   MyrScript Language
(Moderator: Forum Administrator)
   myscript Score.TimeToChord problem
« Previous topic | Next topic »
Pages: 1  Reply | Notify of replies | Print
   Author  Topic: myscript Score.TimeToChord problem  (Read 157 times)
Tony
Board Junior Member
**





   


Posts: 76
myscript Score.TimeToChord problem   to_myriad-2.zip
« on: May 31st, 2017, 1:25pm »
Quote | Modify

I am trying to use the Score.TimeToChord method thus:
 
chord=score.TimeToChord(symbol.Time)
print(chord.Name.." "..chord.BarNumber.. " " ..chord.PositionInBar.." "..symbol.Time)
 
but I don't see chord.Name or chord.PositionInBar as I am expecting
 
I do see chord.BarNumber correctly so it seems I am using the method correctly. Maybe?
 
Attached are the files. I have highlighted where the line of code are in the script.
 
Regards,
 
Tony
offline
Daniel Frouvelle
Board Master
*****






   
WWW | Email

Gender: male
Posts: 1345
Re: myscript Score.TimeToChord problem  
« Reply #1 on: May 31st, 2017, 2:34pm »
Quote | Modify

Bonjour Tony,  
Tu peux essayer  chord,numberOfChord=FrontScore().GetBarChords(symbol.Bar)
puis
             for j=1,numberOfChord do
                        print(chord[j].Name)
            end
 
Amistats, Danièl.
« Last Edit: May 31st, 2017, 2:54pm by Daniel Frouvelle » offline
Tony
Board Junior Member
**





   


Posts: 76
Re: myscript Score.TimeToChord problem  
« Reply #2 on: May 31st, 2017, 3:38pm »
Quote | Modify

Daniel
 
Thank you so much for your reply and please excuse me writing in English.
 
I have been studying your Manage Chords script in the hopes of finding enlightenment ...
 
I have copied lines from there as well as pasting the code from your reply but I still don't see the chord name - just "...".
 
I am entering the chords manually and that seems to work OK. When I look at the chords using the Edit function of the chord setup I see everything fine as a text file. But I can't get any of the Methods to return the chord name.
 
I must be doing something wrong but I don't know what.  
 
If I could access the text version of the chord table I could extract the name from there. Is there any way to do that?  
 
Regards,
 
Tony
offline
Tony
Board Junior Member
**





   


Posts: 76
Re: myscript Score.TimeToChord problem  
« Reply #3 on: May 31st, 2017, 4:06pm »
Quote | Modify

Daniel
 
Well, it looks as if I can get the chords as text with Staff.ChordText, which does show them correctly.  
 
I guess I can do what I want from this. Although it does seem a shame I can't get the Methods to work.
 
Regards
 
Tony
offline
Daniel Frouvelle
Board Master
*****






   
WWW | Email

Gender: male
Posts: 1345
Re: myscript Score.TimeToChord problem  
« Reply #4 on: May 31st, 2017, 11:12pm »
Quote | Modify

Tony, j'ai pu afficher les accords de ton fichier "Red strat..." avec:
 
for i=1,FrontScore().NumberOfBars do
 ch, num=FrontScore().GetBarChords(i)
 for j=1,num do print(i,j,ch[j].Name) end
end  
 
Mais auparavant il faut faire Menu > Options > Display Chord Grid
Les accords que tu as entré dans ta partition sont les accords liés à la portée (Staff.ChordText) et non les accords de la grille (score. GetBarChords(i))
 
Amistats, Danièl.
offline
Tony
Board Junior Member
**





   


Posts: 76
Re: myscript Score.TimeToChord problem  
« Reply #5 on: Jun 1st, 2017, 10:00am »
Quote | Modify

Daniel
 
Thank you again.
 
I can now see that there are two chord grids/lines each with their our methods etc, which are referred to in the manual as Chord Grid and Chord Line. Hmm, I bet I am not the first person to fall into this little gotcha.
 
I will now be able to carry on with my script. You have been most helpful.
 
Regards
 
Tony
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 Last update:  (c) Myriad