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

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

For general discussion related FlowStone

Re: AHDSR into an AHD

Postby R&R » Wed Aug 30, 2023 3:24 pm

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... :P

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)
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: AHDSR into an AHD

Postby martinvicanek » Wed Aug 30, 2023 8:07 pm

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.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: AHDSR into an AHD

Postby R&R » Wed Aug 30, 2023 8:53 pm

martinvicanek wrote:...unless you need zillions of them every sample.

dr-evil2.jpg
dr-evil2.jpg (56.51 KiB) Viewed 19005 times


Jokes aside... :P
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 :lol:

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 :D
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: AHDSR into an AHD

Postby R&R » Fri Sep 01, 2023 10:28 am

:P
Just converting some DSP to asm for practise...

Comparison_result.jpg
Comparison_result.jpg (140.44 KiB) Viewed 18961 times


Am I the only one this thick-skulled to get headaches from logic surrounding bitwise operations and masks? :roll: :lol:

Well, atleast now I understand the passed mask result to for example andps... :D
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: AHDSR into an AHD

Postby Tepeix » Sat Sep 02, 2023 12:15 pm

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 !)
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: AHDSR into an AHD

Postby Tepeix » Sat Sep 02, 2023 12:22 pm

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
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

Postby R&R » Sun Sep 03, 2023 12:06 am

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 :lol: Have to remove them. One step forward, two steps backwards :lol:

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 :D

And... changing the asm envelopes quickly became a bit to confusing for me at my current level of asm :lol: so for now, I settled on using copypaste altered DSP's/asm's and some selectors :D

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.
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: AHDSR into an AHD

Postby R&R » Sun Sep 03, 2023 11:50 am

Atleast the most important sounds can finally be realized with my next version...

Halfass Droid

:lol:
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: AHDSR into an AHD

Postby R&R » Wed Sep 13, 2023 6:17 pm

Me and ASM :roll: I can't even manage the simplest things it seems :lol:

I'm trying to add a reset to MV's noise.

Original noise asm...
Noise.jpg
Noise.jpg (73.34 KiB) Viewed 11205 times


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 :lol:

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 :D But nice guide nonetheless.
Attachments
MVs_Original_Noise.fsm
(1.04 KiB) Downloaded 343 times
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: AHDSR into an AHD

Postby Tepeix » Thu Sep 14, 2023 1:26 am

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 ???)
Attachments
Reset Random MV.fsm
(283.49 KiB) Downloaded 352 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 61 guests