working Assembler memin workareound!!!

Post any examples or modules that you want to share here
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: working Assembler memin workareound!!!

Post by adamszabo »

So whats the advantage of using this method, than the wavetable reader cyto posted once on the SM forums? His seems to use less cpu according to my laptop.
Attachments
wavetable osc_2.fsm
(11.4 KiB) Downloaded 1146 times
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: working Assembler memin workareound!!!

Post by KG_is_back »

Well, I quite struggled with the actual code, so I'm aware the example is suboptimal.

This method has the advantage that you can create custom mem based components directly in assembly, that can read or/and write multiple values in a single cycle. That may greatly simplify and improve many algorithms. For example you can create stream FFT based components with no need for serialization ( =much less latency) and more optimal interpolation algorithms for wave readers and wavetable oscillators in a single assembler component.
And mainly: TRANSFER ARRAYS BETWEEN CODE COMPONENTS!
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: working Assembler memin workareound!!!

Post by tester »

FFT analyzer at 128 to 512kpts? :mrgreen:
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: working Assembler memin workareound!!!

Post by KG_is_back »

tester wrote:FFT analyzer at 128 to 512kpts? :mrgreen:


You can easily adjust trogs streamFFT to receive mem as input and output this way.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: working Assembler memin workareound!!!

Post by tester »

I other words you did the second half of impossible. :-)

For about 3 years I thought it's not possible to have high resolution FFT analyzer in SM/FS. So the only thing will be then to resample the output array according to some sort of zooming factor or do some sort of smart split (edges), before thigs get green, because FS greenery can handle relatively well arrays up to 16kpts.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: working Assembler memin workareound!!!

Post by KG_is_back »

Here a working example. I reworked trogs streamFFT to receive mem as input and output. The algorithm itself should work without problems (you may connect the "dummy" connectors just in case to maintain proper execution order). What keeps bugging is the analyzer primitive. Sometimes it adds random codelines to its code output and that messes up memory pointer extraction. If the schematic is not working look inside the mem to pointer modules and check if they generate the same code. If you find one with extra code lines delete it add new one and reconnect it.

I do not know what is the source of this bug (or even if it actually is a bug) and have no idea how to fix it.
Attachments
streamFFT mem based.fsm
(172.06 KiB) Downloaded 1173 times
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: working Assembler memin workareound!!!

Post by martinvicanek »

Wicked!! :ugeek: :ugeek:
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: working Assembler memin workareound!!!

Post by tester »

At this point, maybe it's a good idea to ask Malc if he can help, maybe something can be done in the FS core.

Is the code randomized, or these extra lines are additional? I.e. in which way? Maybe there is a way to filter these lines.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: working Assembler memin workareound!!!

Post by KG_is_back »

I'm still using FS 3.0.2 (firefly) so the problem might have been fixed already. If any of you experience it in newer versions I'll write a full report with print screens and contact Malc... Please test the mem to pointer module in your schematics and check if the problem is present on your schematics too. It seems to happen quite randomly especially on startup or when you copy-paste the M.t.P. module
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: working Assembler memin workareound!!!

Post by tester »

Hey KG.

I'm a little bit lost. Using trog's solution, I created somehow some time ago that little thing that allows precise spectral filtering (max resolution here is 32kpts, but that's enough for filtering). From what I can see - your solution eliminates many duplicated modules and thus - works faster. Could you see how to rework it onto your way?
Attachments
fft-ifft.fsm
(580.69 KiB) Downloaded 1181 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply