Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Multi-channel Buffer Processing with pluginBase.cpp
Avatar
sanketVxT
New Member
Members
June 15, 2020 - 6:41 am
Member Since: June 15, 2020
Forum Posts: 1
sp_UserOfflineSmall Offline

So, I found a way to modify code in pluginBase.cpp to perform buffer processing instead of frameProcessing in pluginCore.cpp using ASPiK.
But my question is, is it possible to do buffer processing with a static/weird buffer size like 192 while the processBufferInfo.numFramesToProcess could be either higher or lower than it?

Thanks.Confused

Avatar
W Pirkle
Admin
June 19, 2020 - 11:04 am
Member Since: January 29, 2017
Forum Posts: 462
sp_UserOfflineSmall Offline

To do buffer processing, I recommend overriding processAudioBuffers( ) in the PluginCore; the PluginBase file could potentially change in the future (and it will need to, in a minor way, for the new Synth Book I am writing). 

If you look in the PluginCore.h file, you will see that this function is prototyped, but it is commented out. Uncomment it, and then implement it in the .cpp file (using the base version as a template). If you do this, then the pluginbase version will never be called, and you will be immune to future changes to the base SDK files. 

My new Synth Book and synth plugins all do block processing by default as it is much more efficient in the Synth paradigm (it is for FX as well, but not as noticeable). 

For my block processing version, I break the incoming buffer into blocks that are sized for the plugin. If a block comes in that is smaller than I need, or I have a partial or "incomplete" buffer, I go ahead and process the smaller block as it only happens sporadically, and is not in my control - the host DAW controls that.

If your plugin requires a certain block size, which is not uncommon for FFT based code where you absolutely must process exact sizes, then you need to do more work to deal with partial or incomplete buffers, and you need to "sew them together" across the processAudioBuffer( ) calls, so that you are always delivering an exact size to your processing objects. Of course, this can be tricky because you need to declare a temporary but persistent array (buffer) to store incomplete blocks. 

In addition, you will need the temporary storage buffers for every channel your plugin processes. The block processing and temporary buffer issues have been around forever so you will probably find code that you can adapt.

Will 

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 632

Moderators: 1

Admins: 4

Forum Stats:

Groups: 13

Forums: 40

Topics: 667

Posts: 2597

Newest Members:

VariableCook, Henry, Adekoya Adams, WillAMR, weedshop, Gennaro Schiano, HOA, sanketVxT, sem1307, djd_oz

Moderators: W Pirkle: 462

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 462