What's new

Lua resources for UVI Falcon scripting

You are trying to apply a C++ paradigm to something that is not implement at all like that.
wait is not similar to a thread wait. It waits an exact number of frame and slice the processing buffer to place your event at the exact position in the c++ code. It is way easier to code a sequencer like that than it is in c++ thanks to lua coroutine which are cooperative.
Think to those spawn as event that are placed in a timed event fifo handled in the audio thread which just substract the remaining sample to your deadline and call the lua call when it should have occured.
There is no c++ thread used to support this.
Doing an arp like the example I have sent is a bit more complicated in c++. Here it's just very simple especially for non coder and it's implemented behind the scene like you would have done in c++ using some kind of std::function in a scheduler based on elapsed frame in the audio thread

Hope this clarify things.
Olivier, a more in depth documentation of scripting in Falcon, of the available APIs and the limits vs traditional lua would be so very welcome!
 
A frame is just a sample in the buffer.

Give it a try and you will get the usage.
As I said previously, try to think outside of traditional programming with a buffer of events and you will see that spawn and wait make things way easier especially for house keeping.it’s way quicker to setup as well.
Don’t hesitate if you have practical question though.
 
Olivier, a more in depth documentation of scripting in Falcon, of the available APIs and the limits vs traditional lua would be so very welcome!
Limit with traditional lua is mostly file handling and system stuff, but besides this it’s mostly vanilla lua with a custom API dedicated to voice handling and other specific uvi engine function
 
Hey guys,
I just started using Falcon,love it and i'd like to do a very simple thing but Lua scripts is like Chinese to me,this is the first time i look at this language,i am not a programmer either,only a sound designer.
I'd like to have a script that generates a note on message on master play in Falcon and note off when stop is pressed,i'd only need 2 knobs,one to select the note and one to select the velocity.
Should be a very simple thing to script right?
Unless i can do this already without a script but haven't found a way.
This would be very useful for drones where i don't want to press a key each time to start it,juste the play would trigger it.
Thanks.
 
Hey guys,
I just started using Falcon,love it and i'd like to do a very simple thing but Lua scripts is like Chinese to me,this is the first time i look at this language,i am not a programmer either,only a sound designer.
I'd like to have a script that generates a note on message on master play in Falcon and note off when stop is pressed,i'd only need 2 knobs,one to select the note and one to select the velocity.
Should be a very simple thing to script right?
Unless i can do this already without a script but haven't found a way.
This would be very useful for drones where i don't want to press a key each time to start it,juste the play would trigger it.
Thanks.
I have a script in my repo that does exactly that. Check out "triggerCompiled.lua" that is in the "compiled/utils" folder. Activate autostart, and it will hold for as long as the transport is active. Let me know if you have any issues or questions about the script.

Note: You cannot set the velocity in this script (it defaults to 64). However, you can use another script to set the velocity: "compiled/util/noteVelocityCompiled.lua"
 
Last edited:
I have a script in my repo that does exactly that. Check out "triggerCompiled.lua" that is in the "compiled/utils" folder. Activate autostart, and it will hold for as long as the transport is active. Let me know if you have any issues or questions about the script.

Note: You cannot set the velocity in this script (it defaults to 64). However, you can use another script to set the velocity: "compiled/util/noteVelocityCompiled.lua"
Oh Thanks!
I first couldn't find it because i think i had an older version of your folder,redownloaded it and i have it now :)
Works well!
Thanks a lot.
 
Hey guys do you know of any sequencer,script in Falcon where you can record notes from the keyboard?
You can input notes in the arpegiator but step by step and there's a midi record script but too limited as you can't change anything afterward and no quantize,i'd like to input a sequence into a sequencer by playing with a keyboard ideally.
 
Hey guys do you know of any sequencer,script in Falcon where you can record notes from the keyboard?
You can input notes in the arpegiator but step by step and there's a midi record script but too limited as you can't change anything afterward and no quantize,i'd like to input a sequence into a sequencer by playing with a keyboard ideally.
I don't know any scripts like this, but it is a good idea. I'll let you know if I create one :)
 
I don't know any scripts like this, but it is a good idea. I'll let you know if I create one :)
Oh that would be great :)
I think that is the only thing missing in Falcon,for now it is more on the side of arps and generative stuff.
Just a simple polyphonic sequencer where you could loop a region and it would record whatever notes you play. In Reaktor i had done something like this,similar to your polyphonic sequencer and i could record from keyboard,voice one would go to sequencer 1,voice 2 to sequencer 2 and voice 3 sequencer 3. I don't know how Falcon handles voices though...
 
How do I access the attributes of elements in the Program hierarchy? In my script, all attributes return nil:
Code:
local Dahdsr1

function onInit()
    print("Initialising")
    Dahdsr1 = Program.modulations["DAHDSR 1"]
    if Dahdsr1.AttackTime ~= nil then
        print("Dahdsr1.AttackTime = " .. Dahdsr1.AttackTime)
    else
        print("Dahdsr1.AttackTime is nil.")
    end
    if Program.Name ~= nil then
        print("Program.Name = " .. Program.Name)
    else
        print("Even Program.Name is nil.")
    end
end
Here is the output when I test the script:
Initialising
Dahdsr1.AttackTime is nil.
Even Program.Name is nil.

If anyone wants to try out my script, add it to any program in the Organic Texture 2.8 folder of the Factory sound bank, such as BAS Biggy or PLK Zonophone.
 
