# Bar lines in lilypond

I want to control on the locations of the bar lines (yellow marked). I want to move them to any other places when ever I would like to do. its seems to me that bar lines pop up automaticaly...

For example, see part of my code:

\relative {
\key g \minor
\numericTimeSignature
\time 4/4
\fdo g'8 \ \bar "|"
\fre d'4  \fre d4  \fsol g4, \fdo c4 \fdo c4 \fsol g4 \bar "|"
\fsi b2.
}


• Looking at your Lilypond code, it looks like what you want isn't 4/4 time (unlike your code), but 6/4 or 3/2 time. Sep 18 at 14:30

As Kilian and Richard both say, you need to do two things:

1. Change the time signature to 6/4 (or 3/2)
2. Add a "partial" (because of the upbeat). This is an eighth note, so \partial 8

With these changes, Lilypond will automatically add bar lines in the correct places. You can add a "|" symbol to indicate that you think a bar line should go here (and Lilypond will check that it agrees).

Here's your example with these changes (omitting the fingering diagrams):

\version "2.22.1" % It should work with other versions too!
\language "english"

\relative {
\key g \minor
\numericTimeSignature
\time 6/4 % changed!
g'8 |
d'4 d4 g,4 c4 c4 g4 |
b2.
}


Result:

The bar lines pop up wherever the time signature tells them to. If you want them in the correct places, use the right \time signature for your piece, and don't forget to use \partial if you have an upbeat.

• The Lilypond code in the OP uses 4/4 time, though. How come the highlighted barlines aren't in the usual places for 4/4 time (pickup or no pickup)? Sep 18 at 14:32

As Kilian says, you'll need to change the time signature whenever you do so.

However, you can suppress the display of the time signature by including \with { \omit TimeSignature } in your Staff. For example, the following snippet from the LilyPond Snippet Repository shows how this can be done:

\new Staff \with { \omit TimeSignature } {
\relative c'' {
\time 3/4
c4 c c
\time 2/4
c4 c
\time 3/4
c4 c c
\time 2/4
c4 c
\time 5/4
c4 c c c c
\time 2/4
c4 c
}
}


• ok , relating to part of my code, how do I need to re-write it? Sep 18 at 15:25
• Can you edit your question to include your full original code? That way I can more clearly shows what needs to happen.
– Richard
Sep 18 at 15:27
• \relative { \key g \minor \numericTimeSignature \time 4/4 \fdo g'8 \ \bar "|" \fre d'4 \fre d4 \fsol g4, \fdo c4 \fdo c4 \fsol g4 \bar "|" \fsi b2. } Sep 18 at 15:40
• I can not reload the notes in comment mode but the image added at the begining of my question. Thank a lot. Sep 18 at 15:42
• please ignore to \fdo..\fre, those are woodwing functions... Sep 18 at 15:44