Re: Fw: I wrote a MIDI to Lily front end; also questions about video

2023-12-07 Thread Robin Bannister

Karlin High wrote:


FluidSynth can do it. I use VLC Player which I think contains it.

Prior post explains:





My contribution to that thread is outdated:
  midi returned to VLC with version 3.0.8


Cheers,
Robin



Re: accessing current file name in markup function

2023-12-07 Thread Jean Abou Samra
> Documentation question from trying to understand *location* in David's
> solution:
>  
> I found that function in the IR documentation[1], but I could not find the
> definition of a sip:
> >  
> > Function: ly:input-file-line-char-column sip
> > Return input location in sip as (file-name line char column).
> > 
> >  
>  
> Guessing, is sip a stream input pointer?  Where would I look to find the
> definition/example of sip?


Well, if you have that code snippet, you basically do #(display (*location*))
and look at the result, which is something like

#

indicating that *location* doesn't return a string but a special type of
location/input object.

This is also what the "input" prefix on the function name means — functions
specific to a LilyPond object type are prefixed with ly:that-type (e.g.,
ly:grob-parent, ly:context-property, etc.).

The name "sip" is a bit weird; looking in the commit that added the code 19
years ago, it looks like it was meant as "smob input" (where smob = Scheme
object = LilyPond C++ object made available to Scheme).




signature.asc
Description: This is a digitally signed message part


Re: Fw: I wrote a MIDI to Lily front end; also questions about video

2023-12-07 Thread Karlin High

On 12/7/2023 12:48 PM, Stefano Antonelli wrote:
Is downloading soundfonts 'standard practice' for working with midi on 
Windows? Would anyone wanting to use ly2video on windows already know 
this if they are familiar with midi?


I doubt it is common for Windows users to interact with soundfonts.

I know it wasn't for me, anyway. My computer experience began and 
continues with Windows. I was using Windows for a good number of years 
before encountering the term: A sound FONT, huh. What's next, a text EQ?


People who don't know how MIDI differs from audio recordings will 
probably just use whatever opens it, Windows Media Player even.


And those who are really into MIDI probably will use DAW software with 
virtual-instrument plugins.

--
Karlin High
Missouri, USA




Re: Fw: I wrote a MIDI to Lily front end; also questions about video

2023-12-07 Thread Stefano Antonelli
On Thu, 2023-12-07 at 12:37 -0600, Karlin High wrote:
> On 12/7/2023 12:30 PM, Stefano Antonelli wrote:
> > It's the same deal for fluidsynth which doesn't come with sound
> > fonts.
> > What's the windows way to convert midi to wav?
> 
> FluidSynth can do it. I use VLC Player which I think contains it.
> 
> Prior post explains:
> 
> <
> https://lists.gnu.org/archive/html/lilypond-user/2017-04/msg00764.html
> >

ly2video doesn't work with fluidsynth yet.  Maybe I'll look into that.

> Here is my favorite place to get soundfonts:
> 
> 

Right I have that page already open in my browser.  It wasn't hard to
find from the fluidsynth page, but I don't yet know how to make it work
with timidity.

Is downloading soundfonts 'standard practice' for working with midi on
Windows?  Would anyone wanting to use ly2video on windows already know
this if they are familiar with midi?




Re: accessing current file name in markup function

2023-12-07 Thread Jeff Olson

On 12/6/2023 3:48 PM, David Kastrup wrote:

\version "2.24.2"

