I have a midi control script in vbscript/midiox that wanted to port to PD. Mainly creates behaviors like double taps, hold switch behaviors into midi alternate midu output from the same footswitch on fcb1010 foot board to drive Live. I don't have the time to digest and learn another language so I'm hoping to get help. I realize time is precious so I'm willing to pay someone to do it. Its not commercial and am willing to share the final product. It makes Live way easier to use but its kludgy using midiox/vbscript etc
-
Looking for PD guru...private proj
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
@image_engine Umm...we can help you for free! Can you post your script or at least tell us specifically what you want pd to do?
-
Cool...excellent in fact. Will start with 1 issue and go 1 at a time...
Main behaviour is a single click/double click/long hold. ie For midi sustain, a quick single click enables a filter which allows only note on values to play midi notes (for sustained atmoshpheres played from a midi guitar). Anything longer than a quick click is a standard momentary sustain pedal. A double click resets the pedal action and sends an 'all notes off' to clear everything.
I was planning to use this in a browser so I used an active X timer so it would be async to the rest of the script. Hope I have added enough comments to explain;Insert Code Here Case 64 'Case CC 64 = sustain message from floorboard 'Dat1 = Midi message type+channel 'Dat2 = message value 'default action is send cc64 to instrument out ie Dat2 = 127 and begin sustain regardless of note off filter/sustain action If Dat2>0 Then mox.OutputMidiMsg InstOut, &hB0, 64, 127 'SC is prefix: SingleClick 'Check if its the first trigger in timer sequence and timer has been fired If SCTiming = 1 then 'Test how many pedal downs have occured during timer period If Dat1 = SCOldDat1 THEN SCClkCnt = SCClkCnt+1 End If Else 'Waiting for Single Click Pedal Up If WaitForSCPU=1 Then If (SCOldDat1=Dat1 AND Dat2=0) Then 'Long Hold Action - cc64 sustain off mox.OutputMidiMsg InstOut, &hB0, 64, 0 'Clear wait flag WaitForSCPU = 0 End If Else 'fresh trigger 'sc and dc are single/double click actions that are executed as strings according to timer sc="FilterMGNoteOff = FilterMGNoteOff XOR True : mox.OutputMidiMsg InstOut, &hB0, 64, 0" ' PUREDATA NOTE: couldnt see any XOR functions? dc="mox.OutputMidiMsg InstOut, &hB0, &h7B, &h7F : FilterMGNoteOff = False : mox.OutputMidiMsg InstOut, &hB0, 64, 0" 'SCTiming is a flag to indicate timer has fired SCTiming = 1 SCTimer.enabled = true SCTimer.Duration = 400 'set the click count to 1 (ie pedal down of 127 has ocurred) SCClkCnt = 1 End If End If 'Single Click previous value used for comparison/click count SCOldDat1 = Dat1
Insert Code Here
And here is the timer sink/sub; Insert Code Here Sub SC_Timer SCTiming=0 'Do Timer results here If (SCClkCnt=3 OR SCClkCnt=4) Then 'DC Behaviour Execute(dc) Else If SCClkCnt=2 Then 'msgbox "sc" 'SC Behaviour Execute(sc) Else If SCClkCnt=1 Then 'Wait for pedal up 'msgbox "pedal up" WaitForSCPU=1 End If End If End If 'Reset ClkCnt SCClkCnt=0 SCTimer.enabled = false End Sub
Hope that helps explain
The above example is a bit parametric in that it feeds strings to the sub. This type of module is used throughout the script so Im totally open to simplifying it/modding to make it better in PD...which, from what I have seen, looks like it should be able to do.
If I can get all the previous code to translate, would like to add a control panel showing the fcb with the the current status/values of footswitches on screen, or even just just plug a tablet on the front of the controller for the future.
Many thanks
Mark2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
@image_engine Wow looks cool. I am unfamiliar with this programming language so maybe you could help me parse it out a bit further.
It seems to me like you have two "gestures" that you want to map into Live:
- tapping on a button on your midi controller
- Pressing and holding a button on your midi controller
- If you briefly tap, you want all notes played henceforth to sustain, until you double click.
- If you press and hold, you want all notes played henceforth to sustain, until you release your foot from the button on your pedal board
Here's how you could handle this in pd:
Here's the patch:
programhelp.pd
Probably not the most elegant way, but this might work for you. You might have to tweak some of the times for the [moses] objects depending on how fast you hit your midi controller. -
Hi, I did almost the same thing with my midi footpedal, pd, Live, midiguitar and GuitarRig.
The patch combined crossfading between GuitarRig and Midiguitar and [sustain]-switch.
I could post later (when found), if you like.
I can't understand your vbs script, so I'am only guessing here what it exactly does.
But I would say you can control almost everything in Live with pd. -
Thanks so much for getting me a start...I wont get time til the weekend to dig right in. I should have explained a bit more...hehe...the PD probably looks as foreign to me as the VBS does to you.
Ill break it down a bit further;
The vbs has a couple of actions on the fast single click; what actually happens is a global flag (called 'FilterMGNoteOff') is XOR'd true, as well as the CC (Continuous Controller) 64 (sustain) with a value of 0 is sent. A sub checks the incoming notes from the midi guitar input and if the flag is true, strips the note offs. This is so that I can still play notes on the keyboard (which comes in on a different port) after I set up the hold on the midi guitar (there are a number of parts to the righ). Its not actually a true sustain function.
The double click actually sends a CC 64 val 0 to turn off sustain, an all notes off to cancel hanging stripped notes and finally sets the 'FilterMGNoteOff' to false.edit: Somewhere I need count how many clicks and action depending on how many clicks, if that makes sense.
Cheers
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
Got a chance to test just now. Thanks again for your generosity @rjpg. This is almost it straight up...will spend some time learning how to sub patch so the whole thing would be a lot easier to navigate...PD seems great. The only glitch with the patch is that the double click time needs to count (as per one of the previous posts) if a single or a double click occurred in the timer window. So there are only 3 behaviours; a double or single click during the same time window or a long hold which would occur after that time window. Hope that makes it clearer.
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
@image_engine In the patch I made the "time window"-- if I understood you correctly--is an arbitrary 1000 ms, which you can modify by changing the arguments for the [moses 1000] and [delay 1000].
-
I normally use a 400ms window for the dbl/single click actions. I changed the 2 occurrences of 1000ms to 400ms but its not quite what I was hoping for...unless Im missing something...still coming to grips with symbols rather than text. Thats why I was counting the pedal up/downs. I know that if the count>2 then its definitely a double, otherwise a count of 2 = a complete single quick click, a count of 1 means its still waiting for pedal up.
How would you set an async timer...have the counter (like you made) do the count and then at the end of the time window only then send the count? I have spent most of the day and havent been able how to get a bang to fire the result of the count. I need to trap all the pedal up/downs until the timer finishes...like the vbs code.
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
maybe that helps a bit:
multi-button.pd -
Been on other forums where it was very tough getting anything really sorted. Currently trying to get optical quadrature encoder to work with Livid Brain jr...breath of fresh air over here...thats for sure...overwhelming
@bang..thanks...it helps so much to see others perspective...bit like life I guess. It still has the same issue where a quick single click should fire by itself. If I double click, the other forks are still firing....but your patch has answered other questions though.
Based on mostly @rjpg 's patch was able to mod it...most of it already there. Im just stuck on getting the quick click action to toggle the glob variable MGFilter. The quick single click should be just toggling (the behaviours are parsed into an action tier down the bottom). Other future parts of the code will also need to toggle the same module.
BTW the reason for the toggle is so you can hold a chord and play non sustained over the top of it, eg in a lower register, single quick click to engage MGFilter, play the chord (it holds), then single click again and you can then play eg modal in a higher register over the top of the chord for ambience etc a bit like the sustain behaviour of earlier Roland guitar synths with on board engine.I know its my first go at it so please be gentle with criticsm
PD is great...unfolding relatively quickly for me...have a lot of slate to clean to get around it though
P.S. Are the line wraps in comment meant to remain? After save/reopen...the comments are all over the place
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
@image_engine have a look at this (comments in "sustain")........
ba_sustain-mod.pd
Note.... new version...... always in too much of a hurry!....
and so please ignore the comment about timer!Nothing fixed...... just comments and pointers.......
David. -
@whale-av Very helpful...:-)
The MGFilter is already 'working' as such, the prob is I need to get its value and invert/toggle every time I single click. ATM Im only able to set it rather than gets its value and invert it. The other modules will also need to read the value and modify, write back etc2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
@image_engine Hmm, its slightly delicate as you must not cause a stack overflow. In this patch the [f] stores the state and sends it back with a bang to its left inlet,
Toggles.pd
Have fun!..... bedtime for me......
David. -
Brilliant!
Last thing...how do you force toggle to false/true. The double click needs to uncheck the togglePeaceful sleep!
Send it a direct value of course...sorry.
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
Hi,
For switching a toggle on/off without clicking on it, you can use sends and receives. Right click on the toggle, select properties and set a name for the toggles receive. Then click in the messages [; my-toggle 1( and [; my-toggle 0( to turn it on and off:
As for the double click, you can try something like this (I set the upper limit for double click detection at 250ms):
Cheers,
Gilberto -
Thats a nice way to trap the DC. The main prob is need to count how many clicks in the time...to choose an action. All done now. Thanks again to everyone. Will start a new topic for the rest of the sections.
2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it
-
Thanks to all...here is the current draft. Might help anyone else wanting to reduce foot switch count for live rigs. Welcome any other streamling/comments etc. Ill leave the abstraction to the user :
Single Click PedDown (held) = Sus 64 ON;
Pedal Up > 500ms = Sus 64 OFF;
Single Quick Click >500ms< = Toggle Note Off Strip;
Double Click >500ms< = Send All Notes Off, Reset Strip Toggle2.5 billion genomes in 2.5 nanometres...now thats what I call data compression! Language of Life...love it