[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does anybody do MIDI splitting?
From: |
David Kastrup |
Subject: |
Re: Does anybody do MIDI splitting? |
Date: |
Mon, 18 Oct 2021 18:41:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Thomas Morley <thomasmorley65@gmail.com> writes:
> Am Mo., 18. Okt. 2021 um 16:14 Uhr schrieb David Kastrup <dak@gnu.org>:
>>
>>
>> Hi,
>>
>> currently entering drum scores for the ensemble I am playing in (getting
>> a note-savvy living drummer for regular practice is comparatively
>> challenging) and I frequently have the situation that there are large
>> pauses in drum play. At that point in time, I need to cut the MIDI
>> file, take everything up to the last note before the pause into one file
>> and start the next file on beat 1 (sometimes 3) leading to the next note
>> (interestingly, if the next note is on beat 2 or 4 or similar, you still
>> need to start on 1 or 3 since otherwise the "drummer" fails to convey
>> right away the tempo they as opposed to everyone else is aiming for).
>>
>> It's cumbersome writing separate variables and scores manually; it would
>> be nicer to just drop the cutting points in the middle of the score
>> (like in the separate time track) and then some automated thing would
>> slice the score into separate scores for MIDI.
>>
>> Has anybody done anything like that already?
>>
>> --
>> David Kastrup
>>
>
> Years ago I made
> https://archiv.lilypondforum.de/index.php/topic,2012.msg12471.html#msg12471
> Not exactly what you want, maybe a starting point...
Essentially, something like
#(set-object-property! 'segmentKey 'translation-type? key?)
segmentStart =
#(define-music-function (k) (key?)
#{ \tag midi \context Score \applyContext
#(lambda (c)
(set! (ly:context-property c 'skipTypesetting)
(not (eqv? (ly:context-property c 'segmentKey) k))))
#})
segmentStop = \tag midi \set skipTypeSetting = ##t
timeI =
{
\segmentStart 0
\time 4/4
\tempo "Maesto marziale" 4 = 104
\skip 1*30
\segmentStart 1
\mark "A"
\time 3/4
\tempo "Allegretto" 4 = 152
\skip 2.*2 \skip 4
}
[...]
$@(map
(lambda (n)
#{
\score {
\header
{
title = "Rossini"
}
\keepWithTag midi
\new Score \with { segmentKey = #n }
\articulate << \new DrumStaff \with { midiInstrument = "orchestra kit" }
\drumpartI
\new Staff \with { midiInstrument = "timpani" } \timpanipartI
\context Staff \timeI
>>
\midi {
\midifixes
}
}
#}) (iota 2))
appears to do the trick. Obviously, this is not a minimal example, with
lots of content missing. And squeezing in the "segmentKey" via a score
property seems rather awkward.
So: <https://gitlab.com/lilypond/lilypond/-/merge_requests/967>
Allows doing it through the \midi block.
--
David Kastrup