note not yet ready

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

note not yet ready

Jim Newton
I'm working on a function which extends (adds notes to) some chords according to a particular algorithm.
I'm using the function chord->score()->addNote() to insert the notes.
Unfortunately, this function creates notes whose note->line() is 0.  I guess this gets rectified later.

This poses a problem, because as the function proceeds, it cannot determine which notes are really on line=0, and which just have line=0 because they have not been "finalized" yet.

Does anyone know how to either force the line calculation to occur and note->_line to get set, OR how to determine if a given note has not yet been "finalized"?

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
I've inserted the following call to updateLine()  which seems to do the trick, but I'm not sure if it is correct.

                        Chord *chord = static_cast<Chord*>(element);
                              if ( calcFiguredBass(chord, harmonys) ) {
                              for (int pitch : harmonys)
                                    {
                                    NoteVal *nval = new NoteVal(pitch);
                                    chord->score()->addNote(chord,*nval);
                                    }
                              for( Note *n : chord->notes()) {
                                    n->updateLine();    /// <<<--- inserted this call
                                    }
                              }
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
In reply to this post by Jim Newton
I don't understand.  Are you saying your own function is trying to use "line" as the way of knowing which notes you yourself have not processed yet?  That sounds unlikely to work.

If you are syaing you think there is some sort of problem with now addNote(0 works, can you give steps to reproduce the problem?

On Sun, Aug 2, 2015 at 8:27 AM Jim Newton <[hidden email]> wrote:
I'm working on a function which extends (adds notes to) some chords according
to a particular algorithm.
I'm using the function chord->score()->addNote() to insert the notes.
Unfortunately, this function creates notes whose note->line() is 0.  I guess
this gets rectified later.

This poses a problem, because as the function proceeds, it cannot determine
which notes are really on line=0, and which just have line=0 because they
have not been "finalized" yet.

Does anyone know how to either force the line calculation to occur and
note->_line to get set, OR how to determine if a given note has not yet been
"finalized"?

Thanks.



--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
Hard to say without understand the actual problem you are perceiving there to be.  Are you saying there is somew sort of bug that can be reproduced by following some certain series of steps?

On Sun, Aug 2, 2015 at 8:45 AM Marc Sabatella <[hidden email]> wrote:
I don't understand.  Are you saying your own function is trying to use "line" as the way of knowing which notes you yourself have not processed yet?  That sounds unlikely to work.

If you are syaing you think there is some sort of problem with now addNote(0 works, can you give steps to reproduce the problem?

On Sun, Aug 2, 2015 at 8:27 AM Jim Newton <[hidden email]> wrote:
I'm working on a function which extends (adds notes to) some chords according
to a particular algorithm.
I'm using the function chord->score()->addNote() to insert the notes.
Unfortunately, this function creates notes whose note->line() is 0.  I guess
this gets rectified later.

This poses a problem, because as the function proceeds, it cannot determine
which notes are really on line=0, and which just have line=0 because they
have not been "finalized" yet.

Does anyone know how to either force the line calculation to occur and
note->_line to get set, OR how to determine if a given note has not yet been
"finalized"?

Thanks.



--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
In reply to this post by Marc Sabatella
Hi Marc, i'm not sure it is a bug, but rather simply the way it works.  It looks like addNote does not update _line, perhaps something else does.  Rather _line gets initialized to its default value of 0, which happens to coincide with a particular line on the staff.

I could build a test case, but I'm afraid the conclusion will be:  That's not a bug; it's just the way it works.

BTW, how can I create a test case for a C++ api?  I could put it on a branch or a PR just for the purpose of sharing it.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
Sorry, I guess I just don't have enough context to understand what you are actually asking here then.  It is true that line calculations happen at specific points in the code - most importantly, if I remember/understand correctly, during cmdUpdateNotes(), which is called during the layout process.  If you are asking if it is OK to be looking at specific "line" values before a note has been laid out, i believe the answer is, "no".

On Sun, Aug 2, 2015 at 3:08 PM Jim Newton <[hidden email]> wrote:
Hi Marc, i'm not sure it is a bug, but rather simply the way it works.  It
looks like addNote does not update _line, perhaps something else does.
Rather _line gets initialized to its default value of 0, which happens to
coincide with a particular line on the staff.

I could build a test case, but I'm afraid the conclusion will be:  That's
not a bug; it's just the way it works.

BTW, how can I create a test case for a C++ api?  I could put it on a branch
or a PR just for the purpose of sharing it.






--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579486.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
Great, so given that you should not look at line values until the note has been laid out, then given a note, how can I know whether it has been laid out yet?  If I could figure this out, it would pretty much solve my problem.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
It would really help to understand the context - what you are trying to do, how you are trying to do it.  The easy answer is, if you want to do something that depends on the note being laid out, don't do it until later in the process.

On Mon, Aug 3, 2015 at 2:56 PM Jim Newton <[hidden email]> wrote:
Great, so given that you should not look at line values until the note has
been laid out, then given a note, how can I know whether it has been laid
out yet?  If I could figure this out, it would pretty much solve my problem.



--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579489.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Maurizio M. Gavioli
In reply to this post by Jim Newton
Jim Newton wrote
I'm working on a function which extends (adds notes to) some chords according to a particular algorithm.
I'm using the function chord->score()->addNote() to insert the notes.
Unfortunately, this function creates notes whose note->line() is 0.  I guess this gets rectified later.

This poses a problem, because as the function proceeds, it cannot determine which notes are really on line=0, and which just have line=0 because they have not been "finalized" yet.

Does anyone know how to either force the line calculation to occur and note->_line to get set, OR how to determine if a given note has not yet been "finalized"?

Thanks.
It would help to know why do you need the line value of a note: are you trying to improve the graphical placement of other elements with respect to the graphical placement of the note? For things like this knowing the line would / could help. These are tasks which are typically done during the layout phase(s) though.

For other tasks, like determining the pitch or the 'spelling' of a note, the line is irrelevant; the note pitch and/or tpc's should be used instead.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
Hi Maurizio, can you give me more information about what you are referring to here:  how to sue the tpc for line computation?  Are these types which have integer-like arithmetic defined on them?

For example given a note in G clef of an F instrument like the English Horn, how can I find out whether it is a 3rd or a 5th above a note in the F clef of a C instrument such as Bassoon?  Additionally how can I know if a note has been altered from the key signature by an accidental earlier in the measure using tpc?

I'm currently doing these calculations simulating what the human would do by counting the lines and spaces between the notes as written.  This has the advantage of an F# and a Gb appear on different lines which makes such line based calculations unambiguous.  E.g., If I want to add a note on line 7 of the G clef, it is an F (perhaps flat or sharp or double flat or double sharp).   If I want to know whether the note should have an accidental, I need to loop backwards in the measure to see if another note is on the same line=7. A 3rd above that F would be the note on line 7-3+1=5.

Perhaps these types of calculations can be done easier with tpc.  If so I'd like to better understand how.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
I'd still like to understand the broader context - what in general are you actualy trying to accomplish (a new feature? a bug fix? can you explain how a user would take advantage of the code you are adding?)

Assuming you are talking about something having to do with playback, then layout is completed by the time your code is actived, meaning you should have all the information you need, but it still just isn't clear at all what you are actually trying to do.

On Tue, Aug 18, 2015 at 3:06 AM Jim Newton <[hidden email]> wrote:
Hi Maurizio, can you give me more information about what you are referring to
here:  how to sue the tpc for line computation?  Are these types which have
integer-like arithmetic defined on them?

For example given a note in G clef of an F instrument like the English Horn,
how can I find out whether it is a 3rd or a 5th above a note in the F clef
of a C instrument such as Bassoon?  Additionally how can I know if a note
has been altered from the key signature by an accidental earlier in the
measure using tpc?

I'm currently doing these calculations simulating what the human would do by
counting the lines and spaces between the notes as written.  This has the
advantage of an F# and a Gb appear on different lines which makes such line
based calculations unambiguous.  E.g., If I want to add a note on line 7 of
the G clef, it is an F (perhaps flat or sharp or double flat or double
sharp).   If I want to know whether the note should have an accidental, I
need to loop backwards in the measure to see if another note is on the same
line=7. A 3rd above that F would be the note on line 7-3+1=5.

Perhaps these types of calculations can be done easier with tpc.  If so I'd
like to better understand how.



--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579494.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
Hi Marc, this type of question has come up three times for me so far.  

1. calculating the notes of an ornament (trill, turn etc).  A trill is played by playing the note that is written in combination with the note on the line/space above or below.  This is not always the neighbouring note in the diatonic scale as any of the notes might have been modified by an accidental earlier in the measure.  So the code needs to find notes earlier in the measure which appear on the same line/space and assure that the trill note has the same pitch as the "antecedent" note.

2. calculating a glissando as if for the harp.  In this case we not only need to take into account notes on the exact same line/space earlier in the measure (to match accidentals) we must also examine antecedent notes which are on the same line/space modulo 7.  E.g., in the key of C, if the measure contains a g# then all g's in the glissando need to be g# (assuming diatonic glissando style).   This code must not get confused about enharmonic.  E.g., the existence of a G# causes G's to be sharpened, but does not cause A's to be flattened.   Similarly if G is double-sharpened earlier in the measure. etc.

3. calculating figured bass realisation.  If the bass note is a C (for example) and the FB annotation is "3 5", then the derived notes are E and G, but they should be modified by the key signature, and in some cases also by accidentals previous in the measure (there is some debate about this, but I have found cases where FB should ignore previous accidentals, and where it should recognise previous accidentals).  Again the most obvious way to implement this is with line/space calculation.  Find the line the starting not is on, and subtract a number 1 less than the indicated value.  E.g., "3 5" implies (line_of_bass_note - (3 - 1)) and (line_of_base_note - (5 - 1)).   The (3-1) and (5-1) are because an intervals of 3 and 5 are actually deltas of 2 and 4 (the interval from C to C is 1, not 0).   The (line_of_bass - X) is because lines are numbered from top to bottom, rather than bottom to top.  So to move UP the staff, you must subtract rather than add.

Marizio suggested that this calculation could be done with tpc rather than lines, so I'm interested in finding out how to perform arithmetic with tpc.

Does this explanation help?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
If I understand correctly, 1) and 2) would happen in rendermidi somewhere, hence after layout, hence no issues, and it's only 3) where you are trying to actually add notes as opposed to playback events?

