tester wrote:Ehm, so... This "Get_Audio_Buffer_Size_DWB~2012.osm" should be connected inside cyto's "superScope.osm" somewhere?
At the moment, the size is hard-coded into Cyto's asm, so it needs a fair chunk of the code re-writing so that it can handle the different buffer sizes read by DWB's little gadget.
I imagine that also explains the difference when you switch to ASIO - your buffer size is probably different to the one that the code is made for (128 samples).
tester wrote:When we are at the graphs, I have another question. Is it possible to make using SM and ASM - an efficient FFT frequency viewer (and/or accurate freq peak finder)? Let say an equivalent of the resolution 0.336 to 0.084Hz at 44.1kHz and at some acceptable refresh rate?
A stream FFT is not impossible, I think, but very difficult - assembly in SM only supports a limited set of instructions, making nested arbitrary size loops tricky to code. For a really efficient FFT you would probably need to "unroll" a lot of the loops, making for a very large block of code (very easy to make a mistake, and very hard to de-bug).
High accuracy of frequency measurement and fast refresh (i.e. high accuracy of timing measurement) are, unfortunately, mutually contradictory due to the uncertainty principle. For greater frequency resolution it is always necessary to analyse a larger sample window containing more cycles of the waveform - this is also true of other frequency analysis techniques such as auto-correlation etc.
As an example, take a look at my "Funky Mountains" schematic
. Try playing some pitched sounds into it while changing the "Speed vs. Accuracy" parameter - as you raise the value, a greater number of samples are used in the analysis, and you will see the frequency peaks become much more defined. At low values, the display is less sluggish, but the frequency plot becomes almost meaningless. (NB. the schematic has a fixed semi-tone resolution).
The optimisations that make FFT (relatively) fast also rely on the window having a power-of-two number of samples - so there is little room for maneouvre when choosing a compromise of window size. The window size also determines the lowest frequency that can be reliably measured - the wavelength must fit inside the window (several times for a good analysis).
For peak frequency/pitch measurement, you can get around these limitations to a degree by using interpolation etc. when there are certain known conditions - e.g. the pitch is known to be within a particular frequency range etc. For a good example of this, take a look at Martin's Pitch Extraction
schematic. This uses auto-correlation to look for the discrete pitches of "concert tuned" semitones, folllowed by interpolation of adjacent frequency bands to find the degree of "pitch bend".