jamoma / JamomaCore

Jamoma Frameworks for Audio and Control Structure
Other
36 stars 14 forks source link

SampleRate is not properly copied from TTBuffer to TTSampleMatrix #196

Closed nwolek closed 10 years ago

nwolek commented 10 years ago

When you set the sampleRate for a TTBuffer and then checkOutMatrix(), the resulting TTSampleMatrix does not have the same sampleRate. Discovered while working on #193.

nwolek commented 10 years ago

TTBuffer gives different results for these two methods, but they should be the same:

setSampleRate(value); setAttributeValue("sampleRate", value);

Unfortunately this means I need to re-open the issue.

nwolek commented 10 years ago

OK, the problem resulted from trying to override the getter/setter methods for SampleRate on TTBuffer. This is apparently not permitted and will lead to the irregularities that I observed.

Preferred method is to use the addUpdates() macro found here: https://github.com/jamoma/JamomaCore/blob/master/Foundation/library/includes/TTMessage.h#L37

The method is called whenever the attribute of the parent class is changed. There is even a note there about using it with sample rate changes.

I've learned my lesson. Should have a fix pushed momentarily.