Re: how to get expression in midi

2017-01-04 Thread H. S. Teoh
On Wed, Jan 04, 2017 at 09:56:34PM +0100, Dario Marrini wrote:
[...]
>may you and anybody suggest me any MIDI editor avaluable for Linux?
>I don't use Windows anymore, since '99... 
[...]

Many years ago I used Rosegarden. I don't use it anymore these days,
since I work mostly in notation now, so Lilypond is enough for me. But
you may find it useful.


>I thought using lilypond might be better to manipulate some stuff
>like crescendo and diminuendo; simply putting two commands among
>notes; I have no idea how a midi editor could do that, but in case
>of a long crescendo (several bars) I think it's not a good idea
>using lilypond command, instead of changing singular notes'
>velocity; correct me if I am wrong
[...]

That depends on how far you wish to go with lilypond, and when it
becomes easier to just edit the midi afterwards instead of spending much
more time writing Scheme functions to do what you want in lilypond.
Personally, I actually prefer the latter, but I wouldn't recommend that
unless you're ready to spend more time writing code than writing music
(initially, anyway).  :-P

One of these days I plan to dig into the innards of midi generation in
lilypond and hopefully find ways to improve it, but time isn't on my
side. :-/


T

-- 
Doubt is a self-fulfilling prophecy.

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


Re: how to get expression in midi

2017-01-04 Thread Henning Hraban Ramm
Am 2017-01-04 um 21:56 schrieb Dario Marrini :

> I thought using lilypond might be better to manipulate some stuff like 
> crescendo and diminuendo; simply putting two commands among notes; I have no 
> idea how a midi editor could do that, but in case of a long crescendo 
> (several bars) I think it's not a good idea using lilypond command, instead 
> of changing singular notes' velocity; correct me if I am wrong

Just to be sure - you are using the articulate script, don’t you? That does 
already a part of the work, but it can’t handle crescendi AFAIK.

see http://lilypond.org/doc/v2.18/Documentation/notation/the-articulate-script


Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net




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


Re: how to get expression in midi

2017-01-04 Thread Dario Marrini
many thanks Teoh,
I'll take time to study all you sent me, I see it's hard to understand in a
first look...

may you and anybody suggest me any MIDI editor avaluable for Linux? I don't
use Windows anymore, since '99...

I thought using lilypond might be better to manipulate some stuff like
crescendo and diminuendo; simply putting two commands among notes; I have
no idea how a midi editor could do that, but in case of a long crescendo
(several bars) I think it's not a good idea using lilypond command, instead
of changing singular notes' velocity; correct me if I am wrong

bye and thanks again

dario

2017-01-04 21:01 GMT+01:00 H. S. Teoh :

> On Wed, Jan 04, 2017 at 07:59:17PM +0100, Dario Marrini wrote:
> [...]
> >  * violin part has many 1/8 notes, many are repeating itselves,
> >listening the MIDI output it seems it's not very well, notes'
> >sounds are too much closing, and repeating notes sound like a
> >unique sound almost.  how may I fix this? I think it'd better
> >writing each 1/8 note as 'staccato', but may the Midi output
> >will be according on that?
>
> You need a better midi soundfont or better midi synth.  This isn't
> really something specific to Lilypond; it may be best to use a MIDI
> editor to edit the notes yourself after generating it from lilypond.
> Lilypond's midi capabilities are rather limited; what you're describing
> is something that, while it is *possible* to fix using Lilypond, will
> probably require much more work than it seems you're willing to spend on
> it.
>
> Resources you may find pertinent to your particular issue (note that
> these are not specific to lilypond):
>
> https://www.youtube.com/watch?v=VaSqSieQ4gQ
> https://www.kvraudio.com/forum/viewtopic.php?t=365719
> http://forum.cakewalk.com/TIP-Killing-the-
> quotmachinegunquot-effect-programming-MIDI-m1520197.aspx
>
>
> >besides, it's very hard now to rewrite all the code, so, there
> >is some tool to do that, a sort of 'mass modifier' about the
> >text code? I dont' want to fight with my poor Perl
> >knowledge
>
> I'm not sure what Perl has to do with this, unless you're talking about
> mass textual substitution.  You could possibly write a Scheme function
> to turn notes into staccato, but I'm not sure that's necessarily a good
> idea (it makes your music harder to edit later).
>
>
> >  * is it possible to change the velocity (volume?) of a single
> >long note?  example, brass ensemble start with a 'sf', then
> >play crescendo the same note while 'crescendo' from a 'p' to a
> >'f' again; I don't know if it is possible in a MIDI
> >environment, and how to perform this using lilypond notation
>
> It is definitely possible in MIDI.  How to do it in lilypond is another
> story. :-P  Lilypond itself doesn't have a built-in way of performing
> cresc / decresc on a single note; but it *is* possible to use `\set
> Staff.midiExpression` to alter the volume of a note while it is
> sounding.
>
> Using this idea, I wrote a Scheme function that generates a series of
> gradual changes to Staff.midiExpression to simulate a cresc / decresc.
> In fact, it can do "ramps" of almost any numerical context setting,
> though I most often use it for midiExpression.  Put the below snippet
> into a file, say prop-ramp.ly, then write \include "prop-ramp.ly" at the
> top of your input file, and you can use the \propRamp command to
> generate these events.
>
> (Scheme experts will probably laugh at the klunky way I wrote this,
> since I'm a Scheme n00b, but so far I've used this in several of my
> pieces and it works fairly well.  Also, it currently hardcodes settings
> to the Staff context; while this works for midiExpression, it may not
> work so well for other properties -- you may have to change the
> `'context-type 'Staff'` line to something else in those cases.)
>
>
> snip
> 
> %
> % Scheme function for generating linear ramping of numerical Staff property
> % values to allow for true crescendos/diminuendos.
> %
> % Usage:
> %   \propRamp duration>
> %
> % Example:
> %   \new Staff {
> %   << c'1  % a long note
> %
> %  % Ramp midi expression property for the above note
> %  % from 1.0 to 0.0 over a duration of a dotted 1/2 note.
> %  \propRamp #'midiExpression 1.0 0.0 2.
> %   >>
> %   }
> %
> \version "2.19.23"
>
> #(define genPropertyRamp
> (lambda (propertySym start end i n duration)
> (if (>= i n)
> '()
>
> ; start + (end - start)*i/n
> (let ((curValue (+ start (/ (* i (- end start)) n
>
> ;(display "start = ")(display start)
> ;(display " end = ")(display end)
> ;(display " i = ")(display i)
> 

Re: how to get expression in midi

2017-01-04 Thread H. S. Teoh
On Wed, Jan 04, 2017 at 07:59:17PM +0100, Dario Marrini wrote:
[...]
>  * violin part has many 1/8 notes, many are repeating itselves,
>listening the MIDI output it seems it's not very well, notes'
>sounds are too much closing, and repeating notes sound like a
>unique sound almost.  how may I fix this? I think it'd better
>writing each 1/8 note as 'staccato', but may the Midi output
>will be according on that?

You need a better midi soundfont or better midi synth.  This isn't
really something specific to Lilypond; it may be best to use a MIDI
editor to edit the notes yourself after generating it from lilypond.
Lilypond's midi capabilities are rather limited; what you're describing
is something that, while it is *possible* to fix using Lilypond, will
probably require much more work than it seems you're willing to spend on
it.

Resources you may find pertinent to your particular issue (note that
these are not specific to lilypond):

https://www.youtube.com/watch?v=VaSqSieQ4gQ
https://www.kvraudio.com/forum/viewtopic.php?t=365719

http://forum.cakewalk.com/TIP-Killing-the-quotmachinegunquot-effect-programming-MIDI-m1520197.aspx


>besides, it's very hard now to rewrite all the code, so, there
>is some tool to do that, a sort of 'mass modifier' about the
>text code? I dont' want to fight with my poor Perl
>knowledge

I'm not sure what Perl has to do with this, unless you're talking about
mass textual substitution.  You could possibly write a Scheme function
to turn notes into staccato, but I'm not sure that's necessarily a good
idea (it makes your music harder to edit later).


>  * is it possible to change the velocity (volume?) of a single
>long note?  example, brass ensemble start with a 'sf', then
>play crescendo the same note while 'crescendo' from a 'p' to a
>'f' again; I don't know if it is possible in a MIDI
>environment, and how to perform this using lilypond notation

It is definitely possible in MIDI.  How to do it in lilypond is another
story. :-P  Lilypond itself doesn't have a built-in way of performing
cresc / decresc on a single note; but it *is* possible to use `\set
Staff.midiExpression` to alter the volume of a note while it is
sounding.

Using this idea, I wrote a Scheme function that generates a series of
gradual changes to Staff.midiExpression to simulate a cresc / decresc.
In fact, it can do "ramps" of almost any numerical context setting,
though I most often use it for midiExpression.  Put the below snippet
into a file, say prop-ramp.ly, then write \include "prop-ramp.ly" at the
top of your input file, and you can use the \propRamp command to
generate these events.

(Scheme experts will probably laugh at the klunky way I wrote this,
since I'm a Scheme n00b, but so far I've used this in several of my
pieces and it works fairly well.  Also, it currently hardcodes settings
to the Staff context; while this works for midiExpression, it may not
work so well for other properties -- you may have to change the
`'context-type 'Staff'` line to something else in those cases.)


snip
%
% Scheme function for generating linear ramping of numerical Staff property
% values to allow for true crescendos/diminuendos.
%
% Usage:
%   \propRamp
%
% Example:
%   \new Staff {
%   << c'1  % a long note
%
%  % Ramp midi expression property for the above note
%  % from 1.0 to 0.0 over a duration of a dotted 1/2 note.
%  \propRamp #'midiExpression 1.0 0.0 2.
%   >>
%   }
%
\version "2.19.23"

#(define genPropertyRamp
(lambda (propertySym start end i n duration)
(if (>= i n)
'()

; start + (end - start)*i/n
(let ((curValue (+ start (/ (* i (- end start)) n

;(display "start = ")(display start)
;(display " end = ")(display end)
;(display " i = ")(display i)
;(display " curValue = ")(display curValue)
;(display "\n")

(cons
; \set Staff.midiExpression = #curValue
(make-music 'ContextSpeccedMusic
'context-type 'Staff
'element (make-music
'PropertySet
'symbol propertySym
'value curValue)
)
(cons
(make-music 'SkipEvent
'duration duration
)
(genPropertyRamp propertySym start end (+ i 1) n 
duration)
)
)
)
)
)
)

propRamp = #(define-music-function
(propertySym startValue endValue totalDur)
(symbol? number? 

Re: how to get expression in midi

2017-01-04 Thread Dario Marrini
thanks to all, I tried the Teoh's solution and it worked in a few
seconds...

now, other questions...


   - violin part has many 1/8 notes, many are repeating itselves, listening
   the MIDI output it seems it's not very well, notes' sounds are too much
   closing, and repeating notes sound like a unique sound almost. how may I
   fix this? I think it'd better writing each 1/8 note as 'staccato', but may
   the Midi output will be according on that? besides, it's very hard now to
   rewrite all the code, so, there is some tool to do that, a sort of 'mass
   modifier' about the text code? I dont' want to fight with my poor Perl
   knowledge
   - is it possible to change the velocity (volume?) of a single long note?
   example, brass ensemble start with a 'sf', then play crescendo the same
   note while 'crescendo' from a 'p' to a 'f' again; I don't know if it is
   possible in a MIDI environment, and how to perform this using lilypond
   notation

thanks to all

dario

2017-01-04 17:27 GMT+01:00 Thomas Morley :

> 2017-01-04 17:07 GMT+01:00 Dario Marrini :
> > Hi everybody,
> >  I'm trying to get a 'expressive' midi file, classical music ( I'm
> copying
> > the Final from Beethoven's Leonora n.3 Ouverture);  I prefere to manage
> > expression marks separately from notes' body, so I created two voice
> > contextes, one foe the notes and one for expression; each value n the
> notes'
> > body is replicated as a 's' instance in expression's body, but doing so I
> > don't get any expression; if I put expression mark into the notes' body I
> > can hear crescendo and so on.
> > I really would maintain spearately the two fields, notes and
> expressions, so
> > I ask if there is a way to get it.
> >
> > Many thanks to all
> >
> > Dario
> >
> > Here the code (using Frescobaldi, Linux user on Mint 18.1) :
> >
> > \version "2.18.2"
> >
> > global = {
> >   \key c \major
> >   \time 2/2
> >
> > }
> >
> > violin_I = \relative c'' {
> >   \global
> >   % Qui segue la musica.
> >   %514
> >   r8\p c g' f e d c b
> >   a' g f e d c b' a
> >   g f e d c' b a g
> >   f e d' c b a g f
> >   e'\cresc d c b a g f' e
> >   d c b a g f' e d
> >   c b a g f' e d c
> >   %521
> >   b a g f' e d c b
> >   a\mf g a b c d e f
> >   g, a b c d e f g,
> >   a b c d e f g, a
> >   b c d e f g, a b
> >   c c d e f g, a b
> >   c c d e f g, a b
> >   c c d e f g, a b
> >   c c d e f g, a b
> >
> > }
> >
> > expr_violin_I = \relative c'' {
> >   \global
> >   % Qui segue la musica.
> >   %514
> >   s8\p s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s\cresc s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   %521
> >   s s s s s s s s
> >   s\mf s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >   s s s s s s s s
> >  }
> >
> > \score {
> >   \new Staff \with {
> > instrumentName = "Violino"
> > midiInstrument = "violin"
> >   }
> > <<
> >   \new Voice = "violino_I" { \violin_I }
> >   \new Voice = "espress" { \expr_violin_I }
> > >>
> >   \layout { }
> >   \midi {
> > \tempo 2=144
> >   }
> > }
> >
>
>
>
> How about:
>
> \score {
>   \new Staff<<
>   \new Voice
> { c''4 c'' }
>   \new Voice { s4\ s\ }
>   >>
>   \midi {
> \context {
>   \Staff
>   \consists Dynamic_performer
> }
> \context {
>   \Voice
>   \remove Dynamic_performer
> }
>   }
> }
>
> Chers,
>   Harm
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: how to get expression in midi

2017-01-04 Thread Thomas Morley
2017-01-04 17:07 GMT+01:00 Dario Marrini :
> Hi everybody,
>  I'm trying to get a 'expressive' midi file, classical music ( I'm copying
> the Final from Beethoven's Leonora n.3 Ouverture);  I prefere to manage
> expression marks separately from notes' body, so I created two voice
> contextes, one foe the notes and one for expression; each value n the notes'
> body is replicated as a 's' instance in expression's body, but doing so I
> don't get any expression; if I put expression mark into the notes' body I
> can hear crescendo and so on.
> I really would maintain spearately the two fields, notes and expressions, so
> I ask if there is a way to get it.
>
> Many thanks to all
>
> Dario
>
> Here the code (using Frescobaldi, Linux user on Mint 18.1) :
>
> \version "2.18.2"
>
> global = {
>   \key c \major
>   \time 2/2
>
> }
>
> violin_I = \relative c'' {
>   \global
>   % Qui segue la musica.
>   %514
>   r8\p c g' f e d c b
>   a' g f e d c b' a
>   g f e d c' b a g
>   f e d' c b a g f
>   e'\cresc d c b a g f' e
>   d c b a g f' e d
>   c b a g f' e d c
>   %521
>   b a g f' e d c b
>   a\mf g a b c d e f
>   g, a b c d e f g,
>   a b c d e f g, a
>   b c d e f g, a b
>   c c d e f g, a b
>   c c d e f g, a b
>   c c d e f g, a b
>   c c d e f g, a b
>
> }
>
> expr_violin_I = \relative c'' {
>   \global
>   % Qui segue la musica.
>   %514
>   s8\p s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s\cresc s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   %521
>   s s s s s s s s
>   s\mf s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>   s s s s s s s s
>  }
>
> \score {
>   \new Staff \with {
> instrumentName = "Violino"
> midiInstrument = "violin"
>   }
> <<
>   \new Voice = "violino_I" { \violin_I }
>   \new Voice = "espress" { \expr_violin_I }
> >>
>   \layout { }
>   \midi {
> \tempo 2=144
>   }
> }
>



How about:

\score {
  \new Staff<<
  \new Voice
{ c''4 c'' }
  \new Voice { s4\ s\ }
  >>
  \midi {
\context {
  \Staff
  \consists Dynamic_performer
}
\context {
  \Voice
  \remove Dynamic_performer
}
  }
}

Chers,
  Harm

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


Re: how to get expression in midi

2017-01-04 Thread H. S. Teoh
On Wed, Jan 04, 2017 at 05:07:30PM +0100, Dario Marrini wrote:
[...]
>    <<
>      \new Voice = "violino_I" { \violin_I }
>      \new Voice = "espress" { \expr_violin_I }
>    >>
[...]

In the latest 2.19.x, the MIDI dynamics performer has been moved from
Staff into Voice. So probably you should try this instead:

\new Voice = "violino_I" <<
\violin_I
\expr_violin_I
>>

That should do the trick, I believe.


--T

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


how to get expression in midi

2017-01-04 Thread Dario Marrini
Hi everybody,
 I'm trying to get a 'expressive' midi file, classical music ( I'm copying
the Final from Beethoven's Leonora n.3 Ouverture);  I prefere to manage
expression marks separately from notes' body, so I created two voice
contextes, one foe the notes and one for expression; each value n the
notes' body is replicated as a 's' instance in expression's body, but doing
so I don't get any expression; if I put expression mark into the notes'
body I can hear crescendo and so on.
I really would maintain spearately the two fields, notes and expressions,
so I ask if there is a way to get it.

Many thanks to all

Dario

Here the code (using Frescobaldi, Linux user on Mint 18.1) :

\version "2.18.2"

global = {
  \key c \major
  \time 2/2

}

violin_I = \relative c'' {
  \global
  % Qui segue la musica.
  %514
  r8\p c g' f e d c b
  a' g f e d c b' a
  g f e d c' b a g
  f e d' c b a g f
  e'\cresc d c b a g f' e
  d c b a g f' e d
  c b a g f' e d c
  %521
  b a g f' e d c b
  a\mf g a b c d e f
  g, a b c d e f g,
  a b c d e f g, a
  b c d e f g, a b
  c c d e f g, a b
  c c d e f g, a b
  c c d e f g, a b
  c c d e f g, a b

}

expr_violin_I = \relative c'' {
  \global
  % Qui segue la musica.
  %514
  s8\p s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s\cresc s s s s s s s
  s s s s s s s s
  s s s s s s s s
  %521
  s s s s s s s s
  s\mf s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s s s s s s s s
  s s s s s s s s
 }

\score {
  \new Staff \with {
instrumentName = "Violino"
midiInstrument = "violin"
  }
<<
  \new Voice = "violino_I" { \violin_I }
  \new Voice = "espress" { \expr_violin_I }
>>
  \layout { }
  \midi {
\tempo 2=144
  }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user