chord_name_engraver - help with c++ ...

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

chord_name_engraver - help with c++ ...

Wols Lists
This frog is back ... I said I'd wait until 2.14 which has finally
arrived :-) But I've revamped my code a bit and am having problems...

      SCM capopitch = get_property ( "capoPitch" );
      bool capo = false;
      Pitch *c_p = unsmob_pitch (capopitch);
      if ( c_p != NULL )
      {
        if ( &c_p::get_notename != 0 || &c_p::get_alteration != NATURAL )
        {
          capo = true;
        }
      }

I assume the simplest test to tell if capoPitch has been set is to
unsmob it? Presumably if the property hasn't been set, the pointer will
be returned as NULL?

Then, a pure c++ problem, when I'm testing for notename and alteration,
I'm getting compile errors:

chord-name-engraver.cc: In member function ‘void
Chord_name_engraver::process_music()’:
chord-name-engraver.cc:108: error: ‘c_p’ is not a class or namespace
chord-name-engraver.cc:108: error: ‘c_p’ is not a class or namespace

Given that Pitch is declared as a class in pitch.hh, and when I tried
"c_p->get_notename" it blew up with a different error, this implies my
c++-fu is wanting :-( Can you help me with the correct syntax?

Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Carl Sorensen
On 7/4/11 5:25 PM, "Wols Lists" <[hidden email]> wrote:

> This frog is back ... I said I'd wait until 2.14 which has finally
> arrived :-) But I've revamped my code a bit and am having problems...
>
>       SCM capopitch = get_property ( "capoPitch" );
>       bool capo = false;
>       Pitch *c_p = unsmob_pitch (capopitch);
>       if ( c_p != NULL )
>       {
>         if ( &c_p::get_notename != 0 || &c_p::get_alteration != NATURAL )
>         {
>           capo = true;
>         }
>       }
>
> I assume the simplest test to tell if capoPitch has been set is to
> unsmob it? Presumably if the property hasn't been set, the pointer will
> be returned as NULL?

I'm going out on a limb here, because I haven't tested this, but I think I'd
check for capopitch ==  SCM_EOL to see if it hasn't been set.

>
> Then, a pure c++ problem, when I'm testing for notename and alteration,
> I'm getting compile errors:
>
> chord-name-engraver.cc: In member function Ovoid
> Chord_name_engraver::process_music()¹:
> chord-name-engraver.cc:108: error: Oc_p¹ is not a class or namespace
> chord-name-engraver.cc:108: error: Oc_p¹ is not a class or namespace
>
> Given that Pitch is declared as a class in pitch.hh, and when I tried
> "c_p->get_notename" it blew up with a different error, this implies my
> c++-fu is wanting :-( Can you help me with the correct syntax?

Please don't use c_p; we want to use full words, rather than abbreviations.

I'd try

c_p->get_notename ()

And I'd recommend the code be something like

       SCM capo_pitch = get_property ("capoPitch");
       bool capo = false;
       if !(capo_pitch == SCM_EOL)
         capo = (Pitch::compare (unsmob_pitch (capo_pitch), Pitch()) != 0)

Note -- I haven't tested this code.  But I think it follows the general
trend.

HTH,

Carl


---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
In reply to this post by Wols Lists
On 05/07/11 00:25, Wols Lists wrote:

> This frog is back ... I said I'd wait until 2.14 which has finally
> arrived :-) But I've revamped my code a bit and am having problems...
>
>       SCM capopitch = get_property ( "capoPitch" );
>       bool capo = false;
>       Pitch *c_p = unsmob_pitch (capopitch);
>       if ( c_p != NULL )
>       {
>         if ( &c_p::get_notename != 0 || &c_p::get_alteration != NATURAL )
>         {
>           capo = true;
>         }
>       }
>
> I assume the simplest test to tell if capoPitch has been set is to
> unsmob it? Presumably if the property hasn't been set, the pointer will
> be returned as NULL?
>
> Then, a pure c++ problem, when I'm testing for notename and alteration,
> I'm getting compile errors:
>
> chord-name-engraver.cc: In member function ‘void
> Chord_name_engraver::process_music()’:
> chord-name-engraver.cc:108: error: ‘c_p’ is not a class or namespace
> chord-name-engraver.cc:108: error: ‘c_p’ is not a class or namespace
>
> Given that Pitch is declared as a class in pitch.hh, and when I tried
> "c_p->get_notename" it blew up with a different error, this implies my
> c++-fu is wanting :-( Can you help me with the correct syntax?
>
Ummm... forget that - I've managed to get it working. But my test is
still blowing up, this time because get_alteration is a rational, and I
can't get it to work. But I think I know where I'm going from here ...
I've found pitch.cc and I think I can change tack and test for "diff == 0".

But I'm sure there'll be a few more emails soon :-)

Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
In reply to this post by Carl Sorensen
On 05/07/11 00:55, Carl Sorensen wrote:

