Dynamic memory for delay (size of bufer) | FX Book Questions | Forum

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
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
Admin
December 13, 2017 - 2:53 pm
Member Since: January 29, 2017
Forum Posts: 689
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
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: 152

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 1

Members: 768

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 842

Posts: 3347

Moderators: W Pirkle: 689