Discussion:
musescore or musicxml to midi?
(too old to reply)
Mike Scott
2016-07-30 15:56:10 UTC
Permalink
Hi all. I've drawn a blank on this one:

Is there any way of getting from musescore a midi with a user-defined
parts mix, but from the command line? I've some choral music that I want
to make rehearsal material from, and would like to make mp3s ultimately
with the gain on each part cranked up in turn. It's far too tedious to
run everything multiple times through musescore's gui!

If there's a command-line converter from musicxml to midi, that would be
fine; I can easily tweak the levels in the musicxml. But I've drawn a
blank hunting on the net.

Oh, needs to be for linux.

TIA.
--
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
"The only way is Brexit" -- anon.
Pete
2016-07-30 21:29:44 UTC
Permalink
Post by Mike Scott
Is there any way of getting from musescore a midi with a user-defined
parts mix, but from the command line? I've some choral music that I want
to make rehearsal material from, and would like to make mp3s ultimately
with the gain on each part cranked up in turn. It's far too tedious to
run everything multiple times through musescore's gui!
If there's a command-line converter from musicxml to midi, that would be
fine; I can easily tweak the levels in the musicxml. But I've drawn a
blank hunting on the net.
Oh, needs to be for linux.
I've never used either musescore or MusicXML, so I can't be of any direct
help. From a quick browse, though it looks as if both are almost totally
concerned with the sheet music representation, so things like MIDI volume
aren't considered.

I'm not quite clear whether you want a number of separate final output
files, with different parts faded up, or one file with the parts brought
up in turn. Either way, I'd think a sequencer could do what you want.

Otherwise you might want to look at Peter Billam's stuff:
http://www.pjb.com.au/midi/

I even see a "musicxml2mid" app there -- needs perl and a couple of
modules, but that should be no problem. Peter keeps an eye on this
group, so he'll probably be along in a while to give all the details! (:-))

-- Pete --
Peter Billam
2016-08-01 04:52:06 UTC
Permalink
Post by Pete
Post by Mike Scott
If there's a command-line converter from musicxml to midi,
that would be fine; I can easily tweak the levels in the musicxml.
But I've drawn a blank hunting on the net.
http://www.pjb.com.au/midi/
I even see a "musicxml2mid" app there -- needs perl and a couple of
modules, but that should be no problem. Peter keeps an eye on this
group so he'll probably be along in a while to give all the details! (:-))
Yes, I'm still lurking :-)
http://www.pjb.com.au/midi/musicxml2mid.html
Myself I probably haven't used it since 2009, but it should still
work unless the DTD has changed in non-back-compatible ways.
It all depends on MusicXML's back-compatibility-policy...

musicxml2mid was road-tested with
http://www.musicxml.org/dtds/partwise.dtd
Version 1.1 but the current version is Version 3.0 ...

So let me know if there's a problem, I'll see what I can do.
And let me know also if there's no problem :-)

