Author |
Message |
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
Posted: Wed Apr 16, 2014 2:30 am Post subject:
HrastSVF 12dB/24dB |
|
|
Jan,
Attached is my combined 12dB/24dB State Variable Filter for WREN. Also, compared to the existing one, it can selfoscillate and has much better resonance characteristics, exponential filter cutoff modulation and a true drive/saturator built in.
Because SVF is 12dB by design, I used two serially connected 12dB modules (similar structure to the one in Tranzistow but non-ZDF version in this case, and very simplified). Each module has combined LP/BP/HP output (configurable through LP/BP/HP amounts) + there are individual LP/BP/HP/BR outputs from 12dB module.
Individual LP/BP/HP/BR outputs from 24dB module are not available because they don't have much sense in this design. I already developed a true 24dB SVF (Zero Delay Feedback version based on Linkwitz-Riley 24dB crossover structure) but it is not completely finished/tweaked yet and I am keeping it for Tranzistow or some of my future projects
Note: HrastOsc module on FormStore is my design which is different from the one in your WREN source, so don't copy the whole unit but only HrastSVF, ImageHrastSVF and MemoHrastSVF components from the form (and redesign them according to your requirements).
Filter parameters:
Freq ... Cutoff frequency
Q ... Resonance
Input + Gain ... Filter input
Drive ... Input drive amount (0 = no drive, 1 = total clipping)
FM Input + Amount ... Cutoff frequency modulation input (exponential)
QM Input + Amount ... Resonance modulation input
LP ... LowPass filter amount
BP ... BandPass filter amount
HP ... HighPass filter amount
12dB ... Combined 12dB LowPass/BandPass/HighPass output level
24dB ... Combined 24dB LowPass/BandPass/HighPass output level
Outputs:
LP/BP/HP/BR ... Individual 12dB LowPass/BandPass/HighPass/Notch outputs
12dB ... Combined 12dB LowPass/BandPass/HighPass output
24dB ... Combined 24dB LowPass/BandPass/HighPass output
Notes:
Individual outputs are always available and they don't depend on LP/BP/HP amounts or 12dB/24dB levels.
To get notch on 12dB/24dB outputs set LP=1, BP=0 and HP=1.
For selfoscillation some signal must be present at input. For example, set input gain to 0.01 and send some noise to the input.
Be careful with very high resonance values (over 0.9) when using 24dB output.
Description: |
|
Download |
Filename: |
HrastSVF.zip |
Filesize: |
76.71 KB |
Downloaded: |
540 Time(s) |
_________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Wed Apr 16, 2014 10:51 am Post subject:
|
|
|
I mean, that is great, and thank you!
I'm in the middle though of some big changes in how knobs work and all, some properties removed and renamed and different functions .. I'll try to get it in though .. it will need some hacking in the frm file to get it working _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri Apr 18, 2014 7:30 am Post subject:
|
|
|
Took a couple of hours .. but got it in ... no time to test it right now though, probably monday. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Mon Apr 21, 2014 8:32 am Post subject:
|
|
|
It works great!
Some more stuff to finish before I can release though. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Apr 29, 2014 1:50 pm Post subject:
|
|
|
It got released ... with quite a few other changes as well :-)
Updated the source package as well (beware, components changed quite a bit!). _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Wed Apr 30, 2014 10:38 am Post subject:
|
|
|
Yes, had tables before BTW, and then concluded it was not any faster, now changed back to tables and it actually is faster ... it is a bit hard to get good timing as the processor seems to be be floating its speed.
Anyway. that's not the only change I made after seeing your code - thanks for the hints :-) _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
Posted: Thu May 01, 2014 5:32 am Post subject:
|
|
|
I found a bug in the latest source ... Normal/Vintage button shouldn't be in KnobMap:
Code: |
procedure THrastOsc.SetDefaults;
begin
FInCache[HrastOsc_FMInput]:=0;
FInCache[HrastOsc_PMInput]:=0;
FInCache[HrastOsc_PWMInput]:=0;
FKnobmap:=[
HrastOsc_Freq,
HrastOsc_Morph,
HrastOsc_Shape,
HrastOsc_Bandlimit,
HrastOsc_PW,
HrastOsc_PWM,
HrastOsc_FM,
HrastOsc_PM,
HrastOsc_Vintage, // Should be removed!
HrastOsc_Level
]
end;
|
Otherwise it couldn't be turned off because dezipper tries to dezip it and the appropriate FInCache value never drops to zero. _________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Thu May 01, 2014 10:22 am Post subject:
|
|
|
Ok, overlooked that, thanks. Removed Vintage from the KnobMap for the necxt release.
Will look at your code too this evening. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Thu May 01, 2014 1:22 pm Post subject:
|
|
|
Ok, I see what you mean re. CPU usage, but that does not address the problem I'm having ... your numbers will be a bit lower as they only show audio processing.
When you hit F10 in Wren a HTML page will be generated with clock counts for all the modules, cables and some other stuff. It should open in your default browser, but if not the file is in a data sub directory of the main Wren directory.
The numbers in that table will vary wildly .. in general they seem to get lower when the program gets more CPU demanding (i.e. for larger patches).. also they seem to get lower after some time (many minutes or hours even?) ... and this is what makes it hard to compare different implementations. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
Posted: Wed May 07, 2014 9:51 pm Post subject:
|
|
|
Didn't have time to look into this before ...
I see what you're trying to achieve - to determine CPU usage for each module in the way it was done on Nord Modular. But, this is a very tricky job. On Motorola 56000 you could just look at instruction timings, count the cycles and that's it. On today's CPUs this is almost "mission impossible": multiple execution units, out-of-order execution, branch prediction, 3 levels of cache, etc., etc., not talking about Windows task switching and various background processes ... For example, the other day I managed to squeeze 1% of the CPU in Tranzistow just by rearranging some assembler code.
Blue Hell wrote: | The numbers in that table will vary wildly .. in general they seem to get lower when the program gets more CPU demanding (i.e. for larger patches).. also they seem to get lower after some time (many minutes or hours even?) |
I looked at CpuUsage unit and I think this is because you are using GetTickCount and Now functions. Both of them have the resolution of 1ms at best, so those small errors are accumulating over time. Try QueryPerformanceFrequency & QueryPerformanceCounter to see if it gets any better ...
A few remarks related to CPU power saving (if you have already done that then just ignore them):
(1) Intel SpeedStep (EIST) should be disabled in BIOS => This one really doesn't work well for realtime audio processing. You can keep various C-states enabled, but turn EIST off.
(2) Windows power plan should be set to "Max. performance" with minimum and maximum processor state set to 100%.
(3) It is recommended to disable hyperthreading in BIOS. _________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Thu May 08, 2014 10:28 am Post subject:
|
|
|
HrastProgrammer wrote: | I looked at CpuUsage unit and I think this is because you are using GetTickCount and Now functions. |
Nope, you didn't look
It does not use the Now function at all and it uses the GetTickCount function only to see if enough time passed to perform another usage query.
And apart from that those functions are not used for the profiling
Thanks for the recommendations tho .. might want to use that when I run out of time on a patch. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Thu May 08, 2014 1:35 pm Post subject:
|
|
|
It's cool Hrast - I understand.
Meanwhile I read up a bit on the subject, it's indeed not easy
Guess I will have to live with it more or less. Your recommendations should stabilize the readings, but taking time to let 'm settle seems to work reasonably good as well. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
hrastprogrammer
Joined: Oct 16, 2008 Posts: 261 Location: CPU
Audio files: 103
|
|
Back to top
|
|
|
|