Can I do volume slide over MIDI?

Started by billkotsias, May 05, 2022, 21:25:34

Previous topic - Next topic

billkotsias

Hello! I started writing tracker music over 30 years ago, but haven't done so for the last 15 years. I am super glad to have downloaded latest ModPlug version and it feels like I'm back home again  ;)

For the first time I decided to use OMPT to control my Casio WK-7600 synth (GM-1 capable) because its instruments sound so much better than the ones I found in "MIDI Library" and "GM.DLS" at the top-left pane (am I right to presume these are provided by Windows/laptop soundcard)?

Anyway, I'd like to know if I can use any effects, particularly Volume slide (increase/decrease). I tried c0x commands but it seems these only work on samples. On the other hand, standard volume Vxx command seems to translate fine (had to set "Volume Command Handling = MIDI volume" and deselected "Volume commands with notes are Velocities"  ??? ). So, I did something like:

C-5 02 v20
--- -- v28
--- -- v36
...etc


but this is a little choppy - volume goes up in steps, not smoothly.

Is there a better way? I tried to take a look at https://wiki.openmpt.org/Manual:_Zxx_Macros#Parametered_Macros but I got lost, I think I need some more basic tutorial to get into that stuff.

Can anyone please help me out?

billkotsias

So I found the Control Change command:
https://wiki.openmpt.org/Manual:_MIDI_Reference#MIDI_Messages

Can someone please provide an example of how to use such CC controls in OMPT? I couldn't find one.
I found this message
https://forum.openmpt.org/index.php?topic=5488.msg42224#msg42224
but I don't get what PC Notes are, or how to annotate them

Saga Musix

One important thing to know first is that MIDI, unlike tracker modules, doesn't really have a fixed concept for changing the volume of a single note. MIDI volume (CC 07) messages affect all notes playing on the same MIDI channel, meaning that you are effectively limited to a 16 note polyphony (one per MIDI channel) when using MIDI volume for changing note volume. The only type of MIDI message that would allow addressing individual notes on a channel - polyphonic aftertouch - is not well-supported by both hardware and software synthesizers and is typically not even used to modify volume (but on some synths it can certainly be configured that way).

With that out of the way, the volume command handling option you found is a bit of a hack and indeed only affects set volume commands (vxx), not volume slides. PC notes aren't going to help you either because you want to talk to a MIDI synth (PC notes only work with plugin parameters), but you can set up some MIDI macros to do the job. I have attached an example with two variants:

On channel 1, MIDI CC 07 is sent, taking the parameter value of command Zxx or \xx. With \xx you can do smooth slides, but not the same way as c0x (you only specify the target of the slide, not the speed and direction). On channel 2, actual volume slides are used and the MIDI macro instead uses the letter "u" to evaluate the CC event's parameter based on the current tracker channel volume. As a consequence this approach occupies both effect cells if you want to update the volume. Not optimal but it's pretty flexible (as it will also work with instrument envelopes). (Side note: The slide on channel 2 starts at volume 1 because a zero-volume note- on event is equivalent to a note-off event in MIDI).

I know it's not optimal, but hopefully there will be a more intuitive way in the future that doesn't eat a whole effect column.

Quoteam I right to presume these are provided by Windows/laptop soundcard
Indeed, GM.DLS (and by extension OpenMPT's default MIDI library) is shippsed with Windows/DirectX. Soundcards haven't really included any ROM samples in the last 20+ years. :) There's plenty of better-sounding soundfonts that you can load into OpenMPT instead.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

billkotsias

Thank you so much!

TBH, I have found the solution a few moments before seeing your reply ;D (after a lot of trial-n-error, and swearing, I must confess  :o )
I have attached a screenshot of my solution.
What a pity that MIDI has to be so much more complicated than good old tracking, obviously for (bad) historical reasons...

I haven't checked your example yet, will check it in the next couple of days, I presume it's similar to what I did  ;)

Saga Musix

Yes, the first variant in my example does exactly what you have discovered. As mentioned, there's a second variant which can allow for more tracker-style volume modification because it can take volume envelopes of instruments into account. Just give it a try. :)
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

billkotsias

Awesome, I like the 2nd approach even better!!

AceOfSpadesProduc100

Even away from a note, why does only Vxx work, but not any of the volume slides? Because of the inherently fragmented nature of MIDI synths, I only focus on MSGS because it's what's bundled with Windows, and OpenMPT is all I know as a MIDI tracker instead of DAW. If volume slides are in fact a separate thing, why couldn't slide commands resolve to Vxx during playback to a plugin? The given examples use a low-level MIDI command, instead of Dxx or whatever being an automated Vxx setting.

Saga Musix

Essentially the answer is "because it was only implemented for vxx commands". I absolutely want to have proper plugin support for any volume (and panning!) commands, but adding half-assed support based on what we currently have is something to avoid, because it would mean that in the end OpenMPT would essentially have to support three different MIDI volume implementations once the proper solution is in place. Here's a rough sketch of what I envision the improved MIDI volume support to look like: https://bugs.openmpt.org/view.php?id=1315#c4422

Maybe there's time left to look into this for OpenMPT 1.32, but if not, I think OpenMPT 1.33 would be a good target to aim for.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.