Author Topic: midichannel suggestion  (Read 13908 times)

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
midichannel suggestion
« on: September 06, 2016, 09:57:35 PM »
as of now midichannel settings in preenfm2 are global settings, i would love to have midichannels be part of presets.

i would consider something like this:

global midichannel for listening to controls and program changes.

per preset midichannels for the individual voices.
 
or everything as is, except there is an "offset" midichannel for every voice. that offset value would be saved with the preset.
i for one would even be happy with one offset for all voices, since i only need to shift all voices by 4 :-)

so i would love this:

global setting: midichannel 1, 2,3,4
presetbased offset setting i.e. + 4 = midichannel 5,6,7,8

is this worth considering??

cheers

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: midichannel suggestion
« Reply #1 on: September 06, 2016, 10:14:21 PM »

Have you seen that somewhere else ?  :o
And can you describe a use case ? I don't understand at all what would that allow you to do....

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: midichannel suggestion
« Reply #2 on: September 06, 2016, 10:53:00 PM »
well, i have only seen it on the axoloti :-) but since it is modular you can adjust everything to your liking.

my (of course very special) usecase is this:

i have a (diy) controller that sends

either on 4 channels "simultaneously" to  get gliding for every voice (you set the same sound for all four voices)

or outputs to 4 different channels and can trigger four different sounds at once (depending on the trigger you hit, much like on the tribass: http://misa-digital.myshopify.com/products/tri-bass)

currently i can only  use the preenfm for one or the other, but not both.

but i understand this is a VERY special usecase and probably not worth the effort :-)

if it is not to hard to do, i would consider doing it myself, if you can guide me a little in the source. i had a quick look at the files. where would i add a new preset value? i can only seem to find presets.cpp which handles "defaults", but not all the values to save i think. where would i have to add the offset value? i looked in MidiDecoder.cpp but once again i am a little lost. but of course i would also have to add a new menu entry somewhere to edit the offset... 8)
« Last Edit: September 06, 2016, 11:04:11 PM by lokki »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: midichannel suggestion
« Reply #3 on: September 07, 2016, 09:22:04 AM »
1) either on 4 channels "simultaneously" to  get gliding for every voice (you set the same sound for all four voices)
2) or outputs to 4 different channels and can trigger four different sounds at once (depending on the trigger you hit, much like on the tribass: http://misa-digital.myshopify.com/products/tri-bass)
currently i can only  use the preenfm for one or the other, but not both.

Reading that, i have the feeling you only need a 5th midi channel that would play all instrument at the same time for your case 1.

If that's the case you only need to modify MidiDecoder.cpp ?
Code: [Select]
void MidiDecoder::midiEventReceived(MidiEvent midiEvent) {
The first part of this function is where it checks whether the channel of the midi data it receives fit the preenfm2 configuration.
Add something like this in each of the 4 IF blocks :
Code: [Select]
|| (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNELX]-1) == 15
And you'll be able to play all instruments at the same time when using midi channel 15.

Do i miss something ?

« Last Edit: September 07, 2016, 09:24:27 AM by Xavier »

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: midichannel suggestion
« Reply #4 on: September 07, 2016, 12:44:52 PM »
yes, they have to be four different channels, because otherwise i cannot use glide (voice set to one) and it does not "feel" like a string on a bass guitar. (basically what my controller emulates)

but your example should also work with four different channels in the if sections, so the preenfm would listen on channels that are set in the global menu and also to the 4 channels i hardcode. i will try this asap and let you know. thanks!


Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: midichannel suggestion
« Reply #5 on: September 07, 2016, 02:35:26 PM »
yes, they have to be four different channels, because otherwise i cannot use glide (voice set to one) and it does not "feel" like a string on a bass guitar. (basically what my controller emulates)

I don't understand that. Set your 4 instruments with voice = 1 and glide.
Make them listen the same midi channel and they glide all at the same time... no ?


but your example should also work with four different channels in the if sections, so the preenfm would listen on channels that are set in the global menu and also to the 4 channels i hardcode. i will try this asap and let you know. thanks!

Yes that should work with 4 hardcoded different midi channels.

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: midichannel suggestion
« Reply #6 on: September 07, 2016, 07:14:52 PM »
Quote

I don't understand that. Set your 4 instruments with voice = 1 and glide.
Make them listen the same midi channel and they glide all at the same time... no ?


well, the instrument idea is to emulate a real string instrument, you can glide on all four strings individually, you can play 4 voice polyphonic but still glide every string individually, or only one string while the other three stay on the same note and don't glide. this can only be achieved with a voice per string mapping. this is a common approach in all guitar to midi systems nowadays, because it "feels" the most natural for a guitar/bass player.
« Last Edit: September 07, 2016, 08:57:18 PM by lokki »

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: midichannel suggestion
« Reply #7 on: September 07, 2016, 08:59:23 PM »
ok, xavier your code did not work, you mixed up the source  8)

what works is this (for my config 1-4 and 5-8 where channel 5-8 are now simply remapped to 1-4 hence the + 3)
Code: [Select]
if (omniOn[0]
    || this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL1] == 0
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL1]-1) == midiEvent.channel 
    || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL1] + 3) == midiEvent.channel)
 {
        timbres[timbreIndex++] = 0;
    }
    if (omniOn[1]
            || this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL2] == 0
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL2]-1) == midiEvent.channel
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL2] + 3) == midiEvent.channel)
 {
        timbres[timbreIndex++] = 1;
    }
    if (omniOn[2]
    || this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL3] == 0
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL3]-1) == midiEvent.channel
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL3] + 3) == midiEvent.channel)
 {
        timbres[timbreIndex++] = 2;
    }
    if (omniOn[3]
        || this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL4] == 0
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL4]-1) == midiEvent.channel
            || (this->synthState->fullState.midiConfigValue[MIDICONFIG_CHANNEL4] + 3) == midiEvent.channel)
 {
        timbres[timbreIndex++] = 3;
    }

thanks! perfect.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: midichannel suggestion
« Reply #8 on: September 07, 2016, 09:51:23 PM »
ok, xavier your code did not work, you mixed up the source  8)

OOps... Yes i did  ::)
But you got the idea ;)

thanks! perfect.

Cool. I really like when open source is usefull like this :)
« Last Edit: September 07, 2016, 10:06:34 PM by Xavier »

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: midichannel suggestion
« Reply #9 on: September 07, 2016, 10:15:25 PM »
Quote
Cool. I really like when open source is usefull like this :)

i really like it as well. it's actually a dream come true. you can't imagine how often i was stuck with a problem that was unsolvable because of closed source firmware and bugs in it... so many times, i had to create my own midi controller, to at least get that part to my liking :-) now already two of my digital synths are open-source as well, great!