The I guess the more basic question is, if you are starting from a point of knowing what line you want to add a note on, why are you adding the note by pitch?  Why not add it by line in the first place?  Then the line would already be set, as would the accidental.  In other words, don't call Score::addNote(), but instead one of the addPitch() functions that already handles lines & accidentals.  Or, at least, use the same functions they use to calculate the necessary values.  Eg, noteValForPosition(), which calculates the proper pitch and tpc for you given the segment and line, taking accidental state into account.

Marc


On Wed, Aug 19, 2015 at 3:08 AM Jim Newton <[hidden email]> wrote:
Hi Marc, this type of question has come up three times for me so far.

1. calculating the notes of an ornament (trill, turn etc).  A trill is
played by playing the note that is written in combination with the note on
the line/space above or below.  This is not always the neighbouring note in
the diatonic scale as any of the notes might have been modified by an
accidental earlier in the measure.  So the code needs to find notes earlier
in the measure which appear on the same line/space and assure that the trill
note has the same pitch as the "antecedent" note.

2. calculating a glissando as if for the harp.  In this case we not only
need to take into account notes on the exact same line/space earlier in the
measure (to match accidentals) we must also examine antecedent notes which
are on the same line/space modulo 7.  E.g., in the key of C, if the measure
contains a g# then all g's in the glissando need to be g# (assuming diatonic
glissando style).   This code must not get confused about enharmonic.  E.g.,
the existence of a G# causes G's to be sharpened, but does not cause A's to
be flattened.   Similarly if G is double-sharpened earlier in the measure.
etc.

