Help for stopping individual clips with launchpad

Post Reply New Topic
RELATED
PRODUCTS

Post

Hey, I want to have different modes for live looping for my Launchpad Mini Mk2. I tinkered around with the V3 script by dplduffy so I have modes for selecting and deleting clips now, which is great. But I fail to implement a record/play/stop functionality for the standard mode. If a clip slot is empty or not playing I want to launch it else I want to stop it. Could someone help me with it?

The code looks like this at the moment:

Code: Select all

gridPage.onGridButton = function(row, column, pressed)
      var track = this.mixerAlignedGrid ? column : row;
      var scene = this.mixerAlignedGrid ? row : column;
      var t = trackBank.getTrack(track);
      var l = t.getClipLauncher();
[...]
		if (-->here I want to check if the selected clip is playing)
		{	
			l.stop();
		}
		else
		{
			l.launch(scene);
		}


Post

Any tips?

Post

Sorry I find it difficult to help with this and can see why Bitwig can't offer much support in these areas...

Maybe would be helpful if you listed the version of the API you are on. getClipLauncher() is depreciated in the API I use...

Do you have an observer/mark interested for isPlaying on the clip launcher?

For me i use the getClipLauncherbank() and have a callback tied to addIsPlayingObserver() and store off the the clip data that is playing.

I guess if you get the clipLauncherBank() then loop thru all the items in the bank, get the items using getItemAt(), then mark isPlaying() as interested... then in that if statement you'll actually be able to check the Boolean on that property).

Also to mark anything interested or adding observers must be done in init.

I hope that makes sense. I've only done the tutorials by Moss and that helped me understand most of this stuff.
---------------------------------------------------------------
http://kirkwoodwest.com/

Post

Thanks, that already helped a lot! I'm also relying on Moss' tutorials but I'm really not experienced with coding and time is rare. That leads to a lot of messy trial and error... But with these little adjustments to the script I'm so close to getting what I want and I've been trying different DAWs and plugins for more than a year. So it's totally worth it for me.

Of course, observers must be in init, I forgot, that's probably why they did not work. And since the script shows different colours according to the play state of clips such a thing has already been implemented - should have been obvious now that I think about it..
I will try this the next days.
If you're interested in the code, I forked dplduffy's script, but I still have to delete a lot of stuff that's not used by me...
https://github.com/TVbene/LaunchpadScriptV3/

Post

this is awesome!!glad i could be some help! its a dark world out here.


also im glad u are sharing it. this will help others customize their own scripts as well!
---------------------------------------------------------------
http://kirkwoodwest.com/

Post Reply

Return to “Controller Scripting”