Repeat midi using "repeat volta"

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

Repeat midi using "repeat volta"

Jannik Jeppesen
Hi,
How is it posible to create a midi file repeating a bar 20 times, but still
using the command

    \repeat volta 20 {
    }
?

If i write unfold, it generates 20 bars in the layout, and thats not what i
need.
Until now I have created 2 files, a layout file, and a midi....but isn´t it
possible to do it in one file?

Best wishes

Jannik



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Gilles Sadowski

> How is it posible to create a midi file repeating a bar 20 times, but still
> using the command
>
>    \repeat volta 20 {
>    }
> ?
>
> If i write unfold, it generates 20 bars in the layout, and thats not what i
> need.
> Until now I have created 2 files, a layout file, and a midi....but isn´t
> it possible to do it in one file?
>

Yes, it is:

%---
\version "2.6.0"

themusic = \new Staff
\relative c'' {
  \repeat volta 20 {
    a b c d |
  }
}

\score {
  \themusic
  \layout {}
}

\score {
  \unfoldRepeats \themusic
  \midi { \tempo 4 = 60 }
}
%---


Best,
Gilles


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Jannik Jeppesen
Hi.... this should work right?
But it generates a correct pdf, but the midi file is emty...
Can you figure out the problem?
Cheers
Jannik
==========
\version "2.6.3"

\header {
  title = "A-mol pentaton skala"
}

\paper {
  #(set-paper-size "a4")
  tagline = "Jannik Jeppesen"
  indent = 0\cm
}

pentatonic = \relative c {
  \key a \minor
  \time 4/4
    \repeat volta 20 {
  a8\6 c\6 d\5 e\5 g\4 a\4 c\3 d\3 e\2 g\2 a\1 c\1
  a\1 g\2 e\2 d\3 c\3 a\4 g\4 e\5 d\5 c\6
}}

guitar = {
  \context Staff {
  \clef "G_8"
  \pentatonic
  }
}

guitartab = {
  \context TabStaff {
  \override Beam #'transparent = ##t
  \override Stem #'transparent = ##t
  \pentatonic
  }
}

\score {
  <<
    \context Staff = guitar \guitar
    \context TabStaff = guitar \guitartab
  >>
\layout { }
}
\score {
  \unfoldRepeats \pentatonic
  \midi { \tempo 4 = 120 }
}
==================
----- Original Message -----
From: "Gilles" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, November 17, 2005 1:28 AM
Subject: Re: Repeat midi using "repeat volta"



> How is it posible to create a midi file repeating a bar 20 times, but
> still
> using the command
>
>    \repeat volta 20 {
>    }
> ?
>
> If i write unfold, it generates 20 bars in the layout, and thats not what
> i
> need.
> Until now I have created 2 files, a layout file, and a midi....but isn´t
> it possible to do it in one file?
>

Yes, it is:

%---
\version "2.6.0"

themusic = \new Staff
\relative c'' {
  \repeat volta 20 {
    a b c d |
  }
}

\score {
  \themusic
  \layout {}
}

\score {
  \unfoldRepeats \themusic
  \midi { \tempo 4 = 60 }
}
%---


Best,
Gilles


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user 



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Gilles Sadowski
Hello.

> Hi.... this should work right?

Well...  It doesn't, hence I started to reorganize your example
so that it would look like the layout I'm used to; and this
works:

%-----
\version "2.6.3"

pentatonic = \relative c {
  \time 4/4
  \repeat volta 20 {
    a8\6 c\6 d\5 e\5 g\4 a\4 c\3 d\3 e\2 g\2 a\1 c\1
    a\1 g\2 e\2 d\3 c\3 a\4 g\4 e\5 d\5 c\6
  }
}

guitar = \context Staff = "guitar" {
  \set Staff.midiInstrument = "acoustic guitar (nylon)"
  \key a \minor
  \clef "G_8"
  \pentatonic
}

guitartab = \context TabStaff = "guitartab" {
  \override Beam #'transparent = ##t
  \override Stem #'transparent = ##t
  \pentatonic
}

\score {
  <<
    \guitar
    \guitartab
  >>
  \layout {}
}

\score {
  \unfoldRepeats \guitar
  \midi { \tempo 4 = 120 }
}
%-----


So, you can compare your way of doing things to the above
and figure out why yours didn't work. [To start: I think
that having several contexts with the same name is not
good...].


Regards,
Gilles


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Jannik Jeppesen
In reply to this post by Jannik Jeppesen
Now I have finely found out how to repeat midi, using volta in the layout, in guitar mode... (Thanx to Gilles)...
But can´t figure out how to do it in drum mode...
Anyone who has experience in this area?
I want the figure to be continued 4 times using volta, but played 4 times in midi as well..
 
Best wishes
Jannik
 
=======================
\version "2.6.3"
 
\header {title = " "
  composer = " "
}
 
\paper {
  tagline = " "
  indent = 0\cm
}
 
