Re: Can't call some functions from translation-functions

2023-12-16 Thread Sebastian Käppler
And that did the trick. Thank you very much, now I can get to actually work
on my markup...

Am Sa., 16. Dez. 2023 um 14:28 Uhr schrieb Aaron Hill <
lilyp...@hillvisions.com>:

> On 2023-12-16 5:27 am, Aaron Hill wrote:
> > On 2023-12-16 5:20 am, Sebastian Käppler wrote:
> >> Hello Aaron,
> >>
> >> thanks for your response. I tried use-modules and got "
> >>
> >> no code for module (scm display-lily)".
> >>
> >> If that is of interest, I use Frescobaldi on Windows with lilypond
> >> 2.24.1.
> >
> > Oh, whoops.  I'm still back on 2.22.0, myself.
> >
> > I think it's (use-modules (lily display-lily)) now.
>
> Sigh, and adding the mailing list back to the thread for visibility.
> Sorry about that.
>
>
> -- Aaron Hill
>


Can't call some functions from translation-functions

2023-12-16 Thread Sebastian Käppler
Hello,

I'm trying to use some of the functions in translation-functions.scm to
create my own note name markup. However, if I use note-name->lily-string or
octave->lily-string, I get an "unbound variable" error for that function. I
even tried to copy the whole note-name-markup code from the source to my
code and rename it to note-name-custom-markup. But if I use this in \set
noteNameFunction, I get that same error.
Sorry if this is a dumb question, but I'm still trying to familiarize
myself with most concepts of scheme...

Kind regards!


Bug in NoteName - Accidentals?

2023-12-14 Thread Sebastian Käppler
Hello again,

following the Changes to Notename - topic, I have another question. Using
printAccidentalNames seems to override the printNotesLanguage property by
reverting it to the document language. Try the following example and
comment out one of the two lines. Expected result would be to get c' h' b'
a' as note names. I only get this if using \language="deutsch" before.


melody = { c' b' bes' a' }

\score {
  <<
\new Staff { \melody }
\new NoteNames {
  *\set printNotesLanguage = "deutsch"*
  \set printOctaveNames = ##t
*  \set printAccidentalNames = #'lily*
  \melody
}
  >>
  \layout {}
}

Best regards!


Re: Changes to Notename - lost some functionality

2023-12-14 Thread Sebastian Käppler
Hello and thank you very much for your input on this topic. I will try to
follow the suggestions and implement my own procedure for the note names.
I'll report back if I have success or new questions.
Again, thank you very much!


Changes to Notename - lost some functionality

2023-12-13 Thread Sebastian Käppler
Dear lilypond experts,

I seem to have missed some changes to LilyPond between 2.19.82 and current
versions. I use a quite big script to automatically generate some music
theory tasks for my students (in German). I'll post the complete example
below. However, my code for creating note names doesn't work anymore. The
line printed bold probably is causing problems:
\context NoteNames \with {
%%% Show notenames only for reading tasks
   * \override NoteName.stencil = #(if (and (not solution) (equal? mode
#\r)) blankNoteNames germanNoteNames)*
\override NoteName.Y-offset = -2
\override NoteName.X-offset = -1
  }

germanNoteNames is:
germanNoteNames =
#(lambda (grob)
   (let* ((default-name (ly:grob-property grob 'text))
  (new-name (assoc-get default-name newnames)))
 (ly:grob-set-property! grob 'text new-name)
   (ly:text-interface::print grob)))

I can run this code, but get "Trying to interpret a non-markup object: #f". The
blanks (or note names) are printed, but I don't get actual note names.

Any help on this would be appreciated, I'm a bit lost now where to start.
I've attached the current version of my script below, with example code at
the end of the file. My last working version and it's "documentation" can
be found at
https://gist.github.com/TheNothingMan/6f5daf540d55b4ad9138e3ff5d3ffbd0

Thank you very much for any help!


school.ly
Description: Binary data


Re: Markup and Score from scheme function

2018-10-14 Thread Sebastian Käppler
Finally, I found that the given answers satisfy all my needs as of now.
Thank you very much!

Sebastian Käppler  schrieb am Sa., 13. Okt.
2018, 09:26:

> Add-text is even better. Still curious if it's possible to get the
> "context" inside the function. Isn't that what the location parameter is
> for?
>
> Thomas Morley  schrieb am Fr., 12. Okt. 2018,
> 10:29:
>
>> Am Fr., 12. Okt. 2018 um 08:10 Uhr schrieb Jan-Peter Voigt <
>> jp.vo...@gmx.de>:
>> >
>> > Hello Sebastian,
>> >
>> > what do you mean with "return"? Do want to add the score immediatly or
>> > do you want to return an object containing both?
>> > You used the parser-location arguments in your scheme-function, so I
>> > guess you are using stable (2.18). I created an example for 2.18
>> > (incomplete) and one for 2.19.82. For three possible functions.
>> >
>> > HTH
>> > Jan-Peter
>>
>> Hi,
>>
>> for immediate addings, why not the simpler:
>>
>> example =
>> #(define-void-function (mrkp scr) (markup? ly:score?)
>>   (add-text mrkp)
>>   (add-score scr))
>>
>> \example
>>  \markup \bold "Test"
>>  \score { c'4 }
>>
>> \example
>>  \markup \italic "Test"
>>  \score { cis'4 }
>>
>> Cheers,
>>   Harm
>>
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Markup and Score from scheme function

2018-10-13 Thread Sebastian Käppler
Add-text is even better. Still curious if it's possible to get the
"context" inside the function. Isn't that what the location parameter is
for?

Thomas Morley  schrieb am Fr., 12. Okt. 2018,
10:29:

> Am Fr., 12. Okt. 2018 um 08:10 Uhr schrieb Jan-Peter Voigt <
> jp.vo...@gmx.de>:
> >
> > Hello Sebastian,
> >
> > what do you mean with "return"? Do want to add the score immediatly or
> > do you want to return an object containing both?
> > You used the parser-location arguments in your scheme-function, so I
> > guess you are using stable (2.18). I created an example for 2.18
> > (incomplete) and one for 2.19.82. For three possible functions.
> >
> > HTH
> > Jan-Peter
>
> Hi,
>
> for immediate addings, why not the simpler:
>
> example =
> #(define-void-function (mrkp scr) (markup? ly:score?)
>   (add-text mrkp)
>   (add-score scr))
>
> \example
>  \markup \bold "Test"
>  \score { c'4 }
>
> \example
>  \markup \italic "Test"
>  \score { cis'4 }
>
> Cheers,
>   Harm
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Markup and Score from scheme function

2018-10-12 Thread Sebastian Käppler
Thanks for your help, I found the add-score function to work in the way I
want it to. Never stumbled across it in the documentation, though...

Jan-Peter, I want to add both the markup and the score immediately.

Another question, is it possible to determine inside the function if it is
called from a score context, that means to distinguish these two cases:

A:
\score {
 \myfunction
}

B:
\myfunction
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Markup and Score from scheme function

2018-10-11 Thread Sebastian Käppler
Hello,

I wonder if it is possible to return markup AND score from a single scheme
function, something like this:

example = #(define-scheme-function (parser location) ()
#{
\markup "Test"
\score {
   c'4
}
#}
)

I created some scripts for teaching and want to include task-markup before
each score. Using markup and my functions outside of scheme works, but I
couldn't get  it to work from a single function.

Kind regards
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user