3. calculating figured bass realisation.  If the bass note is a C (for
example) and the FB annotation is "3 5", then the derived notes are E and G,
but they should be modified by the key signature, and in some cases also by
accidentals previous in the measure (there is some debate about this, but I
have found cases where FB should ignore previous accidentals, and where it
should recognise previous accidentals).  Again the most obvious way to
implement this is with line/space calculation.  Find the line the starting
not is on, and subtract a number 1 less than the indicated value.  E.g., "3
5" implies (line_of_bass_note - (3 - 1)) and (line_of_base_note - (5 - 1)).
The (3-1) and (5-1) are because an intervals of 3 and 5 are actually deltas
of 2 and 4 (the interval from C to C is 1, not 0).   The (line_of_bass - X)
is because lines are numbered from top to bottom, rather than bottom to top.
So to move UP the staff, you must subtract rather than add.

Marizio suggested that this calculation could be done with tpc rather than
lines, so I'm interested in finding out how to perform arithmetic with tpc.

Does this explanation help?




--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579498.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
It sounds like you pretty much understand the problem.

If I add a note, and then later in the function I scan over the notes in the measure, I might encounter one I added.  It has line=0 on it, which is wrong, and I'd like to skip that note.  But I don't see any indication on the note that it is in such a state.  There must be something which distinguishes this note from one which is REALLY on line=0.  I could of course make a over-engineered solution to "remember" which notes I added, or perhaps don't actually add the notes, but rather build a data structure of notes I intend to add, then add them all at the end.  I'd like to avoid such a complicated solution.

