lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The problem of Lilypond changing instrument and the issue of .ly con


From: Jacques Menu
Subject: Re: The problem of Lilypond changing instrument and the issue of .ly converting to MIDI with a custom setting
Date: Tue, 16 Aug 2022 07:35:32 +0200

Hello Angie,

Le 4 août 2022 à 04:48, 柊希里子 <starlitnight0612@gmail.com> a écrit :

My workflow is needed to be an automation script, cause I want to create a tool to generate the annotation of each note automatically. The process is like the below:

  1. Turn the .xml file into .ly,
    1. Ideally, I want to eliminate all the decorations, like accent, staccato, any kind of ornament, and tempo-related _expression_.
    2. Such as --nd, do not convert directions (^, _ or -) for articulations, dynamics, etc.
Command example: musicxml2ly -v --nd --midi --output="1_Bach_Prelude1.ly" ./1_Bach_Prelude1.xml
  1. In the .ly file, convert the instrument into Violin or Cello, no matter what kind of instrument the score was originally made for, because the String instrument will get a more stable note duration of MIDI file than the Woodwind or Piano.

  1. In the .ly file, eliminate all the tempo expressions, and set the tempo to BPM=60.
For the same reason as 2nd step, this step aims to get a more stable note duration.

The steps 2 and 3 I wrote a python code to replace the tempo and want to change the instrument clef, see the attachment “replace_tempo.py”.
Command example: `python replace_tempo.py --path ./1_Bach_Prelude1.ly`, then output the file named just add the `_replace` afterward, like: `1_Bach_Prelude1_replace.ly`

Automatising such steps thru options is what xml2ly, a part of the MusicFormats library, is about, maybe it can help you.


HTH!

JM


reply via email to

[Prev in Thread] Current Thread [Next in Thread]