-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,6 +368,10 @@ void Faust_Ctor(Faust* unit) // module constructor | |
{ | ||
// allocate dsp | ||
unit->mDSP = new(RTAlloc(unit->mWorld, sizeof(FAUSTCLASS))) FAUSTCLASS(); | ||
if (!unit->mDSP) { | ||
Print("Faust_Ctor: RT memory allocation failed for unit->mDSP\n"); | ||
return; | ||
} | ||
|
||
// init dsp | ||
unit->mDSP->instanceInit((int)SAMPLERATE); | ||
|
@@ -398,12 +402,24 @@ void Faust_Ctor(Faust* unit) // module constructor | |
SETCALC(Faust_next); | ||
} else { | ||
unit->mInBufCopy = (float**)RTAlloc(unit->mWorld, unit->getNumAudioInputs()*sizeof(float*)); | ||
if (!unit->mInBufCopy) { | ||
Print("Faust_Ctor: RT memory allocation failed for unit->mInBufCopy\n"); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
return; | ||
This comment has been minimized.
Sorry, something went wrong.
nhthn
|
||
} | ||
// Allocate memory for input buffer copies (numInputs * bufLength) | ||
// and linear interpolation state (numInputs) | ||
// = numInputs * (bufLength + 1) | ||
unit->mInBufValue = (float*)RTAlloc(unit->mWorld, unit->getNumAudioInputs()*sizeof(float)); | ||
if (!unit->mInBufValue) { | ||
Print("Faust_Ctor: RT memory allocation failed for unit->mInBufValue\n"); | ||
return; | ||
} | ||
// Aquire memory for interpolator state. | ||
float* mem = (float*)RTAlloc(unit->mWorld, unit->getNumAudioInputs()*BUFLENGTH*sizeof(float)); | ||
if (mem) { | ||
Print("Faust_Ctor: RT memory allocation failed for mem\n"); | ||
return; | ||
} | ||
for (int i=0; i < unit->getNumAudioInputs(); ++i) { | ||
// Initialize interpolator. | ||
unit->mInBufValue[i] = IN0(i); | ||
|
@@ -431,6 +447,9 @@ void Faust_Ctor(Faust* unit) // module constructor | |
Print(" Generating silence ...\n"); | ||
SETCALC(Faust_next_clear); | ||
} | ||
|
||
// Fix for https://github.com/grame-cncm/faust/issues/13 | ||
ClearUnitOutputs(unit, 1); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
|
||
void Faust_Dtor(Faust* unit) // module destructor | ||
|
3 comments
on commit 413ff48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source file use here : https://github.com/grame-cncm/faust/blob/master-dev/architecture/supercollider.cpp
Since I'm not a SuperCollider expert at all, it would be much easier if you could directly correct our supercollider.cpp architecture file, and do a merge request? (even "blind" changes would be OK, I can test the result before merging)
Thanks in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry! I realize that what I'm doing here is kind of inconsiderate. I'll file a PR soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may check this commit 073a90e
Might be better to provide the name of the UGen so the source of the error is more obvious. Also, I suggest adding the text "Try increasing the real-time memory size in the server options."