Hi guys, it's pretty simple, I want to use my left hand to hit three keys as if I'm plucking a bass guitar, and then the notes I play with my right hand don't sound unless my left hand is hitting something. I've gotten so far except my right hand notes still play by themselves. The problem is because I've stripped out the midi I can't use the note off info in the left hand to shut everything off. Also I'm not sure how to do this polyphonically, not a huge issue as I want this for bass sounds but any ideas welcome. I just need some kind of logic to not play any notes unless hte left hand note on message is sent.
-
Trying to add key switch functionality to a midi controller
-
Maybe this does what you want ?
1 - Moses splits the notes at the value defined by the slider to send only the note values of your right hand to the noteout object.
2 - I pack three floats : note number, split point, all incoming velocity value.
3 - The expression looks if the note value ($f1) is above or below the split point ($f2) : if above (right hand notes pressed), it outputs a zero, if below (left hand) it outputs the notein velocity ($f3).
4 - So you get : right hand : note values, left hand : velocity values.
-
Thanks so much, that seems like a much neater setup than I had. It doesn't seem to be working though. I need a note to be generated with the right hand note value and the left hand velocity value. I don't think it's doing that.
-
It is doing exactly that, or there is something I do not understand in what you are trying to achieve.
-
@kosuke16 said:
It is doing exactly that, or there is something I do not understand in what you are trying to achieve.
If I hold down a right hand (high) note and then play a left hand (low) note it should play the right hand note with the velocity of the left, but it doesn't play anything.
Currently I can press the left hand key then the right hand key and it will make a note so there must be some issue about the sequence in which the note infor and the velocity info are playing out.
-
@Alan-Angel You could be right about the order of operations......... https://forum.pdpatchrepo.info/topic/13320/welcome-to-the-forum
You need to store the right hand note so that it can be played later by hitting the left key.
I have broken it down into (I hope) an understandable work flow for a mono player....... this.pdSo that even if it doesn't work you should be able to understand the order of operations and fix the problems...
[pack f f] receives the velocity of high notes.... but that value is replaced by the velocity of the low note just before the low note triggers the playing of the high note.If you want to do this polyphonically you will need to use the [poly] object and to use the finished mono patch as an abstraction within a master patch containing [poly]...... probably using [clone].
That's slightly more complex.... but you will get there.....
David. -
Whale is right, my bad. I tried it only with the numbers, no audio so while the numbers where good, the timing wasn’t. Note message not being continuous, you have to repack it so it is send at the same time than the velocity to make a coherent list of two values for noteout.
-
My question about this:
-
Right hand first, then left hand: Note should be produced upon the left-hand note on.
- What if one right-hand note is pressed, and two or three left-hand keys? Multiple notes, or only the first? (Polyphony, I suppose, would have to be right-left, right-left, not the same as right-left-left.)
-
Left hand first, then right hand: Should it play the note upon receipt of the right hand note-on, with the left-hand velocity? Or not play anything? Or something else?
- And, if it should sound, what about left-right-right? Portamento? Ignore the second?
Because a full solution will be different depending on the answer to these questions. These need to be thought through anyway because you can't guarantee correct input -- the logic needs to handle sequences that are not ideal, too.
hjh
-
-
@whale-av said:
@Alan-Angel You could be right about the order of operations......... https://forum.pdpatchrepo.info/topic/13320/welcome-to-the-forum
You need to store the right hand note so that it can be played later by hitting the left key.
I have broken it down into (I hope) an understandable work flow for a mono player....... this.pdSo that even if it doesn't work you should be able to understand the order of operations and fix the problems...
[pack f f] receives the velocity of high notes.... but that value is replaced by the velocity of the low note just before the low note triggers the playing of the high note.If you want to do this polyphonically you will need to use the [poly] object and to use the finished mono patch as an abstraction within a master patch containing [poly]...... probably using [clone].
That's slightly more complex.... but you will get there.....
David.Thanks for your help. the low velocity isn't registering, I'll try to figure out why not but I get the logic.
@kosuke16 said:
Whale is right, my bad. I tried it only with the numbers, no audio so while the numbers where good, the timing wasn’t. Note message not being continuous, you have to repack it so it is send at the same time than the velocity to make a coherent list of two values for noteout.
Thanks for your help so far!
@ddw_music said:
My question about this:
-
Right hand first, then left hand: Note should be produced upon the left-hand note on.
- What if one right-hand note is pressed, and two or three left-hand keys? Multiple notes, or only the first? (Polyphony, I suppose, would have to be right-left, right-left, not the same as right-left-left.)
-
Left hand first, then right hand: Should it play the note upon receipt of the right hand note-on, with the left-hand velocity? Or not play anything? Or something else?
- And, if it should sound, what about left-right-right? Portamento? Ignore the second?
Because a full solution will be different depending on the answer to these questions. These need to be thought through anyway because you can't guarantee correct input -- the logic needs to handle sequences that are not ideal, too.
hjh
-
I don't plan on play two left hand notes, I just want to play fast galloping basslines like dun du-du dun du-du dun du-du dun and it'seasier to do with one hand and play the notes with the other, like a real bass.
-
Not sure about this one, I guess I'll know the more I play how I want it to work. Maybe default it to a low E like on a real bass for fun?
-
Agree, for now I just want some basic functionality to even see if the instruments I use can handle fast notes in the first place.
-
-
@Alan-Angel said:
- I don't plan on play two left hand notes, I just want to play fast galloping basslines like dun du-du dun du-du dun du-du dun and it'seasier to do with one hand and play the notes with the other, like a real bass.
OK, so, hold a pitch with the right hand and play fast notes with the left -- rhythm and articulation under control of the left hand. So that removes some cases.
However... user-interaction data are always dirty. You say "I don't plan on..." but in practice, when you're playing, the actual MIDI messages coming in will not always conform to the ideal. So if your patch is like "it works as long as I never X"... trust me... sometimes X will happen... the patch needs to be able to handle it.
E.g.:
I think the following two scenarios are guaranteed to happen sometimes:
-
You hit the right and left hand notes "at the same time" but the left-hand note arrives first. If the logic here is "nothing is currently held in the right hand, so, do nothing," then the first note will become a rest. So there should probably be some logic such as "if the right-hand note arrives within a certain time window after the left-hand note (like 20-30 ms or less), then play it once both are received."
-
While rolling the fingers over G-A-B in the example, some of them overlap. If you're using left-hand note-off to release notes, and you don't account for overlaps, then some notes will be cut off prematurely.
For problem 2, assuming mono, you would release a playing note if the note-off matches the last note to be played:
- note on 43
- note on 45 -- then, quickly, note-off 43
- note on 47 -- then, quickly, note-off 45
- note off 47
At 2, note-off 43 should not cut the note off because it isn't the currently active trigger note number (but, since note-on 45 is rearticulating, then it will have to generate a note-off before the next repeating note-on!). But, at 4, note-off 47 should cut off the note.
I'm not sure I have time myself to build all of this, but maybe I can do some pieces of it and post them later.
hjh
-
Like a lot of software problems, it seems like a lot of the difficulty is in defining the requirements. I saw that frequently when I was working.
-
I think this handles the left-hand overlap problem.
I did not insert a note-off for rearticulated notes, so this patch is incomplete. Also the right-hand time-window idea is not implemented here... but it's all the time I have right now.
Like a lot of software problems, it seems like a lot of the difficulty is in defining the requirements.
jameslo is 2000% correct about this. Often the working method is "let me throw some objects into the window and hope some of it sticks." The usual result of that is confusion.
hjh