Regards, Peter
--
Peter Billam www.pjb.com.au www.pjb.com.au/comp/contact.html
Mike Scott
2016-08-01 16:25:24 UTC
Permalink
Post by Peter Billam
Post by Pete
Post by Mike Scott
If there's a command-line converter from musicxml to midi,
that would be fine; I can easily tweak the levels in the musicxml.
But I've drawn a blank hunting on the net.
http://www.pjb.com.au/midi/
I even see a "musicxml2mid" app there -- needs perl and a couple of
modules, but that should be no problem. Peter keeps an eye on this
group so he'll probably be along in a while to give all the details! (:-))
Yes, I'm still lurking :-)
http://www.pjb.com.au/midi/musicxml2mid.html
Myself I probably haven't used it since 2009, but it should still
work unless the DTD has changed in non-back-compatible ways.
It all depends on MusicXML's back-compatibility-policy...
musicxml2mid was road-tested with
http://www.musicxml.org/dtds/partwise.dtd
Version 1.1 but the current version is Version 3.0 ...
So let me know if there's a problem, I'll see what I can do.
And let me know also if there's no problem :-)
Regards, Peter
Thanks (to both of you) for a prompt response. Google would seem to have
let me down badly - no mention of this piece of code at all :-(

I've just tried it on a quick example. Good news and bad..... yes, it
does run and makes a midi file that corresponds to the original
musescore input. The bad news is it doesn't follow repeats :-{

Actually, I see the script has no mention of repeats, so I suspect I'm
out of luck :-{


To clarify what I'm trying to do: I'm using Musescore to enter music
that ends up in a booklet given to our choir (mainly 3-part, sometimes
1, 2 or 4). For each piece of music, I want to generate multiple mp3s
for pitch and rhythm practice; these will be one mp3 having all parts at
the "natural" volume, plus separate mp3s with each part emphasized in
turn - the individual files allow members to hear and follow their own
part, yet also be aware of the harmony in the background, while the
'full on' mp3 is akin to singing with everyone else and the accompaniment.

Obviously, with multiple parts per song and perhaps 10 songs for our
short concerts - and MDs that change things :-) - scripting is the order
of the day! (I have for a long time had scripts that turn abc files into
multiple mp3s just like this.)

Musescore has its own (IMO very severe) issues with multiple parts in
short score, which can more or less be overcome with a bit of perl
munging of the musicxml. It has its own command-line export-to-mp3
facility: useless here because it won't export individual parts and
there's no control over the internal mixer settings except by using the
GUI. Hence my exploration of mscz => xml => midi => mp3.
--
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
"The only way is Brexit" -- anon.
Pete
2016-08-02 01:23:53 UTC
Permalink
Post by Mike Scott
To clarify what I'm trying to do: I'm using Musescore to enter music
that ends up in a booklet given to our choir (mainly 3-part, sometimes
1, 2 or 4). For each piece of music, I want to generate multiple mp3s
for pitch and rhythm practice; these will be one mp3 having all parts at
the "natural" volume, plus separate mp3s with each part emphasized in
turn - the individual files allow members to hear and follow their own
part, yet also be aware of the harmony in the background, while the
'full on' mp3 is akin to singing with everyone else and the accompaniment.
I'm still not 100% clear... I think it's your phrase "in turn" that's
confusing me. It sounds a bit as if each mp3 would have parts raised
and lowered at different times, but I'd assume that what you want is for
a given part to be emphasized throughout the whole of a given file.

If that's the case it might be better to work from the "master midi",
generating separate derived midis that then become the mp3s. You'd
need a (command line) app that is able to set the volume of individual
tracks/channels. There ought to be such a program (:-/) but I don't
know of one specifically.

I have a Ruby library that makes it fairly easy to create little
utilities like that, which might be one possibility.

-- Pete --
Mike Scott
2016-08-02 09:04:54 UTC
Permalink
Post by Pete
Post by Mike Scott
To clarify what I'm trying to do: I'm using Musescore to enter music
that ends up in a booklet given to our choir (mainly 3-part, sometimes
1, 2 or 4). For each piece of music, I want to generate multiple mp3s
for pitch and rhythm practice; these will be one mp3 having all parts at
the "natural" volume, plus separate mp3s with each part emphasized in
turn - the individual files allow members to hear and follow their own
part, yet also be aware of the harmony in the background, while the
'full on' mp3 is akin to singing with everyone else and the accompaniment.
I'm still not 100% clear... I think it's your phrase "in turn" that's
confusing me. It sounds a bit as if each mp3 would have parts raised
and lowered at different times, but I'd assume that what you want is for
a given part to be emphasized throughout the whole of a given file.
Ok, sorry. I'll try harder.

Take one of the N pieces of music. This has P vocal parts (1...P) plus
possible accompaniment. Generate P+1 mp3s. mp3 #0 has everything at its
nominal level. mp3 #1 has part 1 at increased level, all others (and
accomp) reduced. mp3 #2 has part 2 louder, all others reduced. Etc.

Those singing, say, part 2 can take mp3 #2 to practise while hearing
their own part clearly in context, and mp3 #0 to practice with a much
smaller hint.
Post by Pete
If that's the case it might be better to work from the "master midi",
generating separate derived midis that then become the mp3s. You'd
need a (command line) app that is able to set the volume of individual
tracks/channels. There ought to be such a program (:-/) but I don't
know of one specifically.
There is. I wrote one :-) A quite unpresentable perl script (no doubt
midisox is much better, but I'd not heard of it when I started all this
a few years ago). Mine currently takes a master abc file, and creates
the above set of mp3s (via midi's, although most singers haven't a clue
what they are) for practice. (Although even here, abcmidi loses any
correlation between abc part names and midi tracks, so there's a horrid
kludge to make it all work fully automatically.)

