Open jonjamcam opened 8 years ago
no problem . ^^
Ezee can you point me to where is the code for this feature?
i was looking to that , it's dispatched in several files , from midimessage to audionodes , need to work a little to remember the flow ...
k. In the meantime this is my idea of where to start with this:
I have a portable studio KORG D3200 that has already mapped all this and the standard is very interesting....
the very simple implementation is here : https://github.com/Ezeer/JomTobo/blob/JonJamConcept/Client/src/MainController.cpp#L610
if(msg.isControl()){ int inputTrackIndex = 0;//just for test for while, we need get this index from the mapping pair char cc = msg.getData1(); char ccValue = msg.getData2(); qCDebug(jtMidi) << "Control Change received: " << QString::number(cc) << " -> " << QString::number(ccValue); getInputTrack(inputTrackIndex)->setGain(ccValue/127.0); }
Ok Good, I can start studying that code...thx
yeah , if you do : int inputTrackIndex = 1;
then the control will be affected to track 1 ( 0=first , 1=second etc ...) BUT if the track doesn't exist you may have a crash ....
ok. thx. I have first to translate the chart above....
char cc = msg.getData1(); <--- the type of control char ccValue = msg.getData2();<--- the value of control
peerhaps it's better to create a midi branch for that work , because it could be merged after with any new project/branch ...
Yes, good idea
ok , i create one so . ( from master )
the branch is here : https://github.com/Ezeer/JomTobo/tree/midiCC
So my problem is the following:
we have 16 midi channels and each channel 128 CC. The most common uses are for example CC7 FADER, CC 10 PAN, etc, so if we follow a standard we will have
CH1, CC7 (FADER 1st Channel) CH1, CC10 (PAN 1st Channel) CH2, CC7 (FADER 2nd Channel) ....
This is a problem because if you plug a keyboard you will need this same mappings for your instruments......
So we have several choices to solve this:
1.- Use non-standard CC. 2.- Use other than CH1,2,3, etc.
CH10 is reserved for drums and CH1,2,3,4 are mostly used by the user so:
For example:
1.- As Jamconcept has max 8 channels for the control section we can use CH 6,7,8,9 for the 4 first subchannels and CH 13,14,15,16 for the second subchannels. this way we can map CC7 to FADER CC10 to pan, etc.....and we have a consistent standard mapping.
2.- A second approach could be use non-standard CC combined with standard Channeling, so in this case we could use CH1 for fader 1 and CC 107 for fader adn CC110 for PAN, CH2 for fader 2, etc. With this approach we risk moving a jamconcept control while trying to map a instrument control
3.- A third option could be combine the two above: unconventional CHanneling with unconventional CC mapping..
i understand ... a button to enable/disabled CC on track(s) could be a quick answer . You enable when you mix , you disable when you play ?
mmmm....in my experience every fader can be needed at any time, so if someone has a 10000 channel controller he could map anything independently....
But this is just a "default" mapping. You were working on a learn function for special tweaks
perhaps i don't understand your problem here ? It's not a question of learn , because if you give your keyboard volume to control the volume of a track, when you play , if you use the volume , that will control the midi note volume + the track .
" if you give your keyboard volume to control the volume of a track, when you play , if you use the volume , that will control the midi note volume + the track ."
Yes and that's a problem. I explain:
one track can have 16 different instruments controlled and assigned independently, so if you are in:
TRACK1---> instrument 3 (CH3) vol fader (CC7)......you may think you are controlling you instrument, but you may be controllig Jamconcept track 3 (fader) too which may be a guitar for example and not knowing it. This is why studios an PA systems have large consoles. When you adjust one instrument you want it to stay that way...
So let's have a practical example:
you load Hypersonic on track 1 on Jamconcept and assign your keyboard to ALL channels:
You can control all 16 instruments with 1 keyboard. Just change the channel and use the CC.
The mapping of Hypersonic is standard(but can be changed)...so
CC7 controls volume CC10 controls PAN etc..
Now say you want to control Track 2 PAN of JAmconcept with your keyboard....what will be the most convenient?
I think CH2 CC10 is a bad choice, you see? because you'll be changing the pan of Ch2 of hypersonic, co I think we should use CH7, cc110 in this case. or CH2 CC110 maybe can work too
yes , i think we'll find a solution on the way , we must start with very simple logic and solve the problems steps by steps by experimentation . In the case of channels , we can skip that parameter for example to control a track , just use the map ( trackindex/controltype ), that would apply to active track only ( selected for cc control ) .
So in practical terms:
CH1 (no subs) : FADER: CC107, PAN CC110 (midi Channel 6) CH1 (2nd sub) : FADER: CC107, PAN CC110 (midi Channel 7) CH1 (3rd sub) : FADER: CC107, PAN CC110 (midi Channel 8) CH1 (4th sub) : FADER: CC107, PAN CC110 (midi Channel 9)
CH2 (no subs) : FADER: CC107, PAN CC110 (midi Channel 13) CH2 (2nd sub) : FADER: CC107, PAN CC110 (midi Channel 14) CH2 (3rd sub) : FADER: CC107, PAN CC110 (midi Channel 15) CH2 (4th sub) : FADER: CC107, PAN CC110 (midi Channel 16)
to have something to start...
honestly , i don't know . Perhaps , everything is to be tried , that is new to me ...
Standard mapping:
You see CC 107 and 110 are not used for standarization
We can use this mapping to test and as we go...change it....but I'm 100% sure wi'll have no conflicts
" everything is to be tried "
haha....of course....the beauty of creating stuff!!!
your idea of "a button to enable/disabled CC on track(s) could be a quick answer ." is good if you don't want to use a controller for Jamconcept. quick and simple....
so to use the branch I type "git branch https://github.com/Ezeer/JomTobo/tree/midiCC"?
no . ( i have a working static dev man !! ^^ )
first you must go to master git checkout master git checkout -b midiCC ( this time use EXACTLY the same name as remote ... ^^ -b create a branch ..)
ok.
git checkout master git checkout -b https://github.com/Ezeer/JomTobo/tree/midiCC
" i have a working static dev man !! ^^"
Congratulations!!
wait...I0m doing something wrong
git checkout master git checkout -b midiCC
or
git checkout master git checkout -b https://github.com/Ezeer/JomTobo/tree/midiCC
git checkout -b midiCC
and thank you for the excellent widi guide !
Ok I'm in midiCC, but Qt is asking me this..?
click yes , Qt has switched of project . normal yes to all in fact ...
Ok One more question. I need to use some variables (int) for this part. Were do I declare them?
EDIT: maybe constants is what I really need to set the CH, and CC at the beggining
depends of the use . local or global . inside a class or outside a class ... what do you plan to do ?
Let's say CH1:
constant CH = 6 (for midi channel number which will be used to control) constakt CC = 107 (for PAN)
this so we can change in the declaration later if we want another map
Let me think about it better tomorrow.....I may be mixing apples with oranges here...can't see that clear now
one more question, Ezee: the funk setGain(ccValue/127.0) what parameter does it use (max, min)?
well , storing data is an art .. you should first experiment some basic things in the site i've mentioned earlier for C . You need to learn what is a struct , what is a member of a class , a variable in a function , etc ...
i need to work on the static setup now , and can't provide to you a quick solution .
one more question, Ezee: the funk setGain(ccValue/127.0) what parameter does it use (max, min)? no , it's just a normalization of the ccValue with the slider range . ( from 0 to 1 )
use the doc , i give you the link to the class that uses setGain , look to the other funks to play with ! http://makeitezeeah.esy.es/jomtobo/doc/class_audio_1_1_audio_node.html
try setPan(..)for exemple ... ^^
ok. good..thx...mo hurries... gonna get some more sleep. I need to get this headache out of my brain now.....cya later, man
ah ah ah ... yeah , you'll see clear after a good rest for your brain . you try to learn so much in so little time .... dream free ! ^^
you know I worked this kind of stuff in basic. I still remember......very familiar....but it's true....I need to know more....well it will be fun. Night man
night ! :)
i just created an object ( class ) that will be used to manage and control the MidiCC as an interface for the MainController class that actually filters midi and audio : http://makeitezeeah.esy.es/jomtobo/doc/class_controller_1_1_main_controller.html
That way , we concentrate our efforts on a new object that must be connected to Midi and to LocalTracks ( and more if needed , like metronome etc ... )
It's just a starter class , you should take the time to study what is a c++ class , with constructor and destructor , and the members that are public, protected or private . Learn how to access members in a class using " -> " for a pointer of the class , or " . " for the class itself . Read that page : http://www.cplusplus.com/doc/tutorial/classes/ that will introduce you slowly in c++ , then compare with the class ( very simple actually ) i just created to do the CC control :
In that files we will put the variables you asked for ( and funks to use them ! ) , but under a format that you don't know actually, the vectors , map , etc :
read that , and you will find inspiration ! ^^
You can follow the implemention of the MidiControl class inside of MainController in that commit : https://github.com/Ezeer/JomTobo/commit/36bf440a8fc320020883c25d480d5a4614888a3f
Think that MainController is a motherboard and MidiControl a Pci card . MainController starts and stop the midiControl :
create :
https://github.com/Ezeer/JomTobo/blob/midiCC/Client/src/MainController.h#L256
https://github.com/Ezeer/JomTobo/blob/midiCC/Client/src/MainController.cpp#L298
https://github.com/Ezeer/JomTobo/blob/midiCC/Client/src/MainController.cpp#L1137
kill :
https://github.com/Ezeer/JomTobo/blob/midiCC/Client/src/MainController.h#L256
https://github.com/Ezeer/JomTobo/blob/midiCC/Client/src/MainController.cpp#L1144
Hi Ezee....My head's better now.....before I forget.....I was studying the code and I understood what's happening......so I changed this part of the code and could move more than one fader with the knobs of my SPD simultaneously.:
lines 615-618
if(msg.isControl()){ char cc = msg.getData1(); char ccValue = msg.getData2(); int inputTrackIndex = 19 - cc;//just for test for while, we need get this index from the mapping pair
In this example my spd sends CC 17,18,19 and faders 2,1,0 moves respectively. All this works only for channel 1.
Each fader is assigned to a different CC nmber, but that's not what I need. The only thing I need to make it work as planned is the midi channel information, but it isn't there. I only get CC number and CC value, so how can we have CC channel info as variable too?
Hi ! You really should read the doc , doc . lol -> http://makeitezeeah.esy.es/jomtobo/doc/class_midi_1_1_midi_message.html#a70b2e308e5b802e90dee5540e9afabf7
int Midi::MidiMessage::getChannel() is the funk you need . msg->getChannel() should return the channel . Hope that will help you . :)
k. reading now......thx
Also , we use the RtMidi API here , there is a doc that will help too to start with datas : https://www.music.mcgill.ca/~gary/rtmidi/ ( look midi output chapter for your subject ) ^^
I connected my keyboard and voilá. most CC on CH1 controls first track!
wow. this is cool, but we need to use a standard midi mapping