> On 7/4/11 5:25 PM, "Wols Lists" <[hidden email]> wrote:
>
>> This frog is back ... I said I'd wait until 2.14 which has finally
>> arrived :-) But I've revamped my code a bit and am having problems...
>>
>>       SCM capopitch = get_property ( "capoPitch" );
>>       bool capo = false;
>>       Pitch *c_p = unsmob_pitch (capopitch);
>>       if ( c_p != NULL )
>>       {
>>         if ( &c_p::get_notename != 0 || &c_p::get_alteration != NATURAL )
>>         {
>>           capo = true;
>>         }
>>       }
>>
>> I assume the simplest test to tell if capoPitch has been set is to
>> unsmob it? Presumably if the property hasn't been set, the pointer will
>> be returned as NULL?
>
> I'm going out on a limb here, because I haven't tested this, but I think I'd
> check for capopitch ==  SCM_EOL to see if it hasn't been set.
>
>>
>> Then, a pure c++ problem, when I'm testing for notename and alteration,
>> I'm getting compile errors:
>>
>> chord-name-engraver.cc: In member function Ovoid
>> Chord_name_engraver::process_music()¹:
>> chord-name-engraver.cc:108: error: Oc_p¹ is not a class or namespace
>> chord-name-engraver.cc:108: error: Oc_p¹ is not a class or namespace
>>
>> Given that Pitch is declared as a class in pitch.hh, and when I tried
>> "c_p->get_notename" it blew up with a different error, this implies my
>> c++-fu is wanting :-( Can you help me with the correct syntax?
>
> Please don't use c_p; we want to use full words, rather than abbreviations.
>
> I'd try
>
> c_p->get_notename ()
>
> And I'd recommend the code be something like
>
>        SCM capo_pitch = get_property ("capoPitch");
>        bool capo = false;
>        if !(capo_pitch == SCM_EOL)
>          capo = (Pitch::compare (unsmob_pitch (capo_pitch), Pitch()) != 0)
>
> Note -- I haven't tested this code.  But I think it follows the general
> trend.
>
> HTH,
>
Thanks - it helps A LOT.

I'd found this - as you can see from my other email - and was trying to
go down this exact path, but it was still blowing up on me. I'll use
this and it should tell me where I'm going wrong. But it's quarter past
one in the morning and my wife will not be happy if I'm not in bed soon,
so I'll carry on tomorrow :-)

Thanks again,
Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
On 05/07/11 01:15, Wols Lists wrote:

>> And I'd recommend the code be something like
>> >
>> >        SCM capo_pitch = get_property ("capoPitch");
>> >        bool capo = false;
>> >        if !(capo_pitch == SCM_EOL)
>> >          capo = (Pitch::compare (unsmob_pitch (capo_pitch), Pitch()) != 0)
>> >
>> > Note -- I haven't tested this code.  But I think it follows the general
>> > trend.
>> >
>> > HTH,
>> >
> Thanks - it helps A LOT.
>
> I'd found this - as you can see from my other email - and was trying to
> go down this exact path, but it was still blowing up on me. I'll use
> this and it should tell me where I'm going wrong. But it's quarter past
> one in the morning and my wife will not be happy if I'm not in bed soon,
> so I'll carry on tomorrow :-)
>
> Thanks again,
> Cheers,
> Wol
>
Next step - that code compiles okay. But it doesn't work when run ...

I'm getting the following errors:

Interpreting music...
warning: cannot find property type-check for `capoVertical'
(translation-type?).  perhaps a typing error?
warning: doing assignment anyway
warning: cannot find property type-check for `capoPitch'
(translation-type?).  perhaps a typing error?
warning: doing assignment anyway

But I've added capoVertical and capoPitch to the ADD_TRANSLATOR section,
and I've added them to define-context-properties.scm. So why can't it
find it? Or is it that I've installed 2.15 locally, and it's finding the
scheme code for 2.14 or 2.12? Unlikely, I would have thought, wouldn't
that cause a crash?

Is there a C++ function that will dump the contents of a scheme variable
to stdout?

Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Carl Sorensen



On 7/5/11 11:30 AM, "Wols Lists" <[hidden email]> wrote:

> On 05/07/11 01:15, Wols Lists wrote:
>>> And I'd recommend the code be something like
>>>>
>>>>        SCM capo_pitch = get_property ("capoPitch");
>>>>        bool capo = false;
>>>>        if !(capo_pitch == SCM_EOL)
>>>>          capo = (Pitch::compare (unsmob_pitch (capo_pitch), Pitch()) != 0)
>>>>
>>>> Note -- I haven't tested this code.  But I think it follows the general
>>>> trend.
>>>>
>>>> HTH,
>>>>
>> Thanks - it helps A LOT.
>>
>> I'd found this - as you can see from my other email - and was trying to
>> go down this exact path, but it was still blowing up on me. I'll use
>> this and it should tell me where I'm going wrong. But it's quarter past
>> one in the morning and my wife will not be happy if I'm not in bed soon,
>> so I'll carry on tomorrow :-)
>>
>> Thanks again,
>> Cheers,
>> Wol
>>
> Next step - that code compiles okay. But it doesn't work when run ...
>
> I'm getting the following errors:
>
> Interpreting music...
> warning: cannot find property type-check for `capoVertical'
> (translation-type?).  perhaps a typing error?
> warning: doing assignment anyway
> warning: cannot find property type-check for `capoPitch'
> (translation-type?).  perhaps a typing error?
> warning: doing assignment anyway
>
> But I've added capoVertical and capoPitch to the ADD_TRANSLATOR section,
> and I've added them to define-context-properties.scm. So why can't it
> find it? Or is it that I've installed 2.15 locally, and it's finding the
> scheme code for 2.14 or 2.12? Unlikely, I would have thought, wouldn't
> that cause a crash?

Actually, it's not likely that the scheme code would cause a crash.

If I were wanting to check this out, I'd put a Scheme display statement at
the top of scm/context-properties.scm.

>
> Is there a C++ function that will dump the contents of a scheme variable
> to stdout?

Look in the Contributor's Guide, section 10.6.2 Debugging C++ code, to see
display functions used in the debugger.  You should be able to call

ly_display_scm on a smob from C++.

If you could post a patch set on Rietveld, we might be able to give you
better advice.

HTH,

Carl



---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Jan Warchol
2011/7/5 Wols Lists <[hidden email]>:
> This frog is back ... I said I'd wait until 2.14 which has finally
> arrived :-) But I've revamped my code a bit and am having problems...

