surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.13k stars 400 forks source link

How can I alter Timbre cc74 to BC cc2 in the source code? #2638

Closed DavidsonAudioMulti closed 4 years ago

DavidsonAudioMulti commented 4 years ago

This isn't really a problem more of a change of default CC74 to CC2 for Timbre

I would like to have timbre cc74 be by default cc2 What part of the code can I alter to get swap these values. I would also like to rename the GUI Timbre to Breath any suggestions would be appreciated thank you.

Update: I found that changing the Case 74 to 2 in SurgeSynthesizer.cpp changes the source CC for timbre that's great. I still need to figure out how to rename the button Timbre to Breath?

baconpaul commented 4 years ago

timbre is treated specially in mpe mode so be careful. and we wouldn't be able to merge your change. but you can go ahead and modify the name Timbre in the places it appears in src/common/ModulationSource.h

If you want to map CC2 you can also assign it to a control and then use that control as modulation source.

Hope that helps

DavidsonAudioMulti commented 4 years ago

I see that I tried and it turned out kinda glitchy.. Is there a way of editing the modulation button name like turn Modwheel into Breath. I can't find the GUI edit for this. I looked through the skins and couldn't find this. It must be programmed into surge some place. I will keep looking to see if I can change it. I noticed that I can change the default CC's for the Macros in surge configuration file. This I can change CC 41 to CC 2 by default which also does what I want. Still I would like to be able to edit the GUI for the Modwheel button in the routing section cheers!

baconpaul commented 4 years ago

The Modwheel button is named in the same place as the Timbre button, that point in modulation sources header as mentioned above

You can RMB on a control and set it to CC2 or you can also put it in learn mode. Theres a menu that lets you save a variety of configurations.

The hard coded modulators are indeed that. The macros (or direct midi learn) serve as the non-code driven way to map other controls to surge. Or of course mapping through your DAW to whatever you want using automation.

baconpaul commented 4 years ago

https://github.com/surge-synthesizer/surge/blob/4d8baf1b4e618487bc217ee210d174694731bfe9/src/common/ModulationSource.h#L107 that's the region you are looking for. change the 3 versions of the name and rebuild your surge and it will work.

mkruselj commented 4 years ago

I would rather suggest you to use a Macro for this. You can bind almost any CC to the macro directly, and it works like any other modulation source.

DavidsonAudioMulti commented 4 years ago

mkruselj are these macros or bindings saved individually with the preset? For instance if I make a patch and assign the macro 1 to CC2 then the person that loads a preset would also have to have the same macro set or same configuration file for default macro cc's? My hope is to just have cc2 as a default modulator so the macros don't have to be altered to support the presets.

I found that piggy backing CC2 on to aftertouch works to where is can accept aftertouch or cc2 input. I just made a separate cc2 case 2 for modulation to aftertouch source.

I am going to try baconpauls suggestion to change the button name. Thank you everyone for your suggestions this helps me a lot cheers!

baconpaul commented 4 years ago

@DavidsonAudioMulti the problem is the approach you are taking will also not let someone open your patch since we can't merge it!

The midi mappings are set up by users. What I would do in your case is to rename the macro "Breath" and then let the user map their appropriate midi control.

If we added another row of modulators, or added a 'compound midi modulator' which has RMB toggles (kinda like velocity is release velocity) it would solve your problem. That's more code than what you have indicated you have changed. But if you are interested in making it so one of the monophonic control points (probably mod wheel is the most sensible) as a bound control, that's writable code.

DavidsonAudioMulti commented 4 years ago

Baconpaul I see what you are saying make a toggle for modulation wheel but then we would lose mod wheel. I am trying to get better compatibility with wind controller and I would like to have the CC's 1,2,5 as built in modulation sources. Maybe I could do a BC toggle for aftertouch where aftertouch can be swapped for cc2. It would be great to be able to have just cc 1 and 2 as built in modulation sources this would make wind controller patches that rely on cc2 easier to make. I am gonna try to change the name of the button see if I can. Thanks again!!

mkruselj commented 4 years ago

Macros are indeed saved within the patch, individually for each one you save. However, the MIDI assignment to the macro is saved globally. So you would have to instruct people using your patches to MIDI learn the Breath macro that you do to CC 2.

mkruselj commented 4 years ago

And yeah @baconpaul at some point we will need another row of modulators, haha. 😁

baconpaul commented 4 years ago

@DavidsonAudioMulti inwas suggesting we do the same thing as we did with release velocity where two modulators can sit in one slot

https://youtu.be/GnEX-ypuem0

Like that

mkruselj commented 4 years ago

Yeah that'd be a stopgap solution, but man would it be great if we didn't have to hide modulators like that 😄

baconpaul commented 4 years ago

I agree Just trying to offer solutions which we could merge in 172

baconpaul commented 4 years ago

If we did add a row what would it contain? Obviously release vel but do we have enough midi controls to justify a full row?

DavidsonAudioMulti commented 4 years ago

I was able to change the name for after touch and make it respond to both CC2 and Aftertouch works pretty good. It would be better to have a toggle switch to select between the 2 controllers. This really only makes it easier to make patches that respond to cc2 that is not a huge improvement. image

mkruselj commented 4 years ago

If we did add a row what would it contain? Obviously release vel but do we have enough midi controls to justify a full row?

Release velocity Breath controller (CC 2) Expression (CC 11) Separate monophonic keytracks (lowest highest latest) - could also be set up as alternates because they are a bit niche Random unipolar Random bipolar ...

In case of this I would want to reorder things so that the first row is just the 8 macros.

DavidsonAudioMulti commented 4 years ago

mkruselj That is a great suggestion this would be a big improvement!! How difficult would this be to implement I am not real familiar with Surge project most likely not something I could pull off. I found that adding cc2 to the aftertouch input is getting good results. One thing I notice is that surge is slightly slow to respond to CC inputs and Note on offs. This is a very small delay but I can notice it when compared to other synths. Is there a way to increase responsiveness to CC and note on off's?

baconpaul commented 4 years ago

Which DAW are you using and which plugin flavor?

What @mkruselj suggested would be easy from an internals perspective; and a huge pain from a UI perspective (we would have to re-render all our graphics and respace the UI).

mkruselj commented 4 years ago

We'd really only need to update bmp00102 across two (well three, if we count Nick's) skins to account for one extra row, the rest is dealing with spacing of modbuttons in code. Not terrible from my perspective.

mkruselj commented 4 years ago

Also I don't notice any additional delays to note on/offs compared to other synths, however CCs that are received are being smoothed out to an extent, AFAIK.

DavidsonAudioMulti commented 4 years ago

I am using Reaper and VST3 I think the delay that I am experiencing is very slight and may have nothing to do with the note on off's. Since I am using a wind controller the CC and note on off are kinda linked so if the CC has a certain smoothing or lag applied triggering seems slightly sluggish. Mkruselj the smoothing that occurs on the CC can that be configured to be disabled or have an adjustment for it? Do you know where this code is located? Thanks!!!

mkruselj commented 4 years ago

There's no parameter to adjust that smoothing in the synth itself, and @baconpaul knows where that is in code. Might not be a bad idea to have some options in the Menu regarding that smoothing?

DavidsonAudioMulti commented 4 years ago

That would be great for instruments like the wind controller that rely heavily on CC response. These controllers are typically very smooth and need little to no smoothing for a tight feel. +1 mkruselj for this suggestion on putting it in the options menu.

baconpaul commented 4 years ago

The problem is less the smoothing (although that is a problem) but that the smoothing algo is both too slow and never reaches the target!

I should just go and fix that.

https://github.com/surge-synthesizer/surge/issues/1412

is the issue. Let me bump it into the 172 milestone.

DavidsonAudioMulti commented 4 years ago

That would be great baconpaul!! I don't think I would notice with the mod wheel or foot pedal CC but the breath controller you can feel a slight sluggishness. Making the CC mod's more responsive would help when using a breath controller or wind controller. Thank you for looking into this let me know how it goes cheers.

DavidsonAudioMulti commented 4 years ago

I looked at the section for the release velocity option from right click. I was thinking I might be able to make AfterTouch respond the same way when right clicked with an option for CC2 Breath as an alternate in the right click menu. I will try to add this feature in I am not 100% if I have found all the code to replicate this feature over. Any tips on how I could add this menu option for AF to BC thanks.

mkruselj commented 4 years ago

You don't have to add that, we have a better solution - redesigning the modulation section, adding one more row for more modulators.

DavidsonAudioMulti commented 4 years ago

Great that would be awesome mkruselj!! I hope you guys can make the CC's a little more responsive also this would be an excellent addition. I will keep an eye out for an update can't wait to try this thank you!

mkruselj commented 4 years ago

@DavidsonAudioMulti So just to let you know, spent a day or so redoing the layout of modulation area and adding new modulators, now there's dedicated slots for breath, expression and (continuous!) sustain pedal even, to act as modulation sources.

Feel free to check out the latest nightly, but be aware this is a pre-beta sort of software, not intended for full production purpose until things are officially released. Do let us know your thoughts!

The CC smoothing options will be there at a later point.

DavidsonAudioMulti commented 4 years ago

Great I am checking it out thanks that was super fast way to go!!

DavidsonAudioMulti commented 4 years ago

This build is working nicely with the wind controller exactly what I was looking for CC2 Breath as a built in modulation source. This will make patch creation more universal without have to change any macros. I am interested to try the CC smoothing when it is ready.

baconpaul commented 4 years ago

I just pushed the midi smoothing options - should be in a nightly soon enough (although azure is having some issues this evening) so I'll close this issue since the two material things - breath as a modulator and better smoothing - were both great ideas (thanks for opening the issue!!) and are now done in the nightly ready for 1.8.0.

Thanks!

DavidsonAudioMulti commented 4 years ago

Great I will try thank you!!