I'll take a look at noteValForPosition().  One issue I saw last time I looked at that was that I didn't know how to calculate the correct accidentals.  With my approach it is a bit easier.  I find a note on the line I want; ask that note what is its pitch, then create a new note with that pitch +/- n*12 to shift for octave differences.
The case of accidentals was confusing to me because the note might be Bb because there is a Bb in the key signature, and it might be Bb because of an accidental explicitly on the note or one earlier in the measure.  The kink is that I need to call addNote(), and also updateLine(); that seems to do the trick.

Again to emphasise Marizio suggested to use tpc, because it will do this calculation for me.  So, I'd like to understand how that might work.  

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
I think that suggestion does not really make sense given what I thinkl you are actually trying to do.  Your problem is simply that you chose the wrong function to use to add notes.  if you care about line, you should use a function that works with line, simple as that.  You won't have to calculate accidentals yourself at all - that is all handled for you if you do what I suggested.

Marc

On Fri, Aug 21, 2015 at 9:01 AM Jim Newton <[hidden email]> wrote:
It sounds like you pretty much understand the problem.

If I add a note, and then later in the function I scan over the notes in the
measure, I might encounter one I added.  It has line=0 on it, which is
wrong, and I'd like to skip that note.  But I don't see any indication on
the note that it is in such a state.  There must be something which
distinguishes this note from one which is REALLY on line=0.  I could of
course make a over-engineered solution to "remember" which notes I added, or
perhaps don't actually add the notes, but rather build a data structure of
notes I intend to add, then add them all at the end.  I'd like to avoid such
a complicated solution.

I'll take a look at noteValForPosition().  One issue I saw last time I
looked at that was that I didn't know how to calculate the correct
accidentals.  With my approach it is a bit easier.  I find a note on the
line I want; ask that note what is its pitch, then create a new note with
that pitch +/- n*12 to shift for octave differences.
The case of accidentals was confusing to me because the note might be Bb
because there is a Bb in the key signature, and it might be Bb because of an
accidental explicitly on the note or one earlier in the measure.  The kink
is that I need to call addNote(), and also updateLine(); that seems to do
the trick.

Again to emphasise Marizio suggested to use tpc, because it will do this
calculation for me.  So, I'd like to understand how that might work.





--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579501.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
I'd like to understand your suggestion better.  Suppose I have found a note on line 1 (E) of the treble clef, and the key signature is F, but the E has been flattened with an accidental earlier in the measure.  Now from that information, how should I create a note on line 3 of the bass clef which matches the accidentals of the antecedent note?

Another tricky example is what if the treble clef which contains the antecedent note is a transposing instrument.  If I read the notes ppitch() that correctly handles the transposition for me.

The way I'm currently doing it is to get the ppitch() of the antecedent note, and create a new one whose pitch is the same +/- 12 per octave.   My approach of course has a glaring disadvantage, that I am not controlling whether I create an Eb or a D#, which of course I would prefer to be done correctly.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
Again, you don't even have to know or care if there is an accidental applied already, nor do you have to think about transposition.  If you call the addPitch() function I mentioned, it does all the work for you.  Did you try it?  If you want to see how it is used, just find other places where it is called.  Or set a breakpoint and try adding a note by typing a letter and see the stack trace.  But it should be as simple as you pass in the "step" (clef-independent "line", where middle C = 35) and it does the rest.  So, you figure out what line you want the note added on, call that function, and your work is done - no worry about accidentals or transposition or anything else.

Marc

On Sat, Aug 22, 2015 at 6:54 AM Jim Newton <[hidden email]> wrote:
I'd like to understand your suggestion better.  Suppose I have found a note
on line 1 (E) of the treble clef, and the key signature is F, but the E has
been flattened with an accidental earlier in the measure.  Now from that
information, how should I create a note on line 3 of the bass clef which
matches the accidentals of the antecedent note?

Another tricky example is what if the treble clef which contains the
antecedent note is a transposing instrument.  If I read the notes ppitch()
that correctly handles the transposition for me.

