I know a few people have been very keen to get involved with scripting. We’re getting close to the point we have just about killed off other issues and will be able to focus mostly on scripting environment. In the meantime some extra core functionality has been getting implemented that will make it really easy for us (a matter of a few minutes) to add new objects to scripting when necessary.
For example, here’s an example using the NoteTracker object which can tell you how many notes are currently pending (and which ones if you care)
This will be enhanced a little more so that you’ll be able to do AutoSustain, a technique where as long as you are holding more than one note down, new notes are added to the chord. When you release all notes, the chord sustains until you subsequently press a note in which case the previous chord is stopped and the new one starts. This is a mechanism that has been critical to me in both of my bands and I used to do it using MaxMSP – very happy to now have it work directly in Gig Performer
Also, here is the latest list of standard functions - growing rapidly every day
I finally had time to read the current function list. Very powerful functions and high level functionality for live purposes! I’ll do some tests in the next days.
One question about SendChordLater/SendChordNow: How is the midiMessage parameter used? I guess it contains the midi channel and velocity values for the chord notes to be sent…?
Assuming you have a MIDI In block called ‘foo’ that’s connected to your synth plugin, then you can write
var
foo : MidiInBlock
pcm : ProgramChangeMessage
pcm = MakeProgramChangeMessage(5) // Create a program change message
SendNow(foo, pcm) // Make the MidiInBlock foo send out the message to whatever it is connected
Having said this, the next update will have a new function called SelectPreset that can be used to set the preset of a synth plugin directly.
From memory it complained of an incompatible type which is why I thought the ProgramChangeMessage object was not a valid input to the SendNow() midiMessage parameter.
Is there an easy and clean way to create buttons without toggle functionality? I just thought about the case to have multiple trigger buttons “Piano”, “Organ”, “Clavinet” that are not connected to any plugin but are only handled by On WidgetValueChange callbacks (which create and send Program Change messages to some MidiInBlock).
I tried to set the max value of an LED button to 0 to see if behaves like I want, but this doesn’t work without assigning the widget to a plugin.
I’m not sure I understand the problem. You don’t have to associate a widget with a plugin to be able to use it from scripting. You can just create a widget, give it a scripting name, set up a callback and then do whatever you want from inside the callback.
For example, if you have an LED button widget called foo, you can write
var
foo : widget
on WidgetValueChange(newValue : double) from foo
Print (newValue)
end
Yes, I already did that (sucessfully). The only “problem” (it’s not really a problem) is that all button widgets we currently have are toggle controls so they have two state (on/off). That’s great for switching functionalities but it’s not perfect for single actions like “Send a program change” or “Play a chord” because when I click it it will change its state. It works, I just don’t want to switch the button on/off. That’s what I tried to avoid by trying to set the max value to 0…
function with no luck. Not sure if the code is wrong, or there’s a bug to log. Also, does the language support switch/case statements?
Cheers,
var wVB3Knob : Widget
var wVB3Name : Widget
var pVB3 : MidiInBlock
On WidgetValueChange (newValue : double) from wVB3Knob
var i : integer
// newValue represents a value between 0.0 and 1.0
i = Floor(30.0*newValue)
SelectPreset(pVB3, i)
if (i == 0) then
SetWidgetLabel(wVB3Name, "Preset #0")
else if (i == 1) then
SetWidgetLabel(wVB3Name, "Preset #1")
else
SetWidgetLabel(wVB3Name, "Preset #xx")
End
End
End
On WidgetValueChange (newValue : double) from W
var i : integer
// newValue represents a value between 0.0 and 1.0
i = Floor(30.0*newValue)
if (i == 0) then
SetWidgetLabel(W, "Preset #0")
else if (i == 1) then
SetWidgetLabel(W, "Preset #1")
else
SetWidgetLabel(W, "Preset #xx")