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
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
AHDSR into an AHD
Re: AHDSR into an AHD
Spogg wrote:One example that comes to mind is when I made a polyphonic random value-per-note module in a synth and Adam showed me a much better way. Apart from being more elegant and simpler, it used much less CPU.
Do you or anyone else know if these kinds of ASM snippets are executed despite not having a connected output?
I'm still working on converting regular preset parameters into string parameters. But soon about to add a RandomMod section to my plugin...
Would I be able to have hundreds of them in my schematic (but "unconnected")?
I'm guessing rand() command is an underlying longer asm code?
So better to settle on an arbitrary small number of random generator ASM snippets? (no matter if perpetually connected and executed or not)
My beginner synth at KVR: https://www.kvraudio.com/product/saguaro-one-by-saguaro-one
- R&R
- Posts: 468
- Joined: Fri Jul 15, 2022 2:28 pm
Re: AHDSR into an AHD
ASM or stream code will not be executed if the output is dicsonnected.
In general, random number generation is cheap, unless you need zillions of them every sample.
In general, random number generation is cheap, unless you need zillions of them every sample.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: AHDSR into an AHD
martinvicanek wrote:...unless you need zillions of them every sample.
Jokes aside...
Thank you MV, this is good to know in advance... I'm still a bit divided whether to add a random generator to each possible destination, or just a bank of 8, 16, 32 or maybe 64.
Having access to the same random numbers across several destinations might be a benefit. My synth is a little bit of a test-platform. Lessons learned will be brought to my next synth, if there ever is one...
On another note...
I'm struggling right now to convert your ADSR and also AHDSR asm's (I guess they are yours?) back to linear
I know exactly what DSP lines are needed from the original toolbox DSP's to replace the dStep and rStep calc's.
But converting into comparative asm operators and having these limited registers is a pain. I do not know how you even do it!
Still, I'm gonna give it a few try's before giving up. I might actually learn something for once
My beginner synth at KVR: https://www.kvraudio.com/product/saguaro-one-by-saguaro-one
- R&R
- Posts: 468
- Joined: Fri Jul 15, 2022 2:28 pm
Re: AHDSR into an AHD
Just converting some DSP to asm for practise...
Am I the only one this thick-skulled to get headaches from logic surrounding bitwise operations and masks?
Well, atleast now I understand the passed mask result to for example andps...
My beginner synth at KVR: https://www.kvraudio.com/product/saguaro-one-by-saguaro-one
- R&R
- Posts: 468
- Joined: Fri Jul 15, 2022 2:28 pm
Re: AHDSR into an AHD
Yep it's sometime head breaker in asm.. Or mind game..
I had to keep a list of all the cmpps possible operation and also for the skip/jump.
CMPPS
0 ==
1 <
2 <=
3 unord
4 <>
5 >=
6 >
7 ord
But here the bit are maybe more easy than in other operation.
If the result of the cmpps is true, it's a boolean with all bit=1.
And all zero for false.
Now doing andps with true boolean and a value, all the bit 1 stay,
as 1and1=1 but 1and0=0
Yet genneraly i try to avoid cmpps. i prefer to use minps or maxps when possible.
Cmpps take generraly a lot of instruction, as we need a copy of a variable to make a boolean, then an andps.. But there's some situation where we absolutely need it..
Another "mind game" is the skip think.. I always invert..
Because we jump around and don't go for in most situation..
(For loop we go back)
Also you always need to be sure to have appropriate name for the jump.
If not flowstone will crash when you stop editing the code..
I also have a list note for this :
CMP eax :
jz jump if zero
jnz not zero
jl jump if less
jnl greater or equal
jg jump if greater
jng less or equal
(Don't remember where i find those list.. But thanks to the creator they helped me a lot !)
I had to keep a list of all the cmpps possible operation and also for the skip/jump.
CMPPS
0 ==
1 <
2 <=
3 unord
4 <>
5 >=
6 >
7 ord
But here the bit are maybe more easy than in other operation.
If the result of the cmpps is true, it's a boolean with all bit=1.
And all zero for false.
Now doing andps with true boolean and a value, all the bit 1 stay,
as 1and1=1 but 1and0=0
Yet genneraly i try to avoid cmpps. i prefer to use minps or maxps when possible.
Cmpps take generraly a lot of instruction, as we need a copy of a variable to make a boolean, then an andps.. But there's some situation where we absolutely need it..
Another "mind game" is the skip think.. I always invert..
Because we jump around and don't go for in most situation..
(For loop we go back)
Also you always need to be sure to have appropriate name for the jump.
If not flowstone will crash when you stop editing the code..
I also have a list note for this :
CMP eax :
jz jump if zero
jnz not zero
jl jump if less
jnl greater or equal
jg jump if greater
jng less or equal
(Don't remember where i find those list.. But thanks to the creator they helped me a lot !)
- Tepeix
- Posts: 361
- Joined: Sat Oct 16, 2021 3:11 pm
Re: AHDSR into an AHD
By the way, here's some tool or list i use regularly in asm.
The shufps helper by Infuzion really help a lot !)
The instruction list is maybe a little outdated but could help sometime.
There's also this excellent tutorial from KG that helped me a lot :
viewtopic.php?f=4&t=48865&p=151500&hilit=asm+tutorial#p151500
The shufps helper by Infuzion really help a lot !)
The instruction list is maybe a little outdated but could help sometime.
There's also this excellent tutorial from KG that helped me a lot :
viewtopic.php?f=4&t=48865&p=151500&hilit=asm+tutorial#p151500
- Attachments
-
- Asm helper (with cyto list and infuzion shufps).fsm
- (32.56 KiB) Downloaded 645 times
- Tepeix
- Posts: 361
- Joined: Sat Oct 16, 2021 3:11 pm
Re: AHDSR into an AHD
Thanks Tepeix I'll check the helper and tutorials out...
Added alot of change-prims to my plugin which doesn't play nice with my string-preset logic Have to remove them. One step forward, two steps backwards
I atleast managed to convert most DSP snippets to asm. Realized that some comparative logic actually works in Poly... but some only end up in NaN output
And... changing the asm envelopes quickly became a bit to confusing for me at my current level of asm so for now, I settled on using copypaste altered DSP's/asm's and some selectors
Reason i'm looking at changing envelopes to begin with... is to be able to for example have envelopes dynamically switchable between linear/exponential and also between ADSR and AHD without reloading schematics. The AHDSR should be able to be turned into both ADSR and AHD by altering inputs I guess, so that just leaves the linear/exponential modification.
Added alot of change-prims to my plugin which doesn't play nice with my string-preset logic Have to remove them. One step forward, two steps backwards
I atleast managed to convert most DSP snippets to asm. Realized that some comparative logic actually works in Poly... but some only end up in NaN output
And... changing the asm envelopes quickly became a bit to confusing for me at my current level of asm so for now, I settled on using copypaste altered DSP's/asm's and some selectors
Reason i'm looking at changing envelopes to begin with... is to be able to for example have envelopes dynamically switchable between linear/exponential and also between ADSR and AHD without reloading schematics. The AHDSR should be able to be turned into both ADSR and AHD by altering inputs I guess, so that just leaves the linear/exponential modification.
My beginner synth at KVR: https://www.kvraudio.com/product/saguaro-one-by-saguaro-one
- R&R
- Posts: 468
- Joined: Fri Jul 15, 2022 2:28 pm
Re: AHDSR into an AHD
My beginner synth at KVR: https://www.kvraudio.com/product/saguaro-one-by-saguaro-one
- R&R
- Posts: 468
- Joined: Fri Jul 15, 2022 2:28 pm
Re: AHDSR into an AHD
Me and ASM I can't even manage the simplest things it seems
I'm trying to add a reset to MV's noise.
Original noise asm...
Being reasonably short ASM. Looking at it I thought it would be a simple way to just squeeze in a few lines in there. Similar to sync's for oscillators.
But clearly I don't understand the fundamental workings of ASM
Maybe someone can help me, or point me in the right direction. "At best" I just ended up getting any value I replace xmm0 with as constant output
Btw wen't through KG's info documents. It goes from 0 to 100 pretty quickly But nice guide nonetheless.
I'm trying to add a reset to MV's noise.
Original noise asm...
Being reasonably short ASM. Looking at it I thought it would be a simple way to just squeeze in a few lines in there. Similar to sync's for oscillators.
- Code: Select all
// Any potential floats and stage0 additions excluded
movaps xmm1,sync //sync = polystream input;
cmpps xmm1,F0,6;
andps xmm0,initstate; //initstate = copy of state at stage0. In other words "cvtps2dq xmm0,seed;"
movaps state,xmm0;
But clearly I don't understand the fundamental workings of ASM
Maybe someone can help me, or point me in the right direction. "At best" I just ended up getting any value I replace xmm0 with as constant output
Btw wen't through KG's info documents. It goes from 0 to 100 pretty quickly But nice guide nonetheless.
- Attachments
-
- MVs_Original_Noise.fsm
- (1.04 KiB) Downloaded 343 times
My beginner synth at KVR: https://www.kvraudio.com/product/saguaro-one-by-saguaro-one
- R&R
- Posts: 468
- Joined: Fri Jul 15, 2022 2:28 pm
Re: AHDSR into an AHD
It's not so easy to do. Specially with the limited set of asm instruction of 3.6 version.
The problem is that you need to modify an int.. Then you could no more use addps, subps that are for float.
But in 3.6 when using paddd (the int add) we need to use a variable and not a register.
Not paddd xmm0,xmm1; but paddd xmm0,x; and no sub.. So it's complex to reset an int with a condition..
I find some way but they might exist better with more advanced version of flowstone.
Way1: use skip in asm, but it need to be done four time, as i suppose that you want to reset each voice independently..
Way2 is more experimental but seams to works.. We could not reset the int state to a value, but we could reset it to zero. Then we add the initial state0 every frame of the random process..
(But now maybe it's not really true random unless we use even number as seed ???)
The problem is that you need to modify an int.. Then you could no more use addps, subps that are for float.
But in 3.6 when using paddd (the int add) we need to use a variable and not a register.
Not paddd xmm0,xmm1; but paddd xmm0,x; and no sub.. So it's complex to reset an int with a condition..
I find some way but they might exist better with more advanced version of flowstone.
Way1: use skip in asm, but it need to be done four time, as i suppose that you want to reset each voice independently..
Way2 is more experimental but seams to works.. We could not reset the int state to a value, but we could reset it to zero. Then we add the initial state0 every frame of the random process..
(But now maybe it's not really true random unless we use even number as seed ???)
- Attachments
-
- Reset Random MV.fsm
- (283.49 KiB) Downloaded 352 times
- Tepeix
- Posts: 361
- Joined: Sat Oct 16, 2021 3:11 pm
Who is online
Users browsing this forum: No registered users and 61 guests