Workaround: How to trigger samples via MIDI with PinkyVST
Posted: Sun Nov 23, 2008 4:53 pm
Introduction
PinkyVST is a great plugin for integrating vinyl control into your workflow for things like scratching samples while performing an Ableton Live set. However, the biggest feature missing is a way to load which sample to control via MIDI, like what you can do with the Reactor ensemble Ammobox. Apparently, MIDI control was attempted for the PinkyVST but constant problems resulted which kept the capability from being included in the release. This is a guide for a workaround I developed in order to hack in the capability. Due to the method in which samples are loaded (drag and drop), it isn't the cleanest method but it works very well and with little overhead. Unfortunately, this hack is MAC ONLY due to the tools used, but the same steps should work on a PC if you can find the right tools.
What You'll Need
PinkyVST
MidiStroke (A MIDI-to-Keystroke converter)
Quicksilver (For its ability to bind shell script execution to keystrokes)
Click (This is a custom app I wrote to perform the drag and drop)
Overview
Looking over the requirements list you might have figured it out, but basically what you'll be doing is creating a workflow to bind the execution of an app that performs the drag and drop necessary to load a sample in PinkyVST to a keystroke, and then binding that keystroke to a MIDI note. If you want you can stop right after the keystroke step is that is all you need, but for full-on MIDI triggering goodness I'd suggest going all the way.
Step 1: Setting up the Click App
Download the click application and put it wherever you find convenient (I put mine in my Documents folder). The application takes two arguments as its input: the X coordinate and the Y coordinate of where you want the click to occur. It takes these inputs and performs a downclick at that location, and then it drags 15 pixels to the right and then releases the button to perform the drop. So if you wanted it to do this action at 1200 pixels to the right and 390 pixels down from the top-left corner of your screen, you'd run the program like so:
./click -x 1200 -y 390
To try this out, just open up the Terminal application, navigate to where the click app is stored, and type out the command above and hit enter.
You should see your mouse jump to the right side of the screen. Pretty simple right? You can test out this command, changing up the X and Y parameters, with the PinkVST window open and in the location you'd want it to be in and figure out the exact XY inputs for triggering each loop on the list. I found the XY coordinates for a list of 8 samples with the window on the far right of my screen and came up with these inputs:
./click -x 1200 -y 370
./click -x 1200 -y 390
./click -x 1200 -y 410
./click -x 1200 -y 430
./click -x 1200 -y 450
./click -x 1200 -y 470
./click -x 1200 -y 490
./click -x 1200 -y 510
As you can see, each item is 20 pixels apart from the next. You can do this to figure out any number of samples to trigger as long as the whole list fits on the screen. Once you've figured this out, its time to bind the execution of the click application with a set of parameters to a keystroke.
Step 2: Setting Up Quicksilver
Quicksilver is a great little application for launching programs and executing commands. Its a must-have app for OS X powerusers so if you don't have it now this could be a good reason to learn how to use it, as it does have a bit of a learning curve. For our purposes, though, we'll just be using it bind different keystrokes to each way we'll execute the click application. Download and install Quicksilver, and run through the setup. On the recommended plugins screen make sure to check the Terminal plugin.
After setup is finished, use the command you setup to invoke Quicksilver (default is control + spacebar) and you should get a popup on your screen. Start typing "click" and the click application should show up. If it doesn't press the down arrow and scroll through the available documents until you find it. Then hit TAB. You should now have the second window highlighted, which should hopefully say Run [...]. If it doesn't, press down and scroll through the commands to until you find it. If you can't find it, you did not install the Terminal plugin correctly. Go to the dropdown menu at the top-right of the window and go to Plugins. In the resulting preference pane go to recommended plugins and ensure the Terminal plugin is checked.
If the Run [...] command comes up for you, then hit TAB once more to go to the third pane. Here you enter in the arguments for running click, so put in something like -x 1200 -y 390 . It should look like this when you've got it right.
If you hit enter or click execute, your mouse should leap to the position just like executing from the terminal. Now that you've figured out how to execute the command with Quicksilver, now you have to bind it to a trigger. Invoke the Quicksilver window (control + spacebar) and then click the button at the top-right of the window, and on the resulting drop-down select Triggers. You'll be presented with the Triggers preference pane.
As you can see, I have 8 triggers defined, one for each set of parameters I want to be able to invoke via keystroke. To create your own trigger, click the plus button on the bottom bar and select Hotkey. If everything goes well, the resulting window should have the first two panes already filled out with the click app and Run [...] command and all you need to do is fill in the third pane. If not, just set up the panes the same way you did on the normal quicksilver screen. It should end up looking something like this.
Once you've got that setup, hit save and the trigger should appear on the screen. To bind a keystroke to it, click the (i) icon on the bottom-right side of the window and a slide-out should appear. Go to the hotkey field and enter in the keystroke combination you want to use (I chose to use control + option + a number as my template as it is uncommon and hard to invoke accidentally). After that deselect On Press and select On Release (trust me, it works better). The preference pane should look something like this.
Now, when you hit your key combination (like control + option + 1 if you followed my template) the mouse should jump to the correct position. Repeat these steps for the rest of your triggers and you should be able to switch samples on the PinkyVST with just the keystrokes! Now, for the final step.
Step 3: Setup MidiStroke for MIDI-to-Keystroke Translation
The final step uses Dan Rodney's excellent and lightweight MidiStroke app in order to bind those newly-created keystroke combos you made to actual MIDI notes. Download and install the MidiStroke app to your machine and then open it up. You should see a simple screen that looks like this:
First thing, make sure to select the source of your MIDI data on the drop down at the bottom of the window. Then, click the plus button on the left side of the window to add a new MIDI control. As you can see from the screenshot, I started with a num 0 on channel 1, which is the C-2 note on the keyboard. Once you pick a MIDI control, go to the right-side pane and hit the plus button to add a new keystroke to bind to it. Just select the checkboxes that apply for the key modifiers you used and add the keystroke. You can add as many keystrokes to a MIDI control that you want, but for our purposes you should only need to add one. Repeat these steps for the rest of your triggers and you should have a fully-functional MIDI-triggered sample loading macro!
Conclusion & Request for the PinkyVST Developers
As I noted at the beginning of this how-to, this workaround is a bit of a sloppy hack. It gets the job done, but in a really roundabout way that isn't without its caveats:
1. Obviously, the PinkyVST window must be the topmost window at all times you want to trigger a sample change. Otherwise the macro will just drag & drop whatever is topmost in the position you set it to execute.
2. You can only setup triggers for as many samples that you can display on the PinkyVST file menu at one times. There is a way to setup groups of samples and switch between them like banks, though, and I might append this how-to with those details later.
PinkyVST Devs: Please, please, PLEASE add a keystroke command within PinkyVST to load a sample. I know MIDI triggering is giving you problems but this should really not be an issue to implement. A simple Return, control + L, or even control + shift + command + ~, whatever! This workaround would be 90% shorter and then the PC users could join in on the fun as well. I'll gladly rewrite this how-to on the event that you do this. I love all the work you've done and PinkyVST is a great plugin, but there is so much potential waiting to be tapped!
I hope this how-to helps those people looking for a way to shoe-horn midi triggering into the current PinkyVST build. If you have any questions, suggestions or problems, just ask and I'll see if I can help. Good luck!
PinkyVST is a great plugin for integrating vinyl control into your workflow for things like scratching samples while performing an Ableton Live set. However, the biggest feature missing is a way to load which sample to control via MIDI, like what you can do with the Reactor ensemble Ammobox. Apparently, MIDI control was attempted for the PinkyVST but constant problems resulted which kept the capability from being included in the release. This is a guide for a workaround I developed in order to hack in the capability. Due to the method in which samples are loaded (drag and drop), it isn't the cleanest method but it works very well and with little overhead. Unfortunately, this hack is MAC ONLY due to the tools used, but the same steps should work on a PC if you can find the right tools.
What You'll Need
PinkyVST
MidiStroke (A MIDI-to-Keystroke converter)
Quicksilver (For its ability to bind shell script execution to keystrokes)
Click (This is a custom app I wrote to perform the drag and drop)
Overview
Looking over the requirements list you might have figured it out, but basically what you'll be doing is creating a workflow to bind the execution of an app that performs the drag and drop necessary to load a sample in PinkyVST to a keystroke, and then binding that keystroke to a MIDI note. If you want you can stop right after the keystroke step is that is all you need, but for full-on MIDI triggering goodness I'd suggest going all the way.
Step 1: Setting up the Click App
Download the click application and put it wherever you find convenient (I put mine in my Documents folder). The application takes two arguments as its input: the X coordinate and the Y coordinate of where you want the click to occur. It takes these inputs and performs a downclick at that location, and then it drags 15 pixels to the right and then releases the button to perform the drop. So if you wanted it to do this action at 1200 pixels to the right and 390 pixels down from the top-left corner of your screen, you'd run the program like so:
./click -x 1200 -y 390
To try this out, just open up the Terminal application, navigate to where the click app is stored, and type out the command above and hit enter.
You should see your mouse jump to the right side of the screen. Pretty simple right? You can test out this command, changing up the X and Y parameters, with the PinkVST window open and in the location you'd want it to be in and figure out the exact XY inputs for triggering each loop on the list. I found the XY coordinates for a list of 8 samples with the window on the far right of my screen and came up with these inputs:
./click -x 1200 -y 370
./click -x 1200 -y 390
./click -x 1200 -y 410
./click -x 1200 -y 430
./click -x 1200 -y 450
./click -x 1200 -y 470
./click -x 1200 -y 490
./click -x 1200 -y 510
As you can see, each item is 20 pixels apart from the next. You can do this to figure out any number of samples to trigger as long as the whole list fits on the screen. Once you've figured this out, its time to bind the execution of the click application with a set of parameters to a keystroke.
Step 2: Setting Up Quicksilver
Quicksilver is a great little application for launching programs and executing commands. Its a must-have app for OS X powerusers so if you don't have it now this could be a good reason to learn how to use it, as it does have a bit of a learning curve. For our purposes, though, we'll just be using it bind different keystrokes to each way we'll execute the click application. Download and install Quicksilver, and run through the setup. On the recommended plugins screen make sure to check the Terminal plugin.
After setup is finished, use the command you setup to invoke Quicksilver (default is control + spacebar) and you should get a popup on your screen. Start typing "click" and the click application should show up. If it doesn't press the down arrow and scroll through the available documents until you find it. Then hit TAB. You should now have the second window highlighted, which should hopefully say Run [...]. If it doesn't, press down and scroll through the commands to until you find it. If you can't find it, you did not install the Terminal plugin correctly. Go to the dropdown menu at the top-right of the window and go to Plugins. In the resulting preference pane go to recommended plugins and ensure the Terminal plugin is checked.
If the Run [...] command comes up for you, then hit TAB once more to go to the third pane. Here you enter in the arguments for running click, so put in something like -x 1200 -y 390 . It should look like this when you've got it right.
If you hit enter or click execute, your mouse should leap to the position just like executing from the terminal. Now that you've figured out how to execute the command with Quicksilver, now you have to bind it to a trigger. Invoke the Quicksilver window (control + spacebar) and then click the button at the top-right of the window, and on the resulting drop-down select Triggers. You'll be presented with the Triggers preference pane.
As you can see, I have 8 triggers defined, one for each set of parameters I want to be able to invoke via keystroke. To create your own trigger, click the plus button on the bottom bar and select Hotkey. If everything goes well, the resulting window should have the first two panes already filled out with the click app and Run [...] command and all you need to do is fill in the third pane. If not, just set up the panes the same way you did on the normal quicksilver screen. It should end up looking something like this.
Once you've got that setup, hit save and the trigger should appear on the screen. To bind a keystroke to it, click the (i) icon on the bottom-right side of the window and a slide-out should appear. Go to the hotkey field and enter in the keystroke combination you want to use (I chose to use control + option + a number as my template as it is uncommon and hard to invoke accidentally). After that deselect On Press and select On Release (trust me, it works better). The preference pane should look something like this.
Now, when you hit your key combination (like control + option + 1 if you followed my template) the mouse should jump to the correct position. Repeat these steps for the rest of your triggers and you should be able to switch samples on the PinkyVST with just the keystrokes! Now, for the final step.
Step 3: Setup MidiStroke for MIDI-to-Keystroke Translation
The final step uses Dan Rodney's excellent and lightweight MidiStroke app in order to bind those newly-created keystroke combos you made to actual MIDI notes. Download and install the MidiStroke app to your machine and then open it up. You should see a simple screen that looks like this:
First thing, make sure to select the source of your MIDI data on the drop down at the bottom of the window. Then, click the plus button on the left side of the window to add a new MIDI control. As you can see from the screenshot, I started with a num 0 on channel 1, which is the C-2 note on the keyboard. Once you pick a MIDI control, go to the right-side pane and hit the plus button to add a new keystroke to bind to it. Just select the checkboxes that apply for the key modifiers you used and add the keystroke. You can add as many keystrokes to a MIDI control that you want, but for our purposes you should only need to add one. Repeat these steps for the rest of your triggers and you should have a fully-functional MIDI-triggered sample loading macro!
Conclusion & Request for the PinkyVST Developers
As I noted at the beginning of this how-to, this workaround is a bit of a sloppy hack. It gets the job done, but in a really roundabout way that isn't without its caveats:
1. Obviously, the PinkyVST window must be the topmost window at all times you want to trigger a sample change. Otherwise the macro will just drag & drop whatever is topmost in the position you set it to execute.
2. You can only setup triggers for as many samples that you can display on the PinkyVST file menu at one times. There is a way to setup groups of samples and switch between them like banks, though, and I might append this how-to with those details later.
PinkyVST Devs: Please, please, PLEASE add a keystroke command within PinkyVST to load a sample. I know MIDI triggering is giving you problems but this should really not be an issue to implement. A simple Return, control + L, or even control + shift + command + ~, whatever! This workaround would be 90% shorter and then the PC users could join in on the fun as well. I'll gladly rewrite this how-to on the event that you do this. I love all the work you've done and PinkyVST is a great plugin, but there is so much potential waiting to be tapped!
I hope this how-to helps those people looking for a way to shoe-horn midi triggering into the current PinkyVST build. If you have any questions, suggestions or problems, just ask and I'll see if I can help. Good luck!