fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Code patch for GM, GS, XG "system-reset" SysEx's, and Ma


From: David Henningsson
Subject: Re: [fluid-dev] Code patch for GM, GS, XG "system-reset" SysEx's, and MasterVolume SysEx
Date: Wed, 16 Feb 2011 14:39:10 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

Hmm, seems this patch went through unnoticed?

Well, I don't mind a maximum gain of 10, it seems like a mistake if it's 5 in some places and 10 in others.

About master volume sysex, I'm a little hesitant if the scale is right. What's the default master volume according to the spec? That should map against our default volume of 0.2. There is also no reason to ignore LSB.

About the GS/XG/GM sysex (what about GM2 reset, btw?) I think the code would look nicer if you did a memcmp() instead of matching each individual byte.

What do you think?

// David

On 2011-02-10 23:08, jimmy wrote:


Attached is a patch for 4 SysEx messages.  This allow Fluidsynth to automatically switch 
between GM, GS, XG mode on the fly, without having to restart, that is.  Often a 
"reset" sysex is sent at beginning of a midi file, but not always.

Sys-Ex "reset" messages:

    myweb.tiscali.co.uk/mikesmusic/my_technical_articles2.html#sysex

    1. GM Reset (understood by every GM-compatible instrument)
    Sys-Ex String: F0 7E 7F 09 01 F7

    2. Roland GS Reset (Understood by all Roland GS instruments)
    Sys-Ex String: F0 41 10 42 12 40 00 7F 00 41 F7

    3. Yamaha XG reset (Understood by all Yamaha XG instruments)
    Sys-Ex String: F0 43 10 4C 00 00 7E 00 F7

About master volume:

    home.roadrunner.com/~jgglatt/tech/midispec/mastrvol.htm

    Master Volume SysEx:   0xF0 0x7F 0x7F 0x04 0x01 0xLL 0xMM 0xF7

where (0xLL=LSB, 0xMM=MSB), where 7F 7F is maximum volume.

My patch ignores LSB (LSB=0), simply takes the MSB (7-bit, max value 127) 
devide by 12.70 to get the range of [0.0 - 10.0].

-----

In adding SysEx handler for master volume adjustment ("gain" in Fluidsynth), I found a 
few inconsitencies regarding "gain":

        -g, --gain
               Set the master gain [0<  gain<  10, default = 0.2]

which sets fluidsynth settings of:

        synth.gain FLOAT [min=0.000, max=10.000, def=0.200] REALTIME
               Master synthesizer gain.

While the fluidsynth command shell and manual page have:

        gain value
               Set the master gain (0<  gain<  5)

but the shell-command handler fluid_handle_gain() doesn't try to scale it in 
anyway to 10.0.  Any reason for that?  Or, it's just an oversight (in previous 
changes).

In this patch, I go ahead and change all references regarding maximum "gain" 
from 5 to 10.  Let me know if those need to be left alone.

Jimmy








_______________________________________________
fluid-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/fluid-dev




reply via email to

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