\layout {
  \context {
    \DrumVoice
    \override Beam #'positions = #'(5 . 5)
 
  }
}
\score {
  \new DrumStaff <<
    intro = \drummode { \stemUp
      \repeat volta 4 {
        <bd hh>8 hh hh hh <sn hh> hh <bd hh> <bd hh>
        hh hh hh hh <sn hh> hh hh hh
      }
    }
  >>
}
\score {
  \unfoldRepeats \intro
    \midi { \tempo 4 = 120 }
}
======================

_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Gilles Sadowski

Reworked, it works ;-)

%-----
\version "2.6.3"

intro = \new DrumStaff {
  \new DrumVoice {
    \override Beam #'positions = #'(5 . 5)
    \drummode {
      \stemUp
      \repeat volta 4 {
        <bd hh>8 hh hh hh <sn hh> hh <bd hh> <bd hh>
        hh hh hh hh <sn hh> hh hh hh
      }
    }
  }
}

\score {
  \intro
  \layout {}
}

\score {
  \unfoldRepeats \intro
  \midi { \tempo 4 = 120 }
}
%-----


- Assigning/defining a variable (here: "intro") must be done
  at the top level (i.e. not inside "\score").
- Whatever is needed to create a "voice" (here: "\new DrumVoice")
  will be necessary both for the layout and the midi.


Gilles


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Jannik Jeppesen
Hey.
Thanx for all your answers, they are great.

In the file I´m sending now, there is a intro AND a chorus in drummode...
How does it work now. Later on I´ll ad verse, instrumental etc..  How does
this work, when I need  a pdf and a midi?
I have writen my idea.... but it definitly doesn´t work:-( It only generates
the chorus in pdf???

Jannik

=================
\version "2.6.3"

\header {title = " "
  composer = "Jannik Jeppesen"
}

\paper {
  tagline = "Jannik Jeppesen"
  indent = 0\cm
}

intro = \new DrumStaff {
  \new DrumVoice {
    \override Beam #'positions = #'(5 . 5)
    \drummode {
      \stemUp
      \repeat volta 4 {
<bd hh>8 hh hh hh <sn hh> hh <bd hh> <bd hh>
hh hh hh hh <sn hh> hh hh hh
      }
    }
  }
}

chorus = \new DrumStaff {
  \new DrumVoice {
    \override Beam #'positions = #'(5 . 5)
    \drummode {
      \stemUp
      \repeat volta 4 {
<bd hh>16 hh hh hh <sn hh> hh hh hh <bd hh> hh hh hh <sn hh> hh hh hh
      }
    }
  }
}

\score {
  \intro
  \chorus
  \layout {}
}

\score {
  \unfoldRepeats \intro
  \unfoldRepeats \chorus
  \midi { \tempo 4 = 132 }
}
====================
----- Original Message -----
From: "Gilles" <[hidden email]>
To: <[hidden email]>
Sent: Friday, November 18, 2005 1:37 AM
Subject: Re: Repeat midi using "repeat volta"


>
> Reworked, it works ;-)
>
> %-----
> \version "2.6.3"
>
> intro = \new DrumStaff {
>  \new DrumVoice {
>    \override Beam #'positions = #'(5 . 5)
>    \drummode {
>      \stemUp
>      \repeat volta 4 {
> <bd hh>8 hh hh hh <sn hh> hh <bd hh> <bd hh>
> hh hh hh hh <sn hh> hh hh hh
>      }
>    }
>  }
> }
>
> \score {
>  \intro
>  \layout {}
> }
>
> \score {
>  \unfoldRepeats \intro
>  \midi { \tempo 4 = 120 }
> }
> %-----
>
>
> - Assigning/defining a variable (here: "intro") must be done
>  at the top level (i.e. not inside "\score").
> - Whatever is needed to create a "voice" (here: "\new DrumVoice")
>  will be necessary both for the layout and the midi.
>
>
> Gilles
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-user 



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Gilles Sadowski
>
> In the file I´m sending now, there is a intro AND a chorus in drummode...
> How does it work now. Later on I´ll ad verse, instrumental etc..  How does
> this work, when I need  a pdf and a midi?
> I have writen my idea.... but it definitly doesn´t work:-( It only
> generates the chorus in pdf???
>

What you wrote doesn't work because you defined 2 staves (whereas
you actually want to add more contents to a single staff) and the
last one "won" (i.e. replaced the first, intro, one).

You have to define the overall structure (the drum staff) once,
and fill it in with contents (intro, chorus, ...).

You can use variables to build up the whole score (what comes in
the "\score" block):

%-----
\version "2.6.3"

intro = \drummode {
  \stemUp
  \repeat volta 4 {
    <bd hh>8 hh hh hh <sn hh> hh <bd hh> <bd hh>
    hh hh hh hh <sn hh> hh hh hh
  }
}

chorus = \drummode {
  \stemUp
  \repeat volta 4 {
    <bd hh>16 hh hh hh <sn hh> hh hh hh <bd hh> hh hh hh <sn hh> hh hh hh
  }
}

drumNotes = \new DrumStaff {
 \new DrumVoice {
   \override Beam #'positions = #'(5 . 5)
   \intro
   \chorus
 }
}

\score {
  \drumNotes
  \layout {}
}

\score {
  \unfoldRepeats \drumNotes
  \midi { \tempo 4 = 120 }
}
%------


Gilles

P.S.  You should read the manual for every construct which you want
      to use.  The way to get pdf and midi is always the same, but
      when you'll want lyrics, several staves, and several voices
      per staff, it'll become more complex.  There are several
      template files in the docs, which you can start with.


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

drums and chords at same time?

Jannik Jeppesen
Hi All..

I am trying to mix drums and chords, but cant make it work.
I want the chords to be played once every bar and a hh on the quarter notes
to keep the beat.
How does this work..
My suggestion is very bad, I think...

Jannik

===============================
\version "2.6.3"

\header
{
title = "Improvise"
composer = "Jannik Jeppesen"
}

beat = \drummode { \stemUp
  \repeat unfold 20 {
    hh4 hh hh hh
  }
}

chordline = \chordmode {
  \repeat unfold 20 {
    a1:m c g e:m
  }
}

drumNotes = \new DrumStaff {
 \new DrumVoice {
   \override Beam #'positions = #'(5 . 5)
   \beat
 }
}

\score {
  \drumNotes
  \chordline
  \layout {}
}

\score {
  \unfoldRepeats \drumNotes
  \midi { \tempo 4 = 120 }
}
===========================



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: drums and chords at same time?

Mats Bengtsson-6


Jannik Jeppesen wrote:

> Hi All..
>
> I am trying to mix drums and chords, but cant make it work.
> I want the chords to be played once every bar and a hh on the quarter
> notes to keep the beat.
> How does this work..
> My suggestion is very bad, I think...

Not at all, just make sure to tell LilyPond that you want the drums and
the chords to happen in parallel:

\score {
<<
 \drumNotes
 \chordline
 >>
 \layout {}
}

Also, you may want to change 20 to 40 in
beat = \drummode { \stemUp
 \repeat unfold 20 {
   hh4 hh hh hh
 }
}

to get the same number of bars in both parts.

   /Mats


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Repeat midi using "repeat volta"

Mats Bengtsson-6
In reply to this post by Jannik Jeppesen
For some reason, it seems you have to explicitly specify a context
for the music. Try:

\score {
\new Staff{ \unfoldRepeats \pentatonic }
 \midi { \tempo 4 = 120 }
}

or

\score {
\new Voice{ \unfoldRepeats \pentatonic }
 \midi { \tempo 4 = 120 }
}


   /Mats

Jannik Jeppesen wrote:

> Hi.... this should work right?
> But it generates a correct pdf, but the midi file is emty...
> Can you figure out the problem?
> Cheers
> Jannik
> ==========
> \version "2.6.3"
>
> \header {
>  title = "A-mol pentaton skala"
> }
>
> \paper {
>  #(set-paper-size "a4")
>  tagline = "Jannik Jeppesen"
>  indent = 0\cm
> }
>
> pentatonic = \relative c {
>  \key a \minor
>  \time 4/4
>    \repeat volta 20 {
>  a8\6 c\6 d\5 e\5 g\4 a\4 c\3 d\3 e\2 g\2 a\1 c\1
>  a\1 g\2 e\2 d\3 c\3 a\4 g\4 e\5 d\5 c\6
> }}
>
> guitar = {
>  \context Staff {
>  \clef "G_8"
>  \pentatonic
>  }
> }
>
> guitartab = {
>  \context TabStaff {
>  \override Beam #'transparent = ##t
>  \override Stem #'transparent = ##t
>  \pentatonic
>  }
> }
>
> \score {
>  <<
>    \context Staff = guitar \guitar
>    \context TabStaff = guitar \guitartab
>  >>
> \layout { }
> }
> \score {
>  \unfoldRepeats \pentatonic
>  \midi { \tempo 4 = 120 }
> }
> ==================
> ----- Original Message ----- From: "Gilles"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, November 17, 2005 1:28 AM
> Subject: Re: Repeat midi using "repeat volta"
>
>
>
>> How is it posible to create a midi file repeating a bar 20 times, but
>> still
>> using the command
>>
>>    \repeat volta 20 {
>>    }
>> ?
>>
>> If i write unfold, it generates 20 bars in the layout, and thats not
>> what i
>> need.
>> Until now I have created 2 files, a layout file, and a midi....but isn´t
>> it possible to do it in one file?
>>
>
> Yes, it is:
>
> %---
> \version "2.6.0"
>
> themusic = \new Staff
> \relative c'' {
>  \repeat volta 20 {
>    a b c d |
>  }
> }
>
> \score {
>  \themusic
>  \layout {}
> }
>
> \score {
>  \unfoldRepeats \themusic
>  \midi { \tempo 4 = 60 }
> }
> %---
>
>
> Best,
> Gilles
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-use
> r


--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user