Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

tula's DSP modules

Post any examples or modules that you want to share here

Re: tula's DSP modules

Postby adamszabo » Wed Jan 17, 2018 10:33 am

By the way in martins exponential envelope posted by Spogg, there is an error in the assembly code on line 52 the last part its: addps xmm1,xmm41; the last should be "xmm4" and not "xmm41". I dont know if its there in the original code or it was added there later by accident.
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: tula's DSP modules

Postby Spogg » Wed Jan 17, 2018 1:20 pm

adamszabo wrote:By the way in martins exponential envelope posted by Spogg, there is an error in the assembly code on line 52 the last part its: addps xmm1,xmm41; the last should be "xmm4" and not "xmm41". I dont know if its there in the original code or it was added there later by accident.

OMG :o

I've made extensive use of this in pretty much all of my projects!
What are the consequences?

Cheers

Spogg
User avatar
Spogg
 
Posts: 3323
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: tula's DSP modules

Postby martinvicanek » Wed Jan 17, 2018 7:15 pm

adamszabo wrote:in martins exponential envelope posted by Spogg, there is an error

Thanks for spotting that, Adam!
@Spogg, the fact that it has remained unnoticed suggests that the impact is less than devastating. Indeed, the bug affects fast release - a feature that is not vital. What happens is that xmm41 is treated as an (undeclared!) variable not a 128 bit register. Often the value of xmm41 will be zero, however it is unpredictable and may in the worst case lead to freezing or crashing the plugin. So please synchronize paint all ADSR modules in each of your plugins and replace xmm41 by xmm4 in the ASM code.
REALLY SORRY! :oops:
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: tula's DSP modules

Postby martinvicanek » Wed Jan 17, 2018 7:43 pm

Spogg wrote:
martinvicanek wrote:Have fun!


I can't because I don't understand what you did there :?

Sorry about the cryptic post. What I did there was what Adam and KG had described: add and subtract some number to reduce bit depth. My modest contribution was to specify that magic number in terms of bit depth, which, btw, works for both positive and negative input. The staircase diagram was to show the quantization effect.

Here is a hopefully less confusing schematic.
Attachments
FastStreamBitcrusher(noASM).fsm
Revised Schematic
(3.25 KiB) Downloaded 980 times
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: tula's DSP modules

Postby tulamide » Wed Jan 17, 2018 10:13 pm

Hey Martin,

I'm aware that this is not on topic, but since we are already at it, would you please be so kind to give a hint about the relationship of the input numbers to sample rate and actual number of samples? I tried to find out on my own, but A and D (and R), although fed with the same number, are different in resulting times. D and R are probably 5+ times longer than A on max input (176k). Which rule applies?

(I'm talking of the ADSR :oops: )
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2687
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Exponential Decay

Postby martinvicanek » Thu Jan 18, 2018 4:39 am

Unlike linear decay, exponential decay is never really "done". So how can we assign a characteristic "decay time" in that case?

Consider the expression

a(t) = a0*exp(-t/T)

There is this time constant T which is a measure of how fast things change. If the decay continued at the initial rate, then it would be complete by the time t = T (dashed line in the image). Since the decay is exponential, however, at t = T the amplitude is still at roughly 37% of its initial value.
expoDecay.png
expoDecay.png (6.51 KiB) Viewed 21566 times

There are other possibilities to characterize exponential decay times. Some common examples are:
1. Half-life T_1/2 in radioactive decay. Obviously that time is shorter than T. The relation is T_1/2 ≈ 0.69*T
2. Decay to ten percent is after T_10% ≈ 2.3*T
3. In reverbs, it is common to state the time forthe reverb tail to drop to -60dB. Assuming an exponential law, that duration is T_60 ≈ 6,9*T

So you see, there is no unique definition.

My expo module has four inputs:
A: Attack, linear rise time in samples (rounded to a multiple of 16).
D: Decay, exponetial decay time T in samples (rounded to a multiple of 16). Note that decay is not to zero but to the sustainn level.
S: Sustain level, a number between 0 and 1.
R: Release, exponetial release time T in samples (rounded to a multiple of 16).

If yo prefer to supply seconds instead of samples, you can convert seconds to samples by multiplying the time in seconds by the sample rate.
Attachments
ADSR optimized expo.fsm
(7.8 KiB) Downloaded 1016 times
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: tula's DSP modules

Postby RJHollins » Thu Jan 18, 2018 6:54 am

Thank-you Martin. 8-)
RJHollins
 
Posts: 1568
Joined: Thu Mar 08, 2012 7:58 pm

Re: tula's DSP modules

Postby Spogg » Thu Jan 18, 2018 9:01 am

Back to Bit crushers :lol:

Here is the one I made for emulating vintage digital synths, taken right out of my ASS.
I’ve added a 4 bit mode for the demo.

Based on what I’ve seen here it ain’t too clever but it gets the job done.

Cheers

Spogg
Attachments
Bit crusher out of Spogg's ASS.fsm
(223.05 KiB) Downloaded 979 times
User avatar
Spogg
 
Posts: 3323
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: tula's DSP modules

Postby rocknrollkat » Thu Jan 18, 2018 11:21 am

Spogg wrote:Back to Bit crushers :lol:

Here is the one I made for emulating vintage digital synths, taken right out of my ASS.
I’ve added a 4 bit mode for the demo.

Based on what I’ve seen here it ain’t too clever but it gets the job done.

Cheers

Spogg


Getting the job done is what counts, dubious origins notwithstanding.

ROXY :D
User avatar
rocknrollkat
 
Posts: 213
Joined: Mon Jan 04, 2016 7:04 pm
Location: Oakland Gardens, New York City, U.S.A.

Re: Exponential Decay

Postby tulamide » Fri Jan 19, 2018 2:32 pm

martinvicanek wrote:Unlike linear decay, exponential decay is never really "done". So how can we assign a characteristic "decay time" in that case?

Consider the expression

a(t) = a0*exp(-t/T)

There is this time constant T which is a measure of how fast things change. If the decay continued at the initial rate, then it would be complete by the time t = T (dashed line in the image). Since the decay is exponential, however, at t = T the amplitude is still at roughly 37% of its initial value.
expoDecay.png

There are other possibilities to characterize exponential decay times. Some common examples are:
1. Half-life T_1/2 in radioactive decay. Obviously that time is shorter than T. The relation is T_1/2 ≈ 0.69*T
2. Decay to ten percent is after T_10% ≈ 2.3*T
3. In reverbs, it is common to state the time forthe reverb tail to drop to -60dB. Assuming an exponential law, that duration is T_60 ≈ 6,9*T

So you see, there is no unique definition.

My expo module has four inputs:
A: Attack, linear rise time in samples (rounded to a multiple of 16).
D: Decay, exponetial decay time T in samples (rounded to a multiple of 16). Note that decay is not to zero but to the sustainn level.
S: Sustain level, a number between 0 and 1.
R: Release, exponetial release time T in samples (rounded to a multiple of 16).

If yo prefer to supply seconds instead of samples, you can convert seconds to samples by multiplying the time in seconds by the sample rate.

Thank you Martin. I understand the problematic. With attack being linear, my first question has been answered instantly. The time advice is very important for me. Just to make sure, I'm not making a mistake:
If I would want an exponential decay towards sustain of 20 seconds (at 44.1 kHz), I'd pass 882000? Likewise, exponential release time 35 seconds, I'd pass 1543500?

Spogg
I had a look at your solution, and it is pretty much the same method I initially used. I just wonder why you have a maximum of 16 bits (32768), when Flowstone works with 32-bit floats? That means you alter the incoming signal even if no bit-reduction is chosen. But maybe that was never planned?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2687
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

PreviousNext

Return to User Examples

Who is online

Users browsing this forum: No registered users and 38 guests