Last edited:
How do I access the attributes of elements in the Program hierarchy? In my script, all attributes return nil:
Code:
local Dahdsr1

function onInit()
    print("Initialising")
    Dahdsr1 = Program.modulations["DAHDSR 1"]
    if Dahdsr1.AttackTime ~= nil then
        print("Dahdsr1.AttackTime = " .. Dahdsr1.AttackTime)
    else
        print("Dahdsr1.AttackTime is nil.")
    end
    if Program.Name ~= nil then
        print("Program.Name = " .. Program.Name)
    else
        print("Even Program.Name is nil.")
    end
end
Here is the output when I test the script:
Initialising
Dahdsr1.AttackTime is nil.
Even Program.Name is nil.

If anyone wants to try out my script, add it to any program in the Organic Texture 2.8 folder of the Factory sound bank, such as BAS Biggy or PLK Zonophone.
I'm going to answer my own question. Before I posted the question, I had actually tried the correct technique but unluckily tested it with Program's Name. That still did not work, though I don't actually need that data. Here's a fixed script.
Code:
local Dahdsr1

function onInit()
    print("Initialising")
    Dahdsr1 = Program.modulations["DAHDSR 1"]
    local attackTime = Dahdsr1:getParameter("AttackTime");
    if attackTime ~= nil then
        print("Dahdsr1.AttackTime = " .. attackTime)
    else
        print("Dahdsr1.AttackTime is nil.")
    end
    local programGain = Program:getParameter("Gain")
    if programGain ~= nil then
        print("Program.Gain = " .. programGain)
    else
        print("Program.Gain is nil.")
    end
    local programName = Program:getParameter("Name") -- This is nil
    if programName ~= nil then
        print("Program.Name = " .. programName)
    else
        print("Program.Name is nil.")
    end
end
Here's the output when I test the script:
Initialising
Dahdsr1.AttackTime = 0.039999987930059
Program.Gain = 0.70794570446014
Program.Name is nil.

My takeaway is that specific element types, such as DAHDSR, are not classes. They are represented by classes that derive from the Element base class. Therefore their parameters have to be accessed via functions of Element, such as getParameter.
 
Example Script Available:
Control a DAHDSR with macros (no script image GUI)

There are no examples in UVI-supplied sound banks of programs where macros on Falcon's standard Info Page control a DAHDSR's attack, decay, sustain and release. The problem is that Falcon does not provide a way to scale macro values (range 0 to 1) up to required parameter value maxima greater than one. The maxima for the DAHDSR's AttackTime, DecayTime and ReleaseTime parameters are 10, 30 and 20 seconds respectively. So UVI-supplied programs provide attack, decay, sustain and release knobs on image GUIs defined in scripts.

I have written a DAHDSR Controller script to control a program-level DAHDSR's attack, decay, sustain and release parameters with macros defined in the standard GUI, avoiding the need for a script-defined image GUI. This GitHub repository contains the script, together with a Falcon program that demonstrates the script's use.

This is the GUI of Tibetan Horns, the example Falcon program that contains the DAHDSR Controller script processor:
Tibetan Horns.png

To allow the macros to control the DAHDSR's parameters, there are ADSR knobs, as intermediaries, on the script processor itself (shown on Falcon's Events page):
DAHDSR Controller.png

These script processor knobs need to be configured to be modulated by the corresponding macros, like this:
Assign Macro to Knob.png

To make control of the DAHDSR's parameters by the macros more ergonomic, the script processor also has knobs to specify the maximum number of seconds that may be specified by the Attack, Decay and Release macros and knobs:
Max Seconds.png

For more documentation, please refer to the repository's README.
 
Last edited:
Oh that would be great :)
I think that is the only thing missing in Falcon,for now it is more on the side of arps and generative stuff.
Just a simple polyphonic sequencer where you could loop a region and it would record whatever notes you play. In Reaktor i had done something like this,similar to your polyphonic sequencer and i could record from keyboard,voice one would go to sequencer 1,voice 2 to sequencer 2 and voice 3 sequencer 3. I don't know how Falcon handles voices though...
I have an early alpha version of this ready now. It has record and quantize, but not any editing options yet. You can test it if you like, and I’ll let you know when a more complete version is ready.

 
I have an early alpha version of this ready now. It has record and quantize, but not any editing options yet. You can test it if you like, and I’ll let you know when a more complete version is ready.

Oh nice!
Seems to work well for now.
Would be nice to see an overview of the values,a row with the pitch,velocity,gate values on each step.
Looking forward to see how you develop it.
One cool thing would be after recording a sequence to be able to set different length to different parameters....like an 8 bar for the gate-trigger,6 bar to pitch values etc. Well the most important thing is to record and edit values but different lengths would be cool as an option to create polyrythms.
 
Is there a way to open the "ChipArp" Script and add your own arpeggios to it?

Any help or maybe some tips on re-programming my own would help :)
 
Is there a way to open the "ChipArp" Script and add your own arpeggios to it?

Any help or maybe some tips on re-programming my own would help :)
Unfortunately, the code files are not provided for those UVI-supplied scripts that you can add to your program in Falcon. Perhaps Olivier from UVI, who has been monitoring this thread, will be able to make the code for Chip Arp available, as he has previously done with at least one other script. Or you could ask UVI directly.

If you do get hold of the Chip Arp code and need help modifying it, get back to us on this thread and I expect people will be happy to assist.
 
Top Bottom