On Thu, Apr 26, 2012 at 1:54 PM, zestoi <[email protected]> wrote:
> the mapping in live is quite good for simple things. may well be enough for
> a lot of users. there should also really be a simpler way of using modifier
> states for shifted controls than resorting to javascript. the scripting used
> in vdj for example is oddly powerful for the syntax needed.
I disagree here, VDJ's syntax is horrible and the language itself is
probably not very feature complete. I know that is not as relevant for
normal (or even most power users), but no reason to re-write our own
just for that. The Javascript engine is actually a part of Qt.
One solution to make the syntax for scripts easier would be to use
CoffeeScript which compiles into JS.
Some Examples of CoffeeScript versus JavaScript:
CoffeeScript:
# Assignment:
number = 42
opposite = true
# Conditions:
number = -42 if opposite
# Functions:
square = (x) -> x * x
# Arrays:
list = [1, 2, 3, 4, 5]
# Objects:
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
# Splats:
race = (winner, runners...) ->
print winner, runners
# Existence:
alert "I knew it!" if elvis?
# Array comprehensions:
cubes = (math.cube num for num in list)
Javascript:
var cubes, list, math, num, number, opposite, race, square,
__slice = [].slice;
number = 42;
opposite = true;
if (opposite) {
number = -42;
}
square = function(x) {
return x * x;
};
list = [1, 2, 3, 4, 5];
math = {
root: Math.sqrt,
square: square,
cube: function(x) {
return x * square(x);
}
};
race = function() {
var runners, winner;
winner = arguments[0], runners = 2 <= arguments.length ?
__slice.call(arguments, 1) : [];
return print(winner, runners);
};
if (typeof elvis !== "undefined" && elvis !== null) {
alert("I knew it!");
}
cubes = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = list.length; _i < _len; _i++) {
num = list[_i];
_results.push(math.cube(num));
}
return _results;
})();
It's just a thought.
Another option would be to include a UI in the MIDI mapper that
resembles traktor's modifier system which generates Javascript, but
that could lead to all sorts of problems if a user were to modify the
script then try to fix it in the UI later.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel