Page 1 of 2

mono to frame module question

Posted: Tue Dec 18, 2012 9:29 pm
by Dimmak01
I tried to deal with the mono to frame component module ( with number of samples to grab ), but without success... :?
So please post little example how to use it ( with ruby component desireble )! ;)

Re: mono to frame module question

Posted: Wed Dec 19, 2012 12:40 am
by Dimmak01
Solved.

Re: mono to frame module question

Posted: Wed Dec 19, 2012 1:01 am
by nix
that's pretty cool mate.
Now you can process the frames.
What are you planning to do to them?
edit- can we build a direct to disk recorder?

Re: mono to frame module question

Posted: Wed Dec 19, 2012 11:13 am
by TheAudiophileDutchman
Dimmak01 wrote:Solved.

Good to hear!

Just wondering whether this Is a universal solution or only suited for your own equipment...
For instance: what happens if the soundcard's driver latency is 128 samples and one would request 192 samples at once? (or am I misinterpreting the "output 192"?)

Re: mono to frame module question

Posted: Wed Dec 19, 2012 11:18 am
by TomC
TheAudiophileDutchman wrote:
Dimmak01 wrote:Solved.

Good to hear!

Just wondering whether this Is a universal solution or only suited for your own equipment...
For instance: what happens if the soundcard's driver latency is 128 samples and one would request 192 samples at once? (or am I misinterpreting the "output 192"?)


I guess you'll get 192 samples, each one with 128 samples delay ;-)

Re: mono to frame module question

Posted: Wed Dec 19, 2012 11:29 am
by TheAudiophileDutchman
Thanks for your swift response, TomC. Not sure if my message was formulated clearly enough though, so let me try to rephrase: In the given example I mean the case where the blocksize is 128 samples and then an unequal 192 samples are requested (i.e. not a multiple of 128). Would the total delay then become 256 samples :?:

Re: mono to frame module question

Posted: Wed Dec 19, 2012 1:03 pm
by admin
If you're wanting to process all the samples that come on a Mono stream then the way to do it is as shown below. This implements a simple delay effect. I've attached the schematic for you as well.

frames delay.jpg
frames delay.jpg (353.48 KiB) Viewed 28459 times


The Mono to Frames component will give you each buffer as it comes.

Your solution using the Mono to Graph will work if your buffer size is 192 but if you change it then you will get anomalies in the audio. Let's take the example TAD has suggested. If your audio card is set up to work with 128 sample frames then each time one of these is requested at the ASIO Out, you're grabbing the last 192 samples instead of the last 128. The ASIO Out will still only use the first 128 of these but because you grabbed 192 the start sample will not be correct - it'll be shifted back by 64 samples, hence the anomalies.

The Mono To Graph can be used instead of the Mono to Frames in this scenario if you use the Frame Sync component to supply the buffer size.

Mainly the Mono To Graph is used for analysing signals. It allows you to grab samples at lower than sampling rate and specify exactly how many samples you want too.

Re: mono to frame module question

Posted: Wed Dec 19, 2012 10:35 pm
by TheAudiophileDutchman
Thank you very much for this clear explanation, admin. 8-)

Re: mono to frame module question

Posted: Sat Dec 22, 2012 12:53 am
by rlr
BTW: what is that init method in the example above? When is it called? There is no mention in the manuals.

Re: mono to frame module question

Posted: Sat Dec 22, 2012 3:57 am
by nix
init is called when the file is opened AFAIK