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 sp_TopicIcon
Book corrections forum
No permission to create posts
February 23, 2014
4:06 am
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

Do you have a place to put book corrections/suggestions?

Here's something I just caught:

Pg 234:
// enable/disable external FB soruce
void setUsesExternalFeedback(bool b) { m_bUseExternalFeedback = false; }

Oops! Of course, the intention is to pass b to the member var rather than set it false. I'm sure you've already found this (and its easy to catch as a reader of the book trying your code out), but figured I'd post it here in case not.

BTW, I just picked up your book a few days ago and I'm loving it. Fantastic book on plugin writing! Thanks for all the hard work!

February 23, 2014
4:32 am
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

Couple pages later (Pg 238), I also want to suggest a tiny change to the processAudioFrame function.

Basically, we should probably avoid doing a bunch of calculations if we're not going to use it.

I'd refactor the code to look more like (note: code formatting is messed up in the post....)

bool processAudio(float * pInputbuffer, float * pOutputBuffer, UINT uNumInputChannels, UINT uNumOutputChannels)
{
float xn =pInputBuffer[0];

// initialize yn to be xn upfront here
float yn = xn;

// only do math if this condition is met
if (m_fdelayInSamples > 0.0f)
{
// only need to change yn to buffer val if this condition is met
if (m_nReadIndex != m_nWriteIndex || m_fDelayInSamples >= 1.0f)
yn = m_pBuffer[m_nReadIndex];

// yada yada...

// now only need to override yn with interp result... no branch
yn = dLinTerp(0.0f, 1.0f, yn, yn_1, fFracDelay);
}

// do writes to buffer and output

}

February 23, 2014
6:24 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi mkelvin

There is an errata page (see sidebar) that I've gathered since publication which I think is reasonably complete.

And, yes the code in the book is purposefully verbose and un-optimized. For better or worse, many of my readers are new to C++ (like, they buy an intro to C++ book along with mine) and so the book code is very un-optimized (including circular buffers).

- Will

February 24, 2014
3:58 am
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

Ah yeah, I see the errata link now. Looks like my error is not listed in that errata list, so maybe you could add it. Probably hasn't been caught/noticed before because although you write the setter function for that bool, it's never used to set it (the future projects just set the bool directly). Could probably just delete the setter if the pattern is to just mess with the data directly.

I'll check there if I see anything else.

BTW, I'm loving your book, man. It's been a few years since I've done DSP/audio plugins and this book has been a fantastic refresher. Got it a few days ago and I'm burning through it. About to start into Ch10 this afternoon.

Also, absolutely loving the RackFX framework -- has everything I need to experiment with audio effects and none of the hassle. Even easier to use for rapid prototyping than JUCE (which is pretty awesome) or Max/PD. I was particularly blown away with the IR generation, preview, loading system. Brilliant idea!

February 24, 2014
5:39 am
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

Heh, found another error that I didn't see listed in the errata. This one is a bit harder to catch since it's not really an error, just something left out.

Pg 341, in the processAudioFrame() function, you have:

if (m_uLFOPhase == quad)
fDelay = calculateDelayOffset(fYqn);
else
fDelay = calculateDelayOffset(fYn);

That's great, except you haven't yet talked about m_uLFOPhase at this point in the book, so if you're following along (like me), you'll not have that enum defined.

Easy enough to fix (looking at your posted code, it looks like "normal", "quad", and "invert"), but figured I'd let you know about the book discrepancy if you ever do a reprint. Also, looks like "invert" is never used in your posted code, so maybe it should just be "normal" vs "quad"?

February 24, 2014
7:10 am
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

Guess this is my own little errata forum. Might as well post this one I just found that isn't listed in your errata page.

It's super simple, but again, figured I'd help out in case you make a future book version. Basically, you're missing the num output channels param:

Pg. 349
// call the processAudioFrame()
m_ModDelayLeft.processAudioFrame(&fLeftIn, &fChorusOut_L, 1);
m_ModDelayCenter.processAudioFrame(&fCenterIn, &fChorusOut_C, 1);
m_ModDelayRight.processAudioFrame(&fRightIn, &fChorusOut_R, 1);

Also, looks correct in the code download, so you probably already found this. If not, welp, there you go. :)

February 24, 2014
8:18 am
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

Ooh, found an error in non-code math not listed on the errata page.

Again, not a big deal but potentially confusing to math noobs...

Pg. 374, Eq 11.24
Your second line of math has a Y(z) in the third term on the left side of the equation... but you haven't yet distributed Y(z) yet.

You correct for it in the next line, so the end result looks right.

February 24, 2014
5:46 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Thanks for the diligence here! And, the downloadable code is all correct and error-free.

Just so you know, there was a major and abrupt change to the software (and code) at the last minute before publishing; if you poke around in the code or commenting, you may see the word "Socket" (the VST wrapper library is called Sock2VST) - the original name of RackAFX that I'd been using for years was "Socket" (what you plug a plug-into - get it?). But it turns out that "Socket Programming" is a whole other kind of network programming and would be potentially confusing (there are books on Socket Programming) so I had to change the SW and all the code literally a few weeks before the manuscript was due. This resulted in some discrepancies between the book and code which will be fixed in the 2nd Edition. When in doubt, check the code from the website.

All the best,
- Will

PS: thanks for the note about RAFX - a lot of people don't understand that the Analyzer's Freq/phase/step/impulse are the actual responses calculated on the fly as you move controls around. Or that no other SW lets you design FIR filters in real-time while listening to the results. BTW: email me with the contact form and you can get the Beta version which has a bunch of extended FFT capabilities (like windowing and ultra-high resolution FFT lengths up to 131072 points)

February 24, 2014
11:25 pm
Avatar
mkelvin
Member
Members
Forum Posts: 14
Member Since:
February 22, 2014
sp_UserOfflineSmall Offline

No problem -- was just going through the book and I figured I could help you out with errata as I came across.

Good idea on changing the name -- I have a little experience with network programming (wrote a simple C++ OSC implementation once) and would definitely have found the title confusing if seeing in a bookstore, "Socket Programming". Indeed, I did see the VST wrapper source files and seriously assumed it was networking related. I was like, "Oh... interesting... I guess he has winsock2 interprocess plugin API somewhere!" http://www.sockets.com/winsock2.htm

Re:IR stuff -- seriously *great* idea for software. Blows Matlab away for experimental FIR design and education. I love too the ability to capture your realtime IRs from any plugin and save them to play them through your own convolver (or whatever you want to use it for). Mind blown.

And it's free? Definitely going to be recommending your book and software to my academic friends for their DSP/audio classes.

February 25, 2014
7:25 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

LOL - no, I got my share of winsock torture in the early 90's trying to get a Netscape browser working during the dawn of the internet...

TIP: In the beta version of RackAFX you can use the FFT Analyzer/Scope with the audio line-in as a real-time spectrum analyzer/scope; I did this all last summer capturing FFTs and waveforms of hardware and software (iOS) synthesizers as well as evaluating anti-aliasing oscillators. This is especially useful with the new high resolution FFT and windowing - razor sharp spectral components. The ability to use the RTA with the audio line-in has been in RAFX since the beginning but I disabled it a few revs back with I was working on the IR -> Wave file feature. Currently, looking for a new RAFX revision in June, then a huge revision (in preparation for something new and cool) before school starts back in September.

All the best,
Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143