Bug in \chords in latest developer version?

2020-02-14 Thread SK
Hello,

I found very strange behaviour of \chords when used together with
\numericTimeSignature. Check the following code:

\new Score {
<<
\chords { c1 g c g }
\relative c' { \numericTimeSignature c4-1 c c2 d4 d d2 e4 e e c e2 d \bar
"|." }
>>
}

When running it on LilyBin, it compiles correctly with the latest stable
version, but with latest unstable, it shows no notes or staff, but only a
line of chords. I tried to move the \numericTimeSignature to different
places, but neither worked: Sometimes I got the chords below my staff,
sometimes I got an extra staff with just the timeSignature - I think the
place where I have it should work.
Are there any changes in the unstable version to this part, or is it simply
a bug?

Kind regards,
SK


Re: Detecting double accidentals

2020-01-22 Thread SK
Thank you David, that works perfectly. I would have probably never found
this way, even if I understand what it does.

Sorry for the late response, didn't expect an answer that fast.

If anyone is interested in this project, the full code as well as a
quick-and-dirty documentation is available as a gist on GitHub:
https://gist.github.com/TheNothingMan/6f5daf540d55b4ad9138e3ff5d3ffbd0

Thank you, kind regards!

Am Di., 21. Jan. 2020 um 21:50 Uhr schrieb David Kastrup :

> SK  writes:
>
> > Hello,
> >
> > I wrote a script for generating music theory worksheets for school. One
> > feature is the generation of chords that should be named by the students.
> > The way this function works is by simply transposing some predefined
> chords
> > to a new randomly generated root. To keep the difficulty controllable, I
> > would like to filter out double accidentals in some cases, e.g. to not
> > produce an augmented F# chord.
> > Does anybody know about a way to check in scheme if music has double
> > accidentals, or can think of another smart way of doing this?
> >
> > I would not want to define all possible chords manually, and I think that
> > filtering out certain root notes is quite complex, too, if you just want
> to
> > avoid double accidentals.
> >
> > Kind regards!
>
> #(define (has-doubles mus)
>(any (lambda (p) (not (< -1 (ly:pitch-alteration p) 1)))
>  (music-pitches mus)))
>
> #(display (map has-doubles
>   (list #{ c'4 d' e' fis' g' a' b' #}
> #{ cisis'4 d' e' #})))
>
> --
> David Kastrup
>


Detecting double accidentals

2020-01-21 Thread SK
Hello,

I wrote a script for generating music theory worksheets for school. One
feature is the generation of chords that should be named by the students.
The way this function works is by simply transposing some predefined chords
to a new randomly generated root. To keep the difficulty controllable, I
would like to filter out double accidentals in some cases, e.g. to not
produce an augmented F# chord.
Does anybody know about a way to check in scheme if music has double
accidentals, or can think of another smart way of doing this?

I would not want to define all possible chords manually, and I think that
filtering out certain root notes is quite complex, too, if you just want to
avoid double accidentals.

Kind regards!


Re: printKeyCancellation not working as expected

2019-02-28 Thread SK
Thanks, this works and is cleaner than overwriting the stencil.

-- Forwarded message --
> From: SK 
> To: lilypond-user@gnu.org
> Cc:
> Bcc:
> Date: Wed, 27 Feb 2019 16:13:24 +0100
> Subject: printKeyCancellation not working as expected
> Hello,
>
> I would like to be able to change key signatures without ANY hints for
> educational purposes. For this I use Staff.printKeyCancellation set to
> false, together with the visibility options for key signatures. It works
> fine for most keys, but when changing to a key without any accidentals such
> as c major, the natural signs are shown and tell the student where there
> have been accidentals before.
> Any help would be very appreciated.
>
>
>
>
>
> -- Forwarded message --
> From: Malte Meyn 
> To: lilypond-user@gnu.org
> Cc:
> Bcc:
> Date: Wed, 27 Feb 2019 16:18:45 +0100
> Subject: Re: printKeyCancellation not working as expected
>
>
> Am 27.02.19 um 16:13 schrieb SK:
> > Hello,
> >
> > I would like to be able to change key signatures without ANY hints for
> > educational purposes. For this I use Staff.printKeyCancellation set to
> > false, together with the visibility options for key signatures. It works
> > fine for most keys, but when changing to a key without any accidentals
> > such as c major, the natural signs are shown and tell the student where
> > there have been accidentals before.
> > Any help would be very appreciated.
>
> Try
> \omit Staff.KeyCancellation
> instead.
>
>
> ___
> 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


printKeyCancellation not working as expected

2019-02-27 Thread SK
Hello,

I would like to be able to change key signatures without ANY hints for
educational purposes. For this I use Staff.printKeyCancellation set to
false, together with the visibility options for key signatures. It works
fine for most keys, but when changing to a key without any accidentals such
as c major, the natural signs are shown and tell the student where there
have been accidentals before.
Any help would be very appreciated.
\new Score {
  \key g \major
f4 g a b
\set Staff.explicitKeySignatureVisibility = #all-invisible
\set Staff.printKeyCancellation = ##f
\override Staff.KeySignature.break-visibility = #all-invisible
\key f \major
f4 g a b 
\key c\major
f4 g a b
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Get NoteName as String

2018-10-14 Thread SK
Hello,

I try to find a way to get a notename as string, so that it can be
processed further. To be concrete, I want to build a scale task generator
that randomly selects a pitch and scale, then prints the scale as notes as
well as the tonic/root/finalis and the mode as lyrics (or other text). The
result should look like the file I attached, but it is important to insert
the pitch in the lyrics automatically.

I tried to get the text from a NoteNames context, but didn't come close to
what I need. Maybe someone out there has a better idea...

All the best!
\score {
 {
   \key #(ly:make-pitch 1 3 0) \dorian
   <<
   \transpose d f
   { d' e' f' g' a' b' c'' d'' }
   \new NoteNames {  } >>
 } \addlyrics { "f dorian" _ }
}___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user