Could you send me a link to the previous discussion on this topic? A
quick search didn't return anything.

2011/7/5 Carl Sorensen <[hidden email]>:

>> Next step - that code compiles okay. But it doesn't work when run ...
>>
>> I'm getting the following errors:
>>
>> Interpreting music...
>> warning: cannot find property type-check for `capoVertical'
>> (translation-type?).  perhaps a typing error?
>> warning: doing assignment anyway
>> warning: cannot find property type-check for `capoPitch'
>> (translation-type?).  perhaps a typing error?
>> warning: doing assignment anyway
>>
>> But I've added capoVertical and capoPitch to the ADD_TRANSLATOR section,
>> and I've added them to define-context-properties.scm. So why can't it
>> find it? Or is it that I've installed 2.15 locally, and it's finding the
>> scheme code for 2.14 or 2.12? Unlikely, I would have thought, wouldn't
>> that cause a crash?
>
> Actually, it's not likely that the scheme code would cause a crash.
>
> If I were wanting to check this out, I'd put a Scheme display statement at
> the top of scm/context-properties.scm.

Interesting.  IIRC i had similar problems with my ambitus patch.  I'll
look at this when i return to it.

> If you could post a patch set on Rietveld, we might be able to give you
> better advice.

If you have any problem with Rietveld, i'll gladly help you; I can
upload your patch if you want.

cheers,
Janek

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
On 05/07/11 21:29, Jan Warchoł wrote:
> 2011/7/5 Wols Lists <[hidden email]>:
>> This frog is back ... I said I'd wait until 2.14 which has finally
>> arrived :-) But I've revamped my code a bit and am having problems...
>
> Could you send me a link to the previous discussion on this topic? A
> quick search didn't return anything.