The way I'm currently doing it is to get the ppitch() of the antecedent
note, and create a new one whose pitch is the same +/- 12 per octave.   My
approach of course has a glaring disadvantage, that I am not controlling
whether I create an Eb or a D#, which of course I would prefer to be done
correctly.





--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579503.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
It just occured to me that when you speak of *clefs*, perhaps you really mean *staves*?  That is, for some reason you want an accidental on one staff to affect the pitches on other staves?  That seems highly unusual and probably unexpected behavior, but I guess in that case rather than actually calling addPitch(), you would want to analyze what it does and figure out how to adapt it to your own purposes.  But again, more information about this odd-sounding use case would help.  I can't think of any real world situation where a human musician trying to play a trill or realize figured bass or anything else would do that, so I can't imagine why you would need to either.  Seem there is still some fundamental aspect of what you are trying to do that I don't understand.  Again, can you explain from a user perspective how this would work?  He selects a note on one staff, presses some button, and the contents of some totally different staff affects what happens next?

On Sat, Aug 22, 2015 at 11:09 AM Marc Sabatella <[hidden email]> wrote:
Again, you don't even have to know or care if there is an accidental applied already, nor do you have to think about transposition.  If you call the addPitch() function I mentioned, it does all the work for you.  Did you try it?  If you want to see how it is used, just find other places where it is called.  Or set a breakpoint and try adding a note by typing a letter and see the stack trace.  But it should be as simple as you pass in the "step" (clef-independent "line", where middle C = 35) and it does the rest.  So, you figure out what line you want the note added on, call that function, and your work is done - no worry about accidentals or transposition or anything else.

Marc

On Sat, Aug 22, 2015 at 6:54 AM Jim Newton <[hidden email]> wrote:
I'd like to understand your suggestion better.  Suppose I have found a note
on line 1 (E) of the treble clef, and the key signature is F, but the E has
been flattened with an accidental earlier in the measure.  Now from that
information, how should I create a note on line 3 of the bass clef which
matches the accidentals of the antecedent note?

Another tricky example is what if the treble clef which contains the
antecedent note is a transposing instrument.  If I read the notes ppitch()
that correctly handles the transposition for me.

The way I'm currently doing it is to get the ppitch() of the antecedent
note, and create a new one whose pitch is the same +/- 12 per octave.   My
approach of course has a glaring disadvantage, that I am not controlling
whether I create an Eb or a D#, which of course I would prefer to be done
correctly.





--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579503.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Jim Newton
In reply to this post by Marc Sabatella
Hi Marc, I haven't dug deeply into the code yet, but it appears that to call addPitch()
I need to pre-calculate the pitch.  i.e., I need a NoteVal object, which I can compute from an integer pitch of the antecedent note.
This is more or less the same information I need (and have) to call addNote().

      NoteVal *nval = new NoteVal(pitch);

Of course in the case that I need to duplicate the note exactly I can use reuse the NoteVal of the antecedent note. I'll have to create a new NoteVal if the note is derived (from a different octave, transposing instrument, or interval).

However, I don't immediately see how to specify the chord I want the note added to when using addPitch().
Furthermore, it does appear that I can manipulate this NoteVal somehow to distinguish between B, Cb, A## etc. which I'm not doing currently, but need to.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: note not yet ready

Marc Sabatella
There are two addPitch() functions.  You want the one that, as I said, takes a "step" and not a pitch - the one that is called when you enter a note by typing its letter name.

On Sun, Aug 23, 2015 at 3:45 AM Jim Newton <[hidden email]> wrote:
Hi Marc, I haven't dug deeply into the code yet, but it appears that to call
addPitch()
I need to pre-calculate the pitch.  i.e., I need a NoteVal object, which I
can compute from an integer pitch of the antecedent note.
This is more or less the same information I need (and have) to call
addNote().

      NoteVal *nval = new NoteVal(pitch);

Of course in the case that I need to duplicate the note exactly I can use
reuse the NoteVal of the antecedent note. I'll have to create a new NoteVal
if the note is derived (from a different octave, transposing instrument, or
interval).

However, I don't immediately see how to specify the chord I want the note
added to when using addPitch().
Furthermore, it does appear that I can manipulate this NoteVal somehow to
distinguish between B, Cb, A## etc. which I'm not doing currently, but need
to.





--
View this message in context: http://dev-list.musescore.org/note-not-yet-ready-tp7579475p7579506.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
12
Loading...