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

How to make this?

For general discussion related FlowStone

How to make this?

Postby Shoo » Sun Oct 09, 2011 8:08 am

My English is very poor, see picture please.
Attachments
pict1.jpg
pict1.jpg (15.66 KiB) Viewed 26122 times
Shoo
 
Posts: 33
Joined: Fri Sep 02, 2011 8:37 am
Location: Russia

Re: How to make this?

Postby DSP » Sun Oct 09, 2011 4:26 pm

The easiest way in FlowStone is to use the Graph module to sample the audio data into an array.

You can set the number of samples (ie. 1000) and use the trigger to start the data capture.

Once you have the array you can them analyse the data at your leisure.
Attachments
Audio Array.fsm
(5.95 KiB) Downloaded 1181 times
DSP
 
Posts: 150
Joined: Fri May 14, 2010 10:55 pm

Re: How to make this?

Postby Shoo » Mon Oct 10, 2011 6:16 pm

Thanks for you reply!
And see my schematic:
it is necessary to put in the Array1 ONLY samples appropriate to the "trigger1" signal.
How capture one sample on the "trigger1" signal?
Attachments
AudioArray2.fsm
(6.38 KiB) Downloaded 1147 times
Shoo
 
Posts: 33
Joined: Fri Sep 02, 2011 8:37 am
Location: Russia

Re: How to make this?

Postby Shoo » Fri Oct 21, 2011 11:12 am

Dear developers of FlowStone!
To solve this problem, please give at least one of these components:

Thanks!
Attachments
components.JPG
components.JPG (12.22 KiB) Viewed 26086 times
Shoo
 
Posts: 33
Joined: Fri Sep 02, 2011 8:37 am
Location: Russia

Re: How to make this?

Postby DSP » Fri Oct 21, 2011 4:11 pm

I see what you are trying to suggest but it isn't a solution. The Audio (Blue) and the Data (Green) are on different threads on the CPU. The Blue one is very accurate timing wise and high priority and the green one is low priority (100hz Max) so when you mix the two there is always a random timing variance based on how busy the PC is at that moment.

If you want to do something special then you are going to have to code it in the Code Component yourself or keep it in the Blue domain! What you are trying to do should be possible using the 'Mem' components.
DSP
 
Posts: 150
Joined: Fri May 14, 2010 10:55 pm

Re: How to make this?

Postby Shoo » Sat Oct 22, 2011 12:35 pm

How to work with 'Mem' inside Code Component?
Not a problem to put selected samples in the array inside Code Component.
But how to pass out, this array?
Shoo
 
Posts: 33
Joined: Fri Sep 02, 2011 8:37 am
Location: Russia

Re: How to make this?

Postby trogluddite » Mon Oct 24, 2011 1:06 pm

Hi,
Sadly there is no direct interface between arrays in code and the mem primitives. It seems that the dev's intended there to be one, as in older versions of SynthMaker the syntax checker allowed "memin Variable"/"memout Variable" as declarations - but this has never been implemented.
However, you can use a setup like the one pictured below to allow code to write to any chosen index of a mem primitive...
Write to mem.png
Write to mem.png (20.86 KiB) Viewed 26065 times

It looks a little odd, because the 'write' connection to the mem is one of the few that goes from right to left.
Also note the added M2F - this is required, as stream components are not processed unless they have a connection to the main outputs, or are converted back to green. The M2F just acts as a 'dummy' output to enable the processing of the 'Wave Write'.
If you don't see the 'Wave Write' primitives in your toolbox - go to 'Options->Advanced', and tick the box for 'Show R&D components'. I have used these primitives many time, and they seem perfectly stable, so don't let the "under development" warning worry you too much. (NB: I am a SynthMaker user, so I am assuming that FlowStone is the same in this respect).

You can then write the code such that the index pointer to the mem is only incremented on the transitions of your clock signal. You will just need to be careful of two things...
1) The mem cannot be resized dynamically - so you have to set the size of your data 'capture' in advance.
2) The 'Wave Write' will write a value for every sample (not just when the index changes), so you will need to hold the data value at the code output until the next clock transistion to make sure that it is not written over with an invalid value.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1727
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: How to make this?

Postby Shoo » Wed Oct 26, 2011 9:49 pm

trogluddite, thank you very much!
It's extremely interesting solution!

Please check up my new schematic. There are errors.

Why:
1) Float array is a twice (Two parts on sequential ticks "Create")
2) The memory is filled completely, instead of half
3) "Delete" not clear the Mem

Note.
The Clock slowly slides on Data (frequencies are different) and a samples drawing the sine.
Beginning of the data forced marked as 1.
The Code Component set the index only on clock, in 0 - 500 range.
Attachments
datamem_test.fsm
(11.32 KiB) Downloaded 1114 times
Shoo
 
Posts: 33
Joined: Fri Sep 02, 2011 8:37 am
Location: Russia

Re: How to make this?

Postby trogluddite » Fri Oct 28, 2011 1:23 pm

Hi there Shoo,
After a bit of fiddling, I managed to get things fixed reliably.

It turns out that the main problem was with the 'mem to Float Array' convertor - because it has no 'Green' inputs at all, it is not aware of when the contents of the array are changed, apart from when you force an update by disconnecting/re-connecting it.
I solved this using the 'mem to Min/Max' instead - this has a Green input pin for its 'Samples to Average over' input, which now gets triggered when the code outputs a 'Done' signal (After sampling is complete). Because the 'Min/Max' is set to average over one sample, it does not affect the output values at all, it is used purely to force an update of the array.
Sorry for that little oversight in my original post - I had never used the 'mem to Array' in a situation like this where the data gets updated on an 'arbitrary' basis.

Here's the schematic - as I am a SynthMaker user, the file is really an SM one, with the extension edited to '.fsm', but it should work OK, there are no 'SM only' parts in there.
How to Make This (SHOO).fsm
(8.31 KiB) Downloaded 1191 times


A couple of other points regarding your other questions...

- The size of a 'mem' is always fixed, it has no way to know the max index reached by the counter - hence your spurious data in the second half of the display; it is just a 'ghost image' of whatever memory contents happened to be in that space when the 'mem' got updated.
I've made a small change so that the 'mem' size matches the number of sample points - note that the 'mem' size is always in bytes, and each float sample requires 4 bytes (32bit data) - hence the multiplication of the size.
For a stereo 'mem', you would need to multiply by 8.

- Most of the other errors were caused simply by the array not updating properly, as noted above - so it was often not showing the real contents of the 'mem'.

- Be careful with the 'streambool' data type. There is a difference between 'Green' and stream (blue) boolean data that makes them incompatible.
For Green Boolean; False = 0, True = 1.
For stream boolean, the content is actually a bitmask; False = 0, True = 0xFFFFFFFF (i.e. All bits set, which is not a valid float number, it is only useful for using with the '&' operator for bitmasking.)
So, the streamboolin/out is really only intended for situations where you want to pass the raw bitmask between stream components to save having to use a lot of repeated (MyBoolVariable > 0) type comparisons.

NB) The code is slightly modified so that 'i1' is always the index, and 'datamarked' uses 'sample & hold' to retain triggered values. Your original code looked to be OK - I made the changes so that I could use readouts to check the values when I looked for the bug.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1727
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: How to make this?

Postby Shoo » Sat Oct 29, 2011 9:36 pm

Thank you very much!
It's a great! :)

It just that was required.
All works!

Best regards, Shoo.
:)
Shoo
 
Posts: 33
Joined: Fri Sep 02, 2011 8:37 am
Location: Russia

Next

Return to General

Who is online

Users browsing this forum: No registered users and 37 guests

cron