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
Dynamic memory for delay (size of bufer)
Avatar
sam
Member
Members
December 13, 2017 - 2:26 pm
Member Since: November 30, 2017
Forum Posts: 6
sp_UserOfflineSmall Offline

Hi ,

I am trying to understand how the delay plugin is build , so I want  to ask if we can use a dynamic memory where the buffer's size changes depending on delay's value(in samples), this way we just use the amount of memory needed.

Lets say user selects :delay_in_samples  749.7 samples ( 17 miliseconds at sample rate 44100) 

Buffer[delay_in_samples]

the size needed for this will be 749.7 .

 

Just want to understand , maybe this is already done on the book samples , let me know if i am wrong. 

thanks 

Avatar
W Pirkle
Admin
December 13, 2017 - 2:53 pm
Member Since: January 28, 2017
Forum Posts: 361
sp_UserOfflineSmall Offline

You don't want to do this. Calling the new and delete operators to re-size the delay line dynamically will hurt your CPU performance. You should not dynamically allocate resources during real-time audio processing. 

As described in the FX book, you should allocate enough storage for the maximum delay time your plugin supports during prepareForPlay( ) since it is sample-rate dependent. Then, you use only what is required from the user. 

- Will

Avatar
sam
Member
Members
December 13, 2017 - 3:07 pm
Member Since: November 30, 2017
Forum Posts: 6
sp_UserOfflineSmall Offline

W Pirkle said
You don't want to do this. Calling the new and delete operators to re-size the delay line dynamically will hurt your CPU performance. You should not dynamically allocate resources during real-time audio processing. 

As described in the FX book, you should allocate enough storage for the maximum delay time your plugin supports during prepareForPlay( ) since it is sample-rate dependent. Then, you use only what is required from the user. 

- Will  

Thank you Will .

 

 

Forum Timezone: America/New_York

Most Users Ever Online: 85

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

TheSmile: 43

Peter: 41

clau_ste: 39

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 578

Moderators: 1

Admins: 4

Forum Stats:

Groups: 12

Forums: 36

Topics: 594

Posts: 2374

Newest Members:

tomr, Noah, Dave, acv, Vasil992, Vasil92, dowsed, Simple, Chris_1, manyu

Moderators: W Pirkle: 361

Administrators: Tom: 73, JD Young: 80, Will Pirkle: 0, W Pirkle: 361