What to use for PSingle?
-
woodslanding
- Member
- Posts: 1327
- Contact:
I have a script based on the simple audio example script from v5. But it requires some values of type PSingle.
V6 does not recognize this type. What do I use instead? There are no audio example scripts that I can see in the new browser....
V6 does not recognize this type. What do I use instead? There are no audio example scripts that I can see in the new browser....
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
PSingle is a pointer type, and to me it seems that pointer types aren't allowed in the new version (so far?). Using ^Single instead of the predefined PSingle type didn't help. GetDataPointer() is also missing.
Here's an attempt at doing the old audio example in a different way:
This works, but uses a lot CPU.
I tried the same in V5, and there both versions of the script worked, and both used negligible CPU.
Here's an attempt at doing the old audio example in a different way:
Code: Select all
/////////////////////////////////////////////
// Audio Volume
// Simple Audio Volume Script
////////////////////////////////////////////
// parameters declaration
var input : Tparameter;
var output : Tparameter;
var gain : TParameter;
// initialisation : create parameters
procedure init;
begin
Input := CreateParam('In',ptaudio);
output := CreateParam('out',ptaudio);
gain := CreateParam('gain',ptDataFader);
SetIsOutPut(Input,false);
SetIsOutPut(Gain,false);
SetIsInPut(Output,false);
SetMin(gain,0);
SetMax(gain,1);
Setvalue(gain,1);
SetLength(output,BLOCSIZE);
end;
// Global variables
var i : integer;
//var pin,pout : PSingle;
var g : single;
//////////////////////////////
// main proc
//////////////////////////////
procedure Process;
begin
//pIn := GetdataPointer(0);
//pOut := GetdataPointer(1);
g := GetValue(2);
for i := 0 to BLOCSIZE-1
do begin
//pout^:= pin^*g;
//incptr(pin);
//incptr(pout)
SetDataArrayValue(1, i, GetDataArrayValue(0, i)*g);
end;
end;I tried the same in V5, and there both versions of the script worked, and both used negligible CPU.
Bjørn S
Because of the cross platform implementation (WIN,OSX,64) we use a new script engine which is less CPU friendly.
That's why the the V5 script-pointers capabilities are not available in Hollyhock.
No solution actually except rewrite a new script engine and it could take years...
But we made a particular effort to simplify the SDK. A user module is a very good option for intensive data manipulations?
That's why the the V5 script-pointers capabilities are not available in Hollyhock.
No solution actually except rewrite a new script engine and it could take years...
But we made a particular effort to simplify the SDK. A user module is a very good option for intensive data manipulations?
Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
woodslanding
- Member
- Posts: 1327
- Contact:
Okay, that's good to know. I'll lay off the scripts. And I'll look into the SDK.
But for now, I realized my script doesn't need to work in the audio path anyway, it can just create a control signal for a volume module.
But I may just use modules anyway if the script engine is not cpu friendly. I mostly did it to save CPU!
cheers,
-e
But for now, I realized my script doesn't need to work in the audio path anyway, it can just create a control signal for a volume module.
But I may just use modules anyway if the script engine is not cpu friendly. I mostly did it to save CPU!
cheers,
-e
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
-
woodslanding
- Member
- Posts: 1327
- Contact:
Wow, no joke!
A simple midi change channel script takes ..33% on my quad-core i7!
16 of those, that's 5% CPU just to change midi channels.
Seems like a set of basic midi tools would be a good use for the SDK. Or nice to have as basic modules....
I'll see if it's cheaper to convert to and from midi using modules.
EDIT: that brings it down by about half. Guess that's the better choice.
A simple midi change channel script takes ..33% on my quad-core i7!
16 of those, that's 5% CPU just to change midi channels.
Seems like a set of basic midi tools would be a good use for the SDK. Or nice to have as basic modules....
I'll see if it's cheaper to convert to and from midi using modules.
EDIT: that brings it down by about half. Guess that's the better choice.
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
I replaced some midi scripts with the midi transformer and my patch became 50% more efficient.
Thanks for the tip!
Thanks for the tip!
check also the Midi multi-filter
Olivier Sens
www.brainmodular.com
www.brainmodular.com
slowly I'll replace all midi scripts by modules which are 100x faster
Olivier Sens
www.brainmodular.com
www.brainmodular.com
Who is online
Users browsing this forum: No registered users and 24 guests
