COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 10-26-2020, 05:39 AM   #1
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 221
Default Audio sampler and right buffering

I want to make a sampler. How do I send the packages correctly to ProcessDoubleReplacing ?
I tried to read from the audio file packets by 896k. The problem is that during the period when the audio sample buffer is read, time passes, this delays ProcessDoubleReplacing output and gaps appear when playing audio.

It is possible to send only a part of samples and send a message to the host that only a part of the sampleblock was sent? Does SetLatency (partial_samplesblock) do that? Something like
Code:
SetLatency(samplesblock);
for (int s=0; s < samplesblock; ++s) {
	if (pos_counter>=buf_start+buf_size) {			
		SetLatency(s);
		readBuf();
		break;
	}
	// process samples from buffer here 
}
Unfortunately the above code still introduce gaps on the audio output.
__________________
Audio VST plugins http://vst.saschart.com

Last edited by SaschArt; 10-26-2020 at 09:52 AM.
SaschArt is offline   Reply With Quote
Old 10-28-2020, 04:45 PM   #2
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 13
Default

Maybe l'm reading this wrong, but, are you reading an audio file during playback? While l haven't ventured into sampling myself, l'm guessing that any samples should be stored as arrays when the plugin/app loads..
Ric Vega is offline   Reply With Quote
Old 11-01-2020, 06:13 AM   #3
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 333
Default

There's definitely plugs out there that can stream data direct from the disk!
Bobflip is offline   Reply With Quote
Old 11-01-2020, 08:50 AM   #4
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,150
Default

Yeah, but they probably read from disk into a buffer in a worker thread, and only read/play this buffer in the main audio thread, so the audio thread doesn't read directly from disk.
Tale is offline   Reply With Quote
Old 11-11-2020, 03:07 AM   #5
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 221
Default

Quote:
Originally Posted by Tale View Post
Yeah, but they probably read from disk into a buffer in a worker thread, and only read/play this buffer in the main audio thread, so the audio thread doesn't read directly from disk.
Yes, that's right. In the meantime, I found the optimal values for the buffer that does not enter gaps. With this optimization all sample blocks are sent.

Ric Vega what you say it's not a solution to play large files.
__________________
Audio VST plugins http://vst.saschart.com
SaschArt is offline   Reply With Quote
Old 11-11-2020, 05:19 PM   #6
bozmillar
Human being with feelings
 
bozmillar's Avatar
 
Join Date: Sep 2009
Posts: 609
Default

I feel like dfd file streaming sort of died out when people started getting lots of ram. I'm pretty sure kontakt doesn't even bother with it anymore. It just loads everything into memory. That way you don't have to worry about slow or flaky hard drives messing up your playback.
__________________
http://www.bozdigitallabs.com
bozmillar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.