Author |
Message |
hrastprogrammer

Joined: Oct 16, 2008 Posts: 252 Location: CPU
Audio files: 64
|
Posted: Mon Mar 31, 2014 3:06 am Post subject:
HrastOsc |
 |
|
OK, I decided to go with PolyBLEP because DPW doesn't work very well with FM/PM. Attached are spectrum screenshots of the regular saw oscillator and HrastOsc, both at 440Hz (WREN is running at 44.1kHz samplerate)
It will be a combined saw/pulse/ramp oscillator. Bandlimiting is configurable so you can achieve even less aliasing at the cost of loosing some brightness.
I have yet to correct a few things and then I'll send you the source ...
Description: |
|
Filesize: |
29.29 KB |
Viewed: |
460 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |

|
Description: |
|
Filesize: |
24.74 KB |
Viewed: |
508 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |

|
_________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Mon Mar 31, 2014 5:41 am Post subject:
|
 |
|
Looks like you broke the mirror
What do you use to make such nice spectrum plots? _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
hrastprogrammer

Joined: Oct 16, 2008 Posts: 252 Location: CPU
Audio files: 64
|
|
Back to top
|
|
 |
hrastprogrammer

Joined: Oct 16, 2008 Posts: 252 Location: CPU
Audio files: 64
|
Posted: Mon Mar 31, 2014 10:13 am Post subject:
|
 |
|
OK, attached is the oscillator source. I had to modify FrmStore (THrastOsc module layout) and FrmMain (module creation, just look for BOHM/EOHM tags = Begin/End of Hrast's Modifications, it will work in the absence of the version control).
Oscillator parameters:
Freq ... Frequency of the oscillator
Morph ... Morphing between saw and pulse waveform
PW ... Pulse width (doesn't affect saw waveform e.g. when Morph=0)
Shape ... Internal oscillator waveshaping, for saw waveform acts like lowpass filter (more or less), for pulse waveform morphs between pulse and ramp/triangle
Note: Some level readjustment is usually needed when playing with Shape
FM Input + Amount ... Frequency modulation input (exponential)
PM Input + Amount ... Phase modulation input (linear, that's what Yamaha calls "Frequency Modulation")
PWM Input + Amount ... Pulse width modulation input
B-Limit ... Oscillator bandlimiting (0 = Off, 1 = Normal, 2..4 = High, and everything in between)
Level ... Oscillator output level
Sync Input ... Resets oscillator phase to zero on transition from less-or-equal 0 to greather-than 0
Normal/Vintage Button ... The oscillator waveform looks, well, more "vintage" when activated
Mute Button ... Mutes the output
BTW #1, I am an old-school Pascal programmer and don't like unnecessary blanks around operators and ; before end etc.
BTW #2, you have the following row twice in DPR:
Application.CreateForm(TFormWaveDeviceSelect, FormWaveDeviceSelect);
BTW #3, in the DPROJ file there is a reference to an icon outside the project directory:
<Icon_MainIcon>..\_logo\wren_02\wren.ico</Icon_MainIcon>
Description: |
|
 Download (listen) |
Filename: |
HrastOsc.zip |
Filesize: |
98.4 KB |
Downloaded: |
523 Time(s) |
_________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
 |
hrastprogrammer

Joined: Oct 16, 2008 Posts: 252 Location: CPU
Audio files: 64
|
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Mon Mar 31, 2014 11:34 am Post subject:
|
 |
|
Wow, thanks!
Didn't listen yet, need to eat and then do some tax stuff first ... but did get the code in, and did see it executes pretty efficient indeed!
Old style indeed well I will not touch your HrastUnit.
I did modify the module layout a bit to make it have the same size title bar as all other modules .. so things had to be shifted a bit, and may shift a bit more later on.
And thanks for your remarks .. yes Delphi fucks up the dpr from time to time, and I had not looked in while. Will get the icon into the project folder too.
Code: |
// BOHM
4000 .. 4999 : Result := HrastUnit.CreateModule( aType, aParent, aName, anInputCount);
// EOHM
|
You seem to have plans?  _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Mon Mar 31, 2014 11:41 am Post subject:
|
 |
|
Oh .. a mistake .. will need to check what file I got. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Mon Mar 31, 2014 4:39 pm Post subject:
|
 |
|
Tax site was a bit overloaded ... managed to get the stuff in in about 40 minutes before the deadline. after two hours of timed out sessions and hundreds of page reloads and error 3630 stuff ... after that we had some server trouble here as well ...
more fun tomorrow I hope  _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
hrastprogrammer

Joined: Oct 16, 2008 Posts: 252 Location: CPU
Audio files: 64
|
Posted: Mon Mar 31, 2014 9:08 pm Post subject:
|
 |
|
Blue Hell wrote: | Old style indeed well I will not touch your HrastUnit. |
You can reformat this unit according to your style if needed, just wait that all bugs are cleared out.
Quote: | And thanks for your remarks .. yes Delphi fucks up the dpr from time to time |
Yes. I am still developing in Delphi 7 when possible because everything after that added more and more various crap of questionable usability + more and more bugs.
There is even more junk in DPROJ:
Code: |
<DCCReference>
<Form>,
scala in 'scala.pas',
Rationals in 'Rationals.pas';
{$R *.res</Form>
</DCCReference>
<DCCReference>
|
Quote: | You seem to have plans?  |
I could make some more modules in the future but I certainly don't need 1000 module IDs And you can assign different range if you think it is appropriate ... _________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
 |
hrastprogrammer

Joined: Oct 16, 2008 Posts: 252 Location: CPU
Audio files: 64
|
Posted: Mon Mar 31, 2014 10:31 pm Post subject:
|
 |
|
I corrected a few things in regard to "vintage" mode - updated source is reattached.
Please, look at how I implemented UnitsToFrequency conversion for HrastOsc. Your implementation is executing Power(2,Something) for each oscillator/LFO/SVF/etc. and for each sample - this is very CPU consuming, especially when working at 96kHz (which is, I suppose, the target sample rate for WREN because it is clearly inspired by Nord Modular). My implementation uses interpolated lookup table and maybe you can consider to use the similar approach in your UnitsToFrequency function (and the other functions which use Power). The same with Sin, SinCos, etc.
BTW, I noticed a quirk with knobs ... When you set knob Value property to zero it reverts to 0.5 after reloading the form/project. Didn't have time to look into knobs sources so I set Value properties for all knobs on the module to 1e-9 for now. _________________ https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/ |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Tue Apr 01, 2014 2:35 am Post subject:
|
 |
|
Funny .. I actually had lookup tables and then tried to use the functions directly instead and they were faster ... so I got rid of the tables. Will look at it again, the profiling I used at the time was no good.
The knobs thingie you mention is something with defaults being different from what is set in constructor .. the fix will be public in the next release (it got irritating on the 6 x 6 mixer). There are some more issues with knobs and values ... but then again there are more issues all over the place ... I only have so much time  _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Tue Apr 01, 2014 12:14 pm Post subject:
|
 |
|
Getting some nice sounds from this now  _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24423 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Tue Apr 01, 2014 1:45 pm Post subject:
|
 |
|
I've published a new version having the oscillator in, and some other stuff done as well. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
|