Melodeon.net Forums

Discussions => Tunes => ABC => Topic started by: Hugh Taylor on September 29, 2021, 05:04:58 PM

Title: Specifying sounds for parts
Post by: Hugh Taylor on September 29, 2021, 05:04:58 PM
I'm writing an arrangement for a melody and horn parts in ABCExplorer, and would like to specify the sounds for the different parts.
I have the following (probably from Peter Dunk) but not sure what the code means.
%%MIDI program 40 % violin
%%MIDI chordprog 0 % piano
Presumably the melody sound (which I have as V:1) is a violin, and the chord playing is a piano, but what do the 40 % and 0 % mean?
How do I specify the sounds for V:2 (trumpet) and V:3 (tenor sax) etc?
Thanks

Title: Re: Specifying sounds for parts
Post by: Gena Crisman on September 29, 2021, 05:54:02 PM
I have this:

V:A
K:D
%%MIDI program 21 % Accordion
%%MIDI gchord off
*music etc*
V:B
K:D
%%MIDI program 41 % Something else probably
*other music etc*


So like, just invoking the %%MIDI instrument change after swapping to the voice seemed to do. The numbers though relate to general midi instrument numbers, a full list of which can be found here: https://en.wikipedia.org/wiki/General_MIDI#Program_change_events although there may be an indexing thing where 41 = 40 or vice versa, as on the computer it counts from 0? You might be bale to find a better list by seraching 'general midi instrument numbers'

Hope that helps, my code is also probably from Pete Dunk lol.
Title: Re: Specifying sounds for parts
Post by: Anahata on September 29, 2021, 07:03:38 PM
%%MIDI program 40 % violin
%%MIDI chordprog 0 % piano
Presumably the melody sound (which I have as V:1) is a violin, and the chord playing is a piano, but what do the 40 % and 0 % mean?

The 40 specifies the instrument (as Gena says, general MIDI instrument number)
The % indicates that the rest of the line is a comment, and "violin" is a comment to remind the human reader what instrument 40 is supposed to be.
Except, as Gena has also spotted, violin should be 41 - not sure what's happening there.
Title: Re: Specifying sounds for parts
Post by: Hugh Taylor on September 29, 2021, 08:02:39 PM
Thanks Gena and Anahata.
How do I specify an instrument for Voice 1 and a different instrument for Voice 2?
Title: Re: Specifying sounds for parts
Post by: Gena Crisman on September 29, 2021, 11:01:21 PM
Make sure that the %%MIDI program commands are in the abc file while you're actually writing notes for the appropriate voice, so, write after you swap to voice 2, put in the instrument change for that voice. In my little snippet example, the voices are A and B (and C and D, actually).

Like the order it shows up in the file is important, it's not something you declare at the top before you start writing. You can change instrument mid piece, too, probably.
Title: Re: Specifying sounds for parts
Post by: Roger Hare on September 30, 2021, 05:46:29 AM
The 40 specifies the instrument (as Gena says, general MIDI instrument number)
The % indicates that the rest of the line is a comment, and "violin" is a comment to remind
the human reader what instrument 40 is supposed to be.
Except, as Gena has also spotted, violin should be 41 - not sure what's happening there.

For some reason, the instrument number 'in the list' (and as specified in the 'Voices' section of
the 'Settings' in EasyABC) has to be reduced by 1 when used in a %%MIDI program directive.

It's mentioned (but not explained) on p. 167 of Guido Gonzato's ABC2 manual which also
has a complete list of MIDI instruments. Peculiar... Oh, aye, trumpet is No. 57, and should
therefore be specified as %%MIDI program 56; tenor sax is 67 and should therefore be
specified as %%MIDI program 66. I think that's correct, though I'm not sure where they
should be positioned in respect of getting them used for different voices - I have tango
accordion, flute and fiddle permanently selected as voices 1, 2 and 3 in the EasyABC setup
options so I never need to worry about it...

Violin is 41 and Piano is 1, so if Peter Dunk's files are using 40 and 0, it looks as if it's
common to more than one ABC 'front-end' (he uses ABCExplorer, I think). Is it something
to do with abc2midi?
Title: Re: Specifying sounds for parts
Post by: Tone Dumb Greg on September 30, 2021, 09:32:48 AM
I've used this list, successfully, in the past

https://fmslogo.sourceforge.io/manual/midi-instrument.html
Title: Re: Specifying sounds for parts
Post by: Hugh Taylor on September 30, 2021, 09:39:10 AM
Thanks to all, I think I have it now.
Cheers
Hugh
SimplePortal 2.3.5 © 2008-2012, SimplePortal