I've recently been trying out musescore as a replacement for abc and my
own wysiwyg abc editor, but have been sadly disappointed by musescore's
practical limitations, which I'm still trying to find a reasonable
workaround for. If they'd only provide command-line export of mp3's (or
midis or something!!) part by part, or implement the mixer for command
line export, there'd not be an issue. But anyway, there's a basic design
flaw, meaning that multiple "parts" on one staff in closed score can't
readily be dealt with separately from each other. Unlike abc.
Post by Pete
I have a Ruby library that makes it fairly easy to create little
utilities like that, which might be one possibility.
-- Pete --
I've been having a look at the xml to midi script. Handling either midi
or xml isn't exactly my forte, but I'm suspecting that one catches a
"repeat" element, then for direction=forward, clear a holding buffer;
for direction=backward, output midi from the buffer, then clear it. Midi
output occurs as now, but in addition is saved into that buffer. But no
doubt I'm being too simplistic -- and getting the printed music and the
rehearsal audio ready for the new season is way top of the list!! (So
I'll probably have to do it all the hard way this time.)

Thanks to both of you Pete's for your help!
--
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
"The only way is Brexit" -- anon.
Peter Billam
2016-08-02 05:59:17 UTC
Permalink
Post by Mike Scott
Post by Peter Billam
http://www.pjb.com.au/midi/musicxml2mid.html
musicxml2mid was road-tested with
http://www.musicxml.org/dtds/partwise.dtd
Version 1.1 but the current version is Version 3.0 ...
So let me know if there's a problem, I'll see what I can do.
And let me know also if there's no problem :-)
Thanks (to both of you) for a prompt response. Google would seem to
have let me down badly - no mention of this piece of code at all :-(
Naughty google.
Post by Mike Scott
I've just tried it on a quick example. Good news and bad..... yes,
it does run and makes a midi file that corresponds to the original
Good news :-)
Post by Mike Scott
musescore input. The bad news is it doesn't follow repeats :-{
Actually, I see the script has no mention of repeats, so I
suspect I'm out of luck :-{
Temporarily at least, yes. I'll try to get round to adding repeats...
muscript doesn't generate repeats, so I never implemented them.

(*)
Post by Mike Scott
I'm using Musescore to enter music that ends up in a booklet given
to our choir (mainly 3-part, sometimes 1, 2 or 4). For each piece of
music, I want to generate multiple mp3s for pitch and rhythm practice;
these will be one mp3 having all parts at the "natural" volume, plus
separate mp3s with each part emphasized in turn - the individual files
allow members to hear and follow their own part, yet also be aware
of the harmony in the background, while the 'full on' mp3 is akin
to singing with everyone else and the accompaniment.
I would do that at the midi level, using
http://www.pjb.com.au/midi/midisox.html
with the vol efect:
http://www.pjb.com.au/midi/midisox.html#vol
like
midisox master.mid bass.mid vol -25 3:12
which increases the velocities of channel 3 (0..15) by 12 and
decreases the others by 25. Of course that needs you to have
each vocal part on its own channel...

Regards, Peter

(*) At the moment I've got curious about Restricted Boltzmann Machines:
https://en.wikipedia.org/wiki/Restricted_Boltzmann_machine
http://www.cs.toronto.edu/~hinton/absps/guideTR.pdf
http://blog.echen.me/2011/07/18/introduction-to-restricted-boltzmann-machines/
http://deeplearning4j.org/restrictedboltzmannmachine.html
http://deeplearning4j.org/understandingRBMs.html
http://learning.cs.toronto.edu
and this could end up consuming quite some time ...
--
Peter Billam www.pjb.com.au www.pjb.com.au/comp/contact.html
Pete
2016-08-02 06:29:25 UTC
Permalink
Post by Peter Billam
I would do that at the midi level, using
http://www.pjb.com.au/midi/midisox.html
http://www.pjb.com.au/midi/midisox.html#vol
like
midisox master.mid bass.mid vol -25 3:12
which increases the velocities of channel 3 (0..15) by 12 and
decreases the others by 25. Of course that needs you to have
each vocal part on its own channel...
Ahh. That sounds like the way. I wasn't clear from the midisox
man page if/how it was possible to control indidual channel volumes,
so I didn't suggest it, but if it works...

-- Pete --
Loading...