Look for frog emails with a subject containing "chord-name-engraver"
from august last year ... yes I know it's a long time ... but 2.14 was
supposed to be out rsn back then :-) and life happened to me :-)

Just to give a quick overview of the purpose of the changes - let's say
you've got a piano sheet with guitar chords. Very often, it'll be in a
naff key for the guitar and you want to display the guitar chords
transposed by a capo.

So if the actual chord is C, and you want capo 3, you want the chord to
actually print as "C (A)", ie the original chord followed by the
transposed chord in brackets.

>
> 2011/7/5 Carl Sorensen <[hidden email]>:
>>> Next step - that code compiles okay. But it doesn't work when run ...
>>>
>>> I'm getting the following errors:
>>>
>>> Interpreting music...
>>> warning: cannot find property type-check for `capoVertical'
>>> (translation-type?).  perhaps a typing error?
>>> warning: doing assignment anyway
>>> warning: cannot find property type-check for `capoPitch'
>>> (translation-type?).  perhaps a typing error?
>>> warning: doing assignment anyway
>>>
>>> But I've added capoVertical and capoPitch to the ADD_TRANSLATOR section,
>>> and I've added them to define-context-properties.scm. So why can't it
>>> find it? Or is it that I've installed 2.15 locally, and it's finding the
>>> scheme code for 2.14 or 2.12? Unlikely, I would have thought, wouldn't
>>> that cause a crash?
>>
>> Actually, it's not likely that the scheme code would cause a crash.
>>
>> If I were wanting to check this out, I'd put a Scheme display statement at
>> the top of scm/context-properties.scm.
>
> Interesting.  IIRC i had similar problems with my ambitus patch.  I'll
> look at this when i return to it.
>
>> If you could post a patch set on Rietveld, we might be able to give you
>> better advice.
>
> If you have any problem with Rietveld, i'll gladly help you; I can
> upload your patch if you want.
>
> cheers,
> Janek
>
Patch attached. I've looked at the web page for rietveld, and I run
gentoo so things do "just build" for me (gentoo bugs excepted :-) Do I
need the git-cl stuff? I don't know what LilyDev is, but I guess I
haven't got it ...

If you look at the patch, the idea is that all of my changes (apart from
the initial setting of bool capo) should be set inside an "if capo"
conditional, so if the user doesn't set capoPitch, lily doesn't go
anywhere near my code.

Cheers,
Wol

0001-Modify-chord-name-engraver-to-print-transposed-guita.patch (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Carl Sorensen



On 7/5/11 3:06 PM, "Wols Lists" <[hidden email]> wrote:

> On 05/07/11 21:29, Jan Warchoł wrote:
>> 2011/7/5 Wols Lists <[hidden email]>:
>>> This frog is back ... I said I'd wait until 2.14 which has finally
>>> arrived :-) But I've revamped my code a bit and am having problems...
>>
>> Could you send me a link to the previous discussion on this topic? A
>> quick search didn't return anything.

First email in the chain is
http://lilypond-frogs.2124236.n2.nabble.com/chord-name-engraver-plus-capo-td
5462185.html
>>
>> 2011/7/5 Carl Sorensen <[hidden email]>:

>>
> Patch attached. I've looked at the web page for rietveld, and I run
> gentoo so things do "just build" for me (gentoo bugs excepted :-) Do I
> need the git-cl stuff? I don't know what LilyDev is, but I guess I
> haven't got it ...

If you get git-cl, then you can easily post a patch for review on Rietveld
just by doing git-cl upload master.

Then we have a nice side-by-side diff that we can use to give you feedback.

>
> If you look at the patch, the idea is that all of my changes (apart from
> the initial setting of bool capo) should be set inside an "if capo"
> conditional, so if the user doesn't set capoPitch, lily doesn't go
> anywhere near my code.

I'll try to give it an eyeball tonight.

Thanks,

Carl


---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Jan Warchol
In reply to this post by Wols Lists
2011/7/5 Wols Lists <[hidden email]>:
> On 05/07/11 21:29, Jan Warchoł wrote:
>> Could you send me a link to the previous discussion on this topic? A
>> quick search didn't return anything.
>
> Look for frog emails with a subject containing "chord-name-engraver"

Ah, i forgot that i should look on frogs, not on devel.

> from august last year ... yes I know it's a long time ...

i have a patch that is a work in progress since half a year.  So don't
worry about long pauses :)

> but 2.14 was
> supposed to be out rsn back then :-) and life happened to me :-)
>
> Just to give a quick overview of the purpose of the changes - let's say
> you've got a piano sheet with guitar chords. Very often, it'll be in a
> naff key for the guitar and you want to display the guitar chords
> transposed by a capo.
>
> So if the actual chord is C, and you want capo 3, you want the chord to
> actually print as "C (A)", ie the original chord followed by the
> transposed chord in brackets.

Ah, perfect! This explains everything.
I play guitar a bit too and i like your idea!  I didn't know that such
a notation was commonly used.

>> If you have any problem with Rietveld, i'll gladly help you; I can
>> upload your patch if you want.
>>
>> cheers,
>> Janek
>>
> Patch attached. I've looked at the web page for rietveld, and I run
> gentoo so things do "just build" for me (gentoo bugs excepted :-) Do I
> need the git-cl stuff?

Yes, you need git cl to upload to Rietveld (AFAIK).
http://lilypond.org/doc/v2.15/Documentation/contributor/commits-and-patches#uploading-a-patch-for-review
says something about it.
But don't worry now, as i've just uploaded it:
http://codereview.appspot.com/4626094/

 I don't know what LilyDev is, but I guess I
> haven't got it ...

LilyDev isn't necessary for Rietveld.

> If you look at the patch, the idea is that all of my changes (apart from
> the initial setting of bool capo) should be set inside an "if capo"
> conditional, so if the user doesn't set capoPitch, lily doesn't go
> anywhere near my code.

Good.
I'll take a closer look tomorrow.

thanks,
Janek

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
On 05/07/11 23:05, Jan Warchoł wrote:
> Yes, you need git cl to upload to Rietveld (AFAIK).
> http://lilypond.org/doc/v2.15/Documentation/contributor/commits-and-patches#uploading-a-patch-for-review
> says something about it.
> But don't worry now, as i've just uploaded it:
> http://codereview.appspot.com/4626094/

That's the page I was looking at ...

ashdown git # git clone git://neugierig.org/git-cl.git
Cloning into git-cl...
neugierig.org[0: 208.94.116.153]: errno=No route to host
neugierig.org[0: 208.94.117.38]: errno=No route to host
neugierig.org[0: 208.94.116.102]: errno=No route to host
fatal: unable to connect a socket (No route to host)
ashdown git #

So no, it looks like I can't install it at the moment :-(

But thanks for uploading it. And yes, that notation is pretty standard
in modern church music - don't know about elsewhere - but music-books
are published with the piano score and guitar chords above. And if the
piano is in four flats ... :-(

Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
On 05/07/11 23:20, Wols Lists wrote:
> But thanks for uploading it. And yes, that notation is pretty standard
> in modern church music - don't know about elsewhere - but music-books
> are published with the piano score and guitar chords above. And if the
> piano is in four flats ... :-(

Just looked at it on Rietveld and discovered one bug ... "bool capo" is
declared twice, so that's why it didn't work ... (delete the inner
declaration to fix that).

And discovered why I was getting "cannot find property type-check" - I
ran "make" in the wrong directory, so my guess that the live scheme
wasn't being updated seems to have been right ... that appears to be
working now.

But I've now got another error.

anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $ lilypond
HeGaveMeBeautyForAshes.ly
GNU LilyPond 2.15.5
Processing `HeGaveMeBeautyForAshes.ly'
Parsing...
Interpreting music... ERROR: Unbound variable: line_markup
anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $

So obviously my code is creating a duff markup somewhere ...

Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Jan Warchol
2011/7/6 Wols Lists <[hidden email]>:

> On 05/07/11 23:05, Jan Warchoł wrote:
>> Yes, you need git cl to upload to Rietveld (AFAIK).
>> http://lilypond.org/doc/v2.15/Documentation/contributor/commits-and-patches#uploading-a-patch-for-review
>> says something about it.
>> But don't worry now, as i've just uploaded it:
>> http://codereview.appspot.com/4626094/
>
> That's the page I was looking at ...
>
> ashdown git # git clone git://neugierig.org/git-cl.git
> Cloning into git-cl...
> neugierig.org[0: 208.94.116.153]: errno=No route to host
> neugierig.org[0: 208.94.117.38]: errno=No route to host
> neugierig.org[0: 208.94.116.102]: errno=No route to host
> fatal: unable to connect a socket (No route to host)
> ashdown git #
>
> So no, it looks like I can't install it at the moment :-(

Hm, i'm afraid i cannot help you with this - it's beyond my knowledge :(

2011/7/6 Wols Lists <[hidden email]>:
> On 05/07/11 23:20, Wols Lists wrote:
>> But thanks for uploading it. And yes, that notation is pretty standard
>> in modern church music - don't know about elsewhere - but music-books
>> are published with the piano score and guitar chords above. And if the
>> piano is in four flats ... :-(
>
> Just looked at it on Rietveld and discovered one bug ... "bool capo" is
> declared twice, so that's why it didn't work ... (delete the inner
> declaration to fix that).

I see you added a comment about that in Rietveld - that's good - but
did you click "Publish+Mail Comments"? I don't see your comment being
announced on the mailing list.

Do you use lily-git.tcl?

Now a word on making changes to your patch.  A Rietveld issue can
belong to only one person; this means than every change to this issue
must be uploaded by me.  We usually ask contributors to fix everythig
themselves and send consecutive patches to the person who can upload
them, because it's easier to avoid confusion and messing up our
repositories (example: i upload your fisrt patch.  Then i spot a wrong
indent or something like that, so i fix it and upload modified version
of your patch. Meanwhile you discover a bug and change your patch -
but you didn't know about my indent fix.  When we try to synchronize,
we have a mess).  This is especially important if you use
lily-git.tcl.
If you are a bit more familiar with git (i.e. can apply someone else's
patch), i can make small changes like deleting this doubled
declaration myself, upload them and send them to you.  But this is
risky, so i don't recommend that.
So, please delete the inner declaration, make a new patch and send it
to me, and i'll upload it.  It would be nice if you fixed trailing
whitespace (there are several empty lines with spaces).  You can check
for trailing whitespace by calling 'git diff origin/master' command in
your lilypond-git directory (of course, your should pull first) and
looking for red rectangles.
(press q to exit 'viewing diff' mode)

Please ask if anything is not clear.

cheers,
Janek

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Jan Warchol
In reply to this post by Wols Lists
2011/7/6 Wols Lists <[hidden email]>:

> And discovered why I was getting "cannot find property type-check" - I
> ran "make" in the wrong directory, so my guess that the live scheme
> wasn't being updated seems to have been right ... that appears to be
> working now.
>
> But I've now got another error.
>
> anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $ lilypond
> HeGaveMeBeautyForAshes.ly
> GNU LilyPond 2.15.5
> Processing `HeGaveMeBeautyForAshes.ly'
> Parsing...
> Interpreting music... ERROR: Unbound variable: line_markup
> anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $
>
> So obviously my code is creating a duff markup somewhere ...

Hmm. I get this too.
Ha! I think i found it! Change line_markup to line-markup and
hspace_markup to hspace-markup.  Apparently naming changed.

HTH,
Janek

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
On 06/07/11 10:01, Jan Warchoł wrote:

> 2011/7/6 Wols Lists <[hidden email]>:
>> And discovered why I was getting "cannot find property type-check" - I
>> ran "make" in the wrong directory, so my guess that the live scheme
>> wasn't being updated seems to have been right ... that appears to be
>> working now.
>>
>> But I've now got another error.
>>
>> anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $ lilypond
>> HeGaveMeBeautyForAshes.ly
>> GNU LilyPond 2.15.5
>> Processing `HeGaveMeBeautyForAshes.ly'
>> Parsing...
>> Interpreting music... ERROR: Unbound variable: line_markup
>> anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $
>>
>> So obviously my code is creating a duff markup somewhere ...
>
> Hmm. I get this too.
> Ha! I think i found it! Change line_markup to line-markup and
> hspace_markup to hspace-markup.  Apparently naming changed.
>
Thanks!

I'll run all your changes. There's a fancy-formatter there too iirc?
That'll fix all the formatting to project standard?

I'll get shot by the wife if I start working on this now, so I'll attack
it this evening and send you a new patch :-)

Cheers,
Wol

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
On 06/07/11 10:10, Wols Lists wrote:

> On 06/07/11 10:01, Jan Warchoł wrote:
>> 2011/7/6 Wols Lists <[hidden email]>:
>>> And discovered why I was getting "cannot find property type-check" - I
>>> ran "make" in the wrong directory, so my guess that the live scheme
>>> wasn't being updated seems to have been right ... that appears to be
>>> working now.
>>>
>>> But I've now got another error.
>>>
>>> anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $ lilypond
>>> HeGaveMeBeautyForAshes.ly
>>> GNU LilyPond 2.15.5
>>> Processing `HeGaveMeBeautyForAshes.ly'
>>> Parsing...
>>> Interpreting music... ERROR: Unbound variable: line_markup
>>> anthony@ashdown ~/gitstuff/music/Hymnal/Choruses $
>>>
>>> So obviously my code is creating a duff markup somewhere ...
>>
>> Hmm. I get this too.
>> Ha! I think i found it! Change line_markup to line-markup and
>> hspace_markup to hspace-markup.  Apparently naming changed.
>>
> Thanks!
>
> I'll run all your changes. There's a fancy-formatter there too iirc?
> That'll fix all the formatting to project standard?
>
> I'll get shot by the wife if I start working on this now, so I'll attack
> it this evening and send you a new patch :-)
>
Fixes made. I'm happy with it now, it appears to work fine :-)

I presume I need to document it now, sort out a regression test, etc?
The code seems perfectly okay.

The only problem I'm having at the moment is with make-pitch - I want to
document a sharp or flat, and it wants to take an integer as the third
argument. Experiment isn't being that helpful at finding what that third
argument should be (-1 is returning either a double-flat or half-flat,
not sure which). The docu says "alter is a rational number of 200-cent
whole tones", but without an example I can't understand what that
actually means - the words are clear but the meaning isn't :-(

Cheers,
Wol

0002-Transposed-guitar-chords-on-piano-score.patch (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Jan Warchol
2011/7/6 Wols Lists <[hidden email]>:
> Fixes made. I'm happy with it now, it appears to work fine :-)

Do parentheses look good? I remember that they were sort of weird...

> I presume I need to document it now, sort out a regression test, etc?

Both a regression test and an entry in the docs (probably in NR 2.7.2
-> Printing chord names) should be done.

> The only problem I'm having at the moment is with make-pitch - I want to
> document a sharp or flat, and it wants to take an integer as the third
> argument. Experiment isn't being that helpful at finding what that third
> argument should be (-1 is returning either a double-flat or half-flat,
> not sure which). The docu says "alter is a rational number of 200-cent
> whole tones",

since 1 semitone = 100 cents, i'd try 0.5 as the third argument.

thanks,
Janek

PS do you use git from command line or via lily-git?

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
In reply to this post by Wols Lists
On 06/07/11 19:09, Wols Lists wrote:
> The only problem I'm having at the moment is with make-pitch - I want to
> document a sharp or flat, and it wants to take an integer as the third
> argument. Experiment isn't being that helpful at finding what that third
> argument should be (-1 is returning either a double-flat or half-flat,
> not sure which). The docu says "alter is a rational number of 200-cent
> whole tones", but without an example I can't understand what that
> actually means - the words are clear but the meaning isn't :-(

Managed to find it :-) It thinks that -1/2 is an integer ... :-)

Documentation snippet attached, it needs to go in the Notation
Reference, section 2.7.2 Displaying chords, subsection Printing chord names.

Cheers,
Wol

capoPitch-docu.txt (640 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Jan Warchol
2011/7/6 Wols Lists <[hidden email]>:

> On 06/07/11 19:09, Wols Lists wrote:
>> The only problem I'm having at the moment is with make-pitch - I want to
>> document a sharp or flat, and it wants to take an integer as the third
>> argument. Experiment isn't being that helpful at finding what that third
>> argument should be (-1 is returning either a double-flat or half-flat,
>> not sure which). The docu says "alter is a rational number of 200-cent
>> whole tones", but without an example I can't understand what that
>> actually means - the words are clear but the meaning isn't :-(
>
> Managed to find it :-) It thinks that -1/2 is an integer ... :-)

:)

> Documentation snippet attached, it needs to go in the Notation
> Reference, section 2.7.2 Displaying chords, subsection Printing chord names.

Could you prepare a formal patch? You'll need to modify
lilypond-git/Documentation/notation/chords.itely, around line 450.
Look at adjacent code to see how it should be formatted.

thanks,
Janek

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: chord_name_engraver - help with c++ ...

Wols Lists
In reply to this post by Jan Warchol
On 06/07/11 20:22, Jan Warchoł wrote:
> PS do you use git from command line or via lily-git?

From the command line. git is now my VCS of choice.

Cheers,
Wol

---
----
Join the Frogs!

12