VOGONS


First post, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Or applying it someplace outside of PlayMsg?

Reading about it, it's a volume control. Cheaper synths handle it the same as regular channel volume, others, the gain from it is added without disturbing the channel volume setting. I don't know which way the mt-32 handles it(could find out with a midi file that changes expression and see if channel volume matches) but it does apply it based on the docs.

To handle it in the first case, the simple addition below will apply expression commands:

In PlayMsg:

		case 0xb0: // Control change
switch (note) {
case 0x1: // Modulation
//LOG_MSG("Modulation: %d", velocity);
mchan[chan]->SetModulation(velocity);
break;
case 0xb: // Set expression
case 0x7: // Set volume
mchan[chan]->SetVolume(velocity);
break;
..

ps. I found another desciption desribing an implementation saying it gives individual volume control to instruments sharing the same channel.

Last edited by ih8registrations on 2003-08-22, 00:29. Edited 1 time in total.

Reply 1 of 16, by canadacow

User metadata
Rank Member
Rank
Member

Yeah, I really was confused on how to emulate the expression. All the descriptions I've found in MIDI manuals were very nebulous and did little to help me understand exactly what expression was. On top of that, I haven't seen very many programs that use expression. Interestingly, however, I keep seeing the control change "0x4b" show up all the time, but this is undocumented in any MT-32 material. I've implemented your suggestion and I'm going through my games looking for places where its used.

Reply 2 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Being that the mt-32 was a 'cheap' synth, they likely implemented the cheap method, but if it does the more 'delux' form, the last description I've mentioned makes sense to me.

Last edited by ih8registrations on 2003-08-22, 03:25. Edited 1 time in total.

Reply 3 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

OK, I've seen several references saying it's note(aka instrument) volume vs channel volume.

And there is a mt-32 reference to expression control in the mt-32 manual:

"Expression (control change[11]))

This function controls sound dynamics.

*The sound dynamics can be controlled by the Expression and the volume level settings (as determined by the mt-32 control panel setting or control changes[7] and [11]."

I've yet to see a non flowery/bullshit description of 'sound dynamics' but saying note is concrete. So if the mt-32 doesn't do the cheap method, coming up with volume per note shouldn't be bad.

ps. quest studio's mt-32 midi implementation doc is incomplete. lilchips has a copy with all the sections. It's v1.01. Snover & Vlad have v1.00. Curious that quest didn't grab it/completely transcribe it since it's from lilchips where they grabbed the mt-32 user manual.

http://www.lilchips.com/oldsite/roland/synths/mt32/index.asp

Reply 4 of 16, by DjLc

User metadata
Rank Newbie
Rank
Newbie

Hello,

The expression is a percentage of Volume (ie, as set by Volume Controller). In other words, Expression divides the current volume into 16,384 steps (or 128 if 8-bit instead of 14-bit resolution is used). Volume Controller is used to set the overall volume of the entire musical part (on a given channel), whereas Expression is used for doing crescendos and decrescendos. By having both a master Volume and sub-Volume (ie, Expression), it makes possible to do crescendos and decrescendos without having to do algebraic calculations to maintain the relative balance between instruments. When Expression is at 100% (ie, the maximum of 0x3FFF), then the volume represents the true setting of Volume Controller. Lower values of Expression begin to subtract from the volume. When Expression is 0% (ie, 0x0000), then volume is off. When Expression is 50% (ie, 0x1FFF), then the volume is cut in half.

Here's how Expression is typically used. Let's assume only the coarse adjust is used (ie, #11) and therefore only 128 steps are possible. Set the Expression for every MIDI channel to one initial value, for example 100. This gives you some leeway to increase the expression percentage (ie, up to 127 which is 100%) or decrease it. Now, set the channel (ie, instrument) "mix" using Volume Controllers. Maybe you'll want the drums louder than the piano, so the former has a Volume Controller value of 110 whereas the latter has a value of 90, for example. Now if, at some point, you want to drop the volumes of both instruments to half of their current Main Volumes, then send Expression values of 64 (ie, 64 represents a 50% volume percentage since 64 is half of 128 steps). This would result in the drums now having an effective volume of 55 and the piano having an effective volume of 45. If you wanted to drop the volumes to 25% of their current Main Volumes, then send Expression values of 32. This would result in the drums now having an effective volume of approximately 27 and the piano having an effective volume of approximately 22. And yet, you haven't had to change their Volume settings, and therefore still maintain that relative mix between the two instruments. So think of Volume Controllers as being the individual faders upon a mixing console. You set up the instrumental balance (ie, mix) using these values. Then you use Expression Controllers as "group faders", whereby you can increase or decrease the volumes of one or more tracks without upsetting the relative balance between them.

If a MultiTimbral device, then each Part usually has its own Expression level.

Value Range:

14-bit coarse/fine resolution. 0x0000 to 0x3FFF where 0 is minimum effect.

Note: Most all devices ignore the Fine adjust (#43) for Expression, and just implement Coarse adjust (#11) because 14-bit resolution isn't needed for this.

Reply 5 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Found the link to where that reference came from:
http://www.borg.com/~jglatt/tech/midispec/ctllist.htm

expression 0bh/11 is coarse grain/128 steps.

so calc the percentage and apply the ratio to the current volume setting.

(expression value/127) * channel volume index

If velocity in midichannel class is the last volume index, then the following would work(otherwise need to add a var & start saving):

void MidiChannel::SetExpression(int vol) {

volume = voltable[ (vol/127) * velocity ];

}

case 0xb: // Set expression
mchan[chan]->SetExpression(velocity);
break;

Last edited by ih8registrations on 2003-08-24, 01:29. Edited 1 time in total.

Reply 6 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

The volume formula from the microsoft ddk is for fine scale.

http://www.borg.com/~jglatt/tech/midispec/vol.htm

The mt-32 doesn't have controller 37, it only implemented coarse grain volume control (7).

The coarse formula is '40 log (Volume/127) '.

In inittables, the line where it sets amp & volt table would be:

amptable[lf] = voltable[lf] = (int)(log(pow((float)lf/127.0,4));

// value = 2^(log10((index/127)^4))*127 where index = 0..127

From the explanation on borg, the formula above from the ddk is actually volume = fine scale volume * fixed or default expression setting of 127(?).

All four controllers in the mt-32's 14 bit range are coarse. If it were making use of all 14 bits, the fine grain controls would be there as well. Since they're not, all of them could be simplified to ranges of 128 instead of 16384.

Last edited by ih8registrations on 2003-08-25, 02:33. Edited 1 time in total.

Reply 7 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Two other documented mt-32 commands aren't currently implemented; resets all controllers and active sensing.

here's resets all controllers:

		case 0x79: // resets all controllers
mchan[chan]->SetModulation(0);
mchan[chan]->SetVolume(127);
mchan[chan]->SetPan(64);
mchan[chan]->SetExpression(127);
mchan[chan]->SetHoldPedal(false);
mchan[chan]->StopPedalHold();
// not a controller but also to be reset
mchan[chan]->SetBend(0x2000);
break;

I count 14 documented midi commands with 13 out of 14 implemented or 93%(though you don't have a completion row for midi commands). Active sensing is easy to implement once I find a timer to use.

Last edited by ih8registrations on 2003-08-27, 07:39. Edited 1 time in total.

Reply 8 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

I havn't tested this but here's a preliminary active sense implementation.

void ActiveSense(void) {
if (flag) {
timeout++;
if (timeout>300) {
flag = 0;
int channel, poly;
// midi doc says should only turn off channels started by note on
// currently turns them all off, though this is accurate by current usage.
// if one were to able to use a keyboard as input to the emulator, will
// need an indication whether a note was started by note on or keyboard
for(channel=0;channel<activeChannels)
for(poly=0;poly<MAXPOLY;poly++)
mchan[channel]->StopNote(-1);
}
}
}

// cleared on entry in playmsg

// clear active sensing timeout variable
timeout = 0;

// active sense case in playmsg

case 0xfe: // Active sensing
LOG_MSG("Active sensing: 0x%x", status);
// once started, if more than 300ms pass without a midi message, it shuts off all notes started by note on.
flag = 1;
// interrupt handler isn't started until active sensing initiated
if (!activehandler) { // only assign handler once
TIMER_RegisterMicroHandler(ActiveSense,1000); // check every ms.
acitvehandler = 1;
}
break;

uses three variables: flag, timeout & activehandler which will need to be declared as general variables.

This rounds out alll documented supported midi commands. As for undocumented, if they exist and are used, we'll want to implement those as well.

Last edited by ih8registrations on 2003-08-25, 20:50. Edited 1 time in total.

Reply 9 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Found a sharper easier all in one pdf version of the mt-32 owners manual here:

http://www.planet-zero.org/wiki/index.php/mt-32

The lilchips/quest studio copy is a bunch of tiffs; one per page.

Even better though, a more verbose d-110 manual:

http://www.reasonsound.com/gear/gear_d_110.htm

Still doesn't describe parameters values but does have descriptions in sections where the mt-32 manual for the same thing says squat. For instance, it lists what reset all controllers should set & their settings. volume should be set to 127, not 100.

I'm looking for a d-5 manual since it was a later model(89') la synth and should have a more up to date manual. maybe the d-70(90') but I read a review saying it was a pcm synth in disguise.

Last edited by ih8registrations on 2003-08-26, 10:03. Edited 1 time in total.

Reply 10 of 16, by Snover

User metadata
Rank l33t++
Rank
l33t++

How are you finding these documents? I searched (maybe not as hard, but it was a search nevertheless) and couldn't find anything more than the ones at Quest Studios.

Yes, it’s my fault.

Reply 11 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Though I did find lillchips on my own from searching on google, if you grab the mt-32 owners manual from quest, you'll find lilchips txt file banners in the zip.

I searched with generic title words: roland, manual, owners manual, midi implimentation, the models: mt-32 cm-32l, d-110, d-50, etc, and keywords found in the manuals, or other keywords associated that I might think people would note like 'la synthesis'.

Speaking of which, here's a pdf copy of the d-50 owners manual:

http://www.vintagesynth.org/roland/d50.shtml

It was the first hit using 'roland d-50 manual' as the search string on google. Though this is a reminder for me to use other search engines when google starts running dry.

I don't check every hit; I use the hit entrys as indicators to it being possibly useful. ie, the url, is it a link to some docs subdirectory or something that's obviously to a page to some guy selling manuals, and the brief word context they include in the hit description.

Info on the d models are easier to come buy, followed by the mt-32. like the lapc & cm models themselves, useful hits on them are scarse.

I want to find the manuals to the last produced la synth in hopes that they will have the most info.

Last edited by ih8registrations on 2003-08-27, 02:52. Edited 1 time in total.

Reply 12 of 16, by canadacow

User metadata
Rank Member
Rank
Member

You beat me to it l8r... the D-50 manual has been my major source of more indepth information since I started the project. Unfortunately, its still not detailed enough in some places.

Again, sorry for the very belated replies... my work already has me on a tight leash.

Reply 13 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

basic and advanced d-50 manuals, english & french versions:

http://membres.lycos.fr/jeanlouispy/D50.htm

Though, the first d-50 pdf is a combination of the two + more?; and, the pdf of the english version of the advanced manual is corrupt(damn frenchies:)) that acrobat 5 couldn't fix(it froze actually).

but why not; the more the merrier.

Perhaps someone will have better luck fixing the pdf.

Last edited by ih8registrations on 2003-08-27, 14:15. Edited 1 time in total.

Reply 15 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

You should have given the link to the guys site containing the download, because he also has a links page and...

that's right, you know what's coming, another site with a copy of the d-50 manual!:)

http://w3.to/d50ve

I actually had run into this page more than a few times but never noticed it had the d-50 manual. Who would have guessed that the manual button would have a manual:P

Reply 16 of 16, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

timeout will need to be cleared in PlaySysex as well.

	// clear active sensing timeout variable
timeout = 0;