locationOf =
#(define-scheme-function () ()
(apply format #f "~a:~a:~a:~a" (ly:input-file-line-char-column 
(*location*


\markup { \locationOf }


Documentation question from trying to understand *location* in David's 
solution:


I found that function in the IR documentation[1], but I could not find 
the definition of a /_sip_/:


   _Function:_*|ly:input-file-line-char-column|*/sip/

   Return input location insipas|(file-name line char column)|.

Guessing, is sip a stream input pointer? _Where would I look to find the 
definition/example of sip?_


Or, David, does *location* mean a string literal containing the name of 
the file like "eso.ly"?


[1] 
https://lilypond.org/doc/v2.24/Documentation/internals/scheme-functions#index-ly_003ainput_002dfile_002dline_002dchar_002dcolumn


TIA,
Jeff


Re: Fw: I wrote a MIDI to Lily front end; also questions about video

2023-12-07 Thread Karlin High

On 12/7/2023 12:30 PM, Stefano Antonelli wrote:
It's the same deal for fluidsynth which doesn't come with sound fonts. 



What's the windows way to convert midi to wav?


FluidSynth can do it. I use VLC Player which I think contains it.

Prior post explains:



Here is my favorite place to get soundfonts:


--
Karlin High
Missouri, USA




Re: Fw: I wrote a MIDI to Lily front end; also questions about video

2023-12-07 Thread Stefano Antonelli
On Thu, 2023-12-07 at 02:43 +, Chris Korda wrote:
> Doesn’t LilyPond already contain python? There’s a python.exe in the
> bin folder, and it appears to run the python scripts that come with
> LilyPond, can I just use that to run ly2video? I’m guessing not
> because that would be too easy.

ly2video was super easy on linux and ideally would be just as easy to
use on windows.  And the easiest way is probably a self contained
python binary of ly2video.

I was able to package ly2video as an exe from linux using wine and
pyinstaller.  However when I tested it in wine, I ran into an issue:
external dependencies.

lilypond is required.  No problem, just download windows binaries and
modify the path so that lilypond works from anywhere.

ffmpeg is required.  No problem, just download windows binaries and
modify the path so that ffmpeg works from anywhere.

It was smooth sailing until timidity.  l2video uses timidity to process
the midi file into wav.  And that works fine on linux.  Odd because it
was originally developed for windows.

I can find timidity for windows, but it's not a nice installable
package complete with soudfonts.  And it's missing timidity.cfg which
is needed to find the soundfont files after they've been installed.  I
can find the soundfonts, but this seems completely awkward.

It's the same deal for fluidsynth which doesn't come with sound fonts.
 There is a Chocolatey package manager (?!) that has a fluidsynth
package, but I have no idea what that is or why anyone would use it.  I
looked into the package and all it does is download and install the
fluidsynth zip file that you can get off the github releases page.  It
does not contain soundfonts.

What's the windows way to convert midi to wav?

-Stef



Re: accessing current file name in markup function

2023-12-07 Thread Werner LEMBERG
>> Thanks!  However, Jean's statement
>>
>> > markups don't store location info, unfortunately.
>>
>> is still true, which means that you can't access the current input
>> location within `define-markup-command`.
>
> Yes, sure, but you could inject this during parsing.  [...]

I'm doing very similar, thanks for confirmation :-)


Werner



Re: accessing current file name in markup function

2023-12-07 Thread Valentin Petzel
Am Donnerstag, 7. Dezember 2023, 06:47:56 CET schrieb Werner LEMBERG:
> >> Maybe a bit less esoteric:
> > Or even less esoteric:
> Thanks!  However, Jean's statement
> 
> > markups don't store location info, unfortunately.
> 
> is still true, which means that you can't access the current input
> location within `define-markup-command`.
> 
> 
> Werner

Yes, sure, but you could inject this during parsing. If you need this within a 
markup command there would not really be a reason why you shouldn’t be able to 
do so:

loc =
#(define-scheme-function (mup) (markup?)
   (markup #:override (cons 'location input-file-name) mup))

#(define-markup-command (test layout props) ()
   #:properties
   ((location "na"))
   (display location)
   (interpret-markup layout props location))

\loc\markup\test

The parser could very well (whenever creating a markup) set a location 
property.

Cheers, Valentin

signature.asc
Description: This is a digitally signed message part.


Harp_pedal_engraver: an overengineered solution to a niche problem

2023-12-07 Thread Saul Tobin
Hello friends,

I’ve found that one of the more cumbersome tasks in Lilypond is engraving
chromatic music for concert harp. When entering markups manually for each
pedal change, it’s difficult to achieve clean and consistent formatting,
and very easy to make errors. I’d like to share my solution to this problem.

The user only needs to enter pedal settings at the beginning of a passage,
which looks like:

<>\setHarpPedals { d c b e f g a }

Harp_pedal_engraver then listens for notes and automatically prints pedal
changes when new accidentals occur. Manually entered pedal changes (using
the same function as above) are only needed if a pedal must be changed
early. Warnings are triggered if contradictory accidentals are entered.
There is support for graphical pedal diagrams with and without circles, and
the format of text pedal charts can be customized.

The engraver creates two new grobs, HarpPedalChart and HarpPedalChange,
which will typically belong to the PianoStaff or GrandStaff. I extended
side-position-interface::move-to-extremal-staff to allow for placement of
grobs below the top staff if direction is set to CENTER. The style options
and default grob positioning are based on Elaine Gould’s book and examples
I’ve seen of harpists marking up their parts.

I’ve included in the file a fairly complete set of tests and examples.

I’d welcome feedback and I’d be happy to submit this as a pull request for
either OLL or Lilypond itself if there is interest.

Some technical comments:

1. I’ve duplicated with minor changes several functions from
chord-name.scm. IMO note-name->string should be changed to accept an
integer instead of ly:pitch, to be consistent with
accidental->text-accidental-markup. I’ve also duplicated note-name->markup,
because the original implementation doesn’t allow for printing naturals,
and also because for some reason it inserts a space between the note name
and the flat sign, which IMO is quite ugly (this is a general issue I see
on both Mac and Windows when entering flat signs in markups, not just with
that function).

2. I haven’t tested localization to other language note names.

3. I would love to provide a cleaner interface for users to customize the
formatting of text pedal markings or add enclosures around graphical pedal
diagrams. For example, it would be nice to let users do something like
\override HarpPedalChart.enclosure = \markup\box\etc instead of having to
create a whole Scheme function accepting the grob as an argument. It would
also be nice to have the user be able to simply write something like
\override HarpPedalChart.format-pedal-text = #my-custom-format instead of
#(const my-custom-format). (Naturally, this relates to which logic and
properties belong to the engraver vs. the grobs – I think my choices were
sensible, but perhaps there is a better design?)

4. Right now, overrides only work with the context name specified. I’d love
to know how to make these work with just the grob name.

5. It would be nice to have the engraver ignore notes created by
\cueDuring, but as far as I can tell, these notes are indistinguishable
from ordinary notes by translation time. To workaround this, it’s necessary
to turn automatic pedal changes off during cues. Not a big deal but
slightly ugly.

6. The grob definitions are based on TextScript but I removed properties
that didn’t seem to do anything in my test examples. I have no idea if they
should be added back in or values adjusted to deal with situations my tests
didn’t cover.


harp-pedal-engraver.ily
Description: Binary data