Just want to share this with the community. My old band recently got together again (after twenty years) and I can finally use Cantabile to play with a band. There’s a song where I play a pretty challenging solo (for me) and I need to change state right during a fast ascending scale. Usually I use a pedal switch to change state, but in this case pressing the switch was getting in the way of playing the scale correctly. Fortunately, the state change happens when I play a Adim7 chord with the left hand. It is the only occurrence of an Adim7 chord during the solo.
Also fortunately, I had studied the “Chord recognition” rack by @Sergio and @dave_dore, so I knew the existence of a function named all_notes_held(): I used the function to identify the Adim7 chord and change state when it happens, with this binding
I figured out that I should make a route from the main keyboard to the Onscreen Keyboard, which than should be the Onscreen Keyboard out. My binding looks now like this:
correct, you must create a route to “Output port - Onscreen Keyboard”
yes, you should put the “1” outside the square brackets, i.e. ([64],1) and not ([64,1]).
Coming to the other questions:
the chord recognition rack is here
Your question about what a Program is in Cantabile seems unrelated to the state change binding, if I understand correctly. AFAIU, a Program in Cantabile is just a plugin’s Preset (i.e. “program” has the same meaning as in MIDI “Program change” message).
Gabriel
EDIT: if you just want to use a single note (i.e. not a chord) to change state, then you could use a much simpler binding.
I did paste the wrong screenshot.
I tried with all_notes_held([60],1)==1, yesterday as well, and that does not work. I used just 1 note as a test. Changing to two notes it works! all_notes_held([60,64],1)==1
However, there are strange things. Now it works with Next state or Last as target,
That’s strange. It works here, even with just one note. However, I remember changing from “Next state” to “Load State with Program” because it was changing two states (i.e. it was firing twice) instead of just one. Maybe we need to debug this binding some more.
“Load state by program” should select a state according to a program number received via MIDI.
“Load state scaled” escapes me at the moment. Sorry.
For me it does not clarify. As far as I can see the binding is fired when the chord is met, and if the chord is more than 1 note, so in my simple example it fires when I hit the third [60,64].
From the syntax all_notes_held([##,##,..##],1) I do not se a which would be the new specified note that should be struck.
Taking note(off) instead of note as source may do what you want.
Joop
The notes in the chord needed for the conditional expression are on the right mapper part of the bindings box. These notes must be held before the condition is true the (Any) Note in the source part of the binding is the triggering note.
The trigger note is over in the source area of the box and as stated above is the event that switches the binding when the condition is true. This is the note you didn’t see I think.
I am using load with program for the state change instead of next state so that might account for the confusion. Next state doesn’t behave as expected so I stayed away from it.
by Program uses the input value be it a note or a cc value and uses that number for the target program number
by Index means the source value (note or cc) is used to load the state with the same index number. (index is a simple numbered list that is constant whereas program numbers can be placed anywhere in the indexed list.
Load state Scaled means the source MIDI input in the source box (0~127) and the Scale values in Cantabile are (0~1.000) with 1,000 possible points on the scale. Most VST synth knobs use this scale for values FWIW. So in this type of binding the source (0~127) is interpolated to the Scale target (0~1.000). So an input of 0 is 0, an input of 127 is 1.000 and an input of 64 would be .500. I don’t think this has much use in this state changing type of application.
For me it is the other way around,.. With program it does not work, nothing changes. Next state is doing what it promises: go to next state. I intend to use this more often, so I will find out how reliable it is.
With me it does not need the extra note, I checked in the midi monitor, had the 4-note chord held and it switches. Both with note and note(off), note(off) may be the better choice as it will only switch going to the next note/bar/
Extra complication: it must be note held, so playing fast or staccato it does not react.
Remarkably with note(off) it reacts better, even if in the midi monitor no note(held) is shown, but with a very short staccato it fails.
For me this would be a field for improvement: new function all_notes(), without the held.
After @dave_dore explanations, I decided to remove note 54 from the condition and use it as trigger. The binding seems more reliable, now working also with “Next state”.
In this way, the first three notes of the chord establish the condition and the fourth triggers the binding. Here is the binding with “Load state with program”.
No sweat Gabriel, it makes good sense. I got to thinking more about why Note OFF worked for Joop on single note triggering with a condition and it makes good sense after figuring it. The note ON in the condition box creates the held note is true condition and the Note OFF for that same note provides the trigger.
That is what thought for my note off as well. The part I still not understand well is that with note-on it triggers by just pressing the chord.
And I would like to plee for the function all_notes([##,##,..,##],y)