that looks pretty cool, you mean http://en.wikipedia.org/wiki/Pawn_%2...g_language%29?
i only actually chose lua when i realised i needed something more dynamic than a simple config file format so hunted around for an embeddable interpreter. i hope lua was the right choice, i think the syntax is one of the simplest. i hadn't even heard of it until a few months ago.
also i love the fact that u can create functions on the fly... for example saying:
function floob(blah) ...
is only syntactic sugar for this:
floob = function(blah) ...
which means passing functions into functions is uber simple. this is *very* useful for midimasher so you can pass in actions to be run on events etc
tho you can also pre-define functions so u can pass in the same one multiple times. any function that takes a callback can also just take the name of the function as a string.Code:capture("traktor", "play_a", ALL, 0, function(d, e, v, p) if v > 0 then print "deck a has started" else print "deck a has stopped" end end)
11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
Originally Posted by derschaich
cheers lol i'll be testing the normal mode virtual midifighter code tonight anyway and also double checking a couple of things with the 4banks one.
of course the normal mode mf function is only really useful if u want to use a pre-existing tsi file with it. if not it's probably easier to just map 4x4 buttons within midimasher.
also the new twitch like functionality will also let u create any size grid where the top row (or anywhere i guess) is a toggle group for page selecting - and then u can use any midimasher function to map to those sub-pages. that bit of code works mostly - except for some led feedback/refresh.
11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
Originally Posted by derschaich
apc40 | ableton | ath-sj33
deviantART | SoundCloud | facebook
SKRILLEX IS THE BEST TECHNO DJ EVER!!! (╯°□°)╯︵ ┻━┻
cool i know world of warcraft uses lua for the gui or something. my better half is addicted to that but i can't see her coding any lua somehow
super knobs should be easy to implement. either using capture() to send out various events to traktor directly or as part of the setup for the controller you could make those faders fake the extra events and then use the pipe()/button()/capture()/etc with those as u would do any actual event coming in from the controller.
something like:
which would then add an extra event called "fader_foo" to the top half of a fader on an lpd8. i guess you'd want to do something more complex than that - but thats the theory anyway... (could be typo's there - i only just typed it into here)Code:capture("lpd8", "fader1", ALL, 0, function(d, e, v, p) if v == 63 then create("lpd8", "fader_foo", 0) elseif v == 127 then create("lpd8", "fader_foo", 127) end end)
create() basically just fakes input to a controller and it doesn't have to be limitted to the actual midi/events of the controller itself. in devices/traktor.lua there's a function that creates a "heartbeat_a" event from the beatphase monitor using create().
11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
Originally Posted by derschaich
How would I add CC data to pages 2 and 3? Just the code for a single momentary button on the top left square button of page 2/3 and I can fill out the rest.
I have a couple ideas for those pages
Using colors from one of zestoi's posts or the launchpad.lua in the devices folder. Commands are in traktor.lua in the same folder. Use 2 or 3 to define the page. :PCode:button("lp", "0,0", 2 or 3, on_color, off_color, "traktor", "command here")
Edit: So do you plan on adding those APC40 files I sent you to the next build, zestoi?
Last edited by Onimode; 10-11-2011 at 03:30 PM.
apc40 | ableton | ath-sj33
deviantART | SoundCloud | facebook
SKRILLEX IS THE BEST TECHNO DJ EVER!!! (╯°□°)╯︵ ┻━┻
yep - exactly here's another example too... as well as specifying a specific page (like 2) or for a control to be on all pages (by saying 0) you can also put a control on just some specific pages..
i suspect that 99% of the time you'd want something on one page or all pages, but you never know...Code:button("lp", "0,0", {2, 3}, on_color, off_color, "traktor", "command here")
of course this is exactly what i was hoping would happen - that people would help build up support for extra controllers it now has device support for the apc40 (thanks to you) and the mpd18 (thanks to austin) as well as the ones i own.Edit: So do you plan on adding those APC40 files I sent you to the next build, zestoi?
i'd also like to collect together more configs from users too as well as any useful extra functions to do stuff that i hadn't though of. i know it's all early days but feels like heading in the right direction now...
the theory is that people can extend it as much as they need - so long as the core code can support that. i'm still a bit shocked at how well the embedded lua seems to perform too...
11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
Originally Posted by derschaich
just thought of a an odd config... turning my real midifighter (running in normal mode) into a 4banks midifighter via midimasher...
open_midi_device("midifighter1", "generic", "MidiFighter1 Input", "MidiFighter1 Output")
open_midi_device("mfc", "midifighter", "Midi Fighter Classic", "Midi Fighter Classic", 4)
virtual_midifighter_4banks("mfc", 1, "midifighter1", 0, 0, ON, OFF)
not exactly all that useful in itself *but* it sets the midifighter up with 4 midimasher pages... and i can use some buttons on a different controller to change the page of the midifighter by calling set_page("mfc", page)
this means i could have a 4banks midifighter on page 1, a normal mode midifighter on page 2 and as many other pages for mapping anything else that i want.
i thought i might just have a single toggle button on my launchpad that changes the midifighter between pages 1 and 2, one with a 4banks tsi and the other with sample decks stuff or something...
11mba / 13mbp / tsp2 / live9 / audio10 / 2x reloop rp7000gold / 2x xdj1000 / 2x d2maschine mk2 / x1 mk2 / z1 / f1 / midifighter / lpd8 / 2x launchpad / launchkontrol xl
Originally Posted by derschaich
You have freed up my nanokontrol to take care of sample decks and loop recorder. Appreciate it a lot
|
Bookmarks