|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
SF.net SVN: supercollider: [7680] trunkRevision: 7680
http://supercollider.svn.sourceforge.net/supercollider/?rev=7680&view=rev Author: danstowell Date: 2008-07-12 15:46:36 -0700 (Sat, 12 Jul 2008) Log Message: ----------- Converted PlayBuf, RecordBuf, BufWr, BufRd, ScopeOut all to RTAlloc their pointers rather than using a hardcoded list of 16 - should allow them easi ly to handle massively multichannel audio/buffers. Modified Paths: -------------- trunk/Source/plugins/DelayUGens.cpp trunk/build/ChangeLog Modified: trunk/Source/plugins/DelayUGens.cpp =================================================================== --- trunk/Source/plugins/DelayUGens.cpp 2008-07-12 22:37:18 UTC (rev 7679) +++ trunk/Source/plugins/DelayUGens.cpp 2008-07-12 22:46:36 UTC (rev 7680) @@ -31,6 +31,7 @@ SndBufUpdates *m_bufupdates; float m_fbufnum; uint32 m_framepos, m_framecount; + float **mIn; }; struct PlayBuf : public Unit @@ -39,6 +40,7 @@ float m_prevtrig; float m_fbufnum; SndBuf *m_buf; + float **mOut; }; @@ -70,6 +72,7 @@ float m_prevtrig; float m_fbufnum; SndBuf *m_buf; + float **mOut; }; #endif @@ -77,12 +80,14 @@ { float m_fbufnum; SndBuf *m_buf; + float **mOut; }; struct BufWr : public Unit { float m_fbufnum; SndBuf *m_buf; + float **mIn; }; struct RecordBuf : public Unit @@ -92,6 +97,7 @@ int32 m_writepos; float m_recLevel, m_preLevel; float m_prevtrig; + float **mIn; }; struct Pitch : public Unit @@ -263,6 +269,7 @@ void PlayBuf_next_ka(PlayBuf *unit, int inNumSamples); void PlayBuf_next_kk(PlayBuf *unit, int inNumSamples); void PlayBuf_Ctor(PlayBuf* unit); + void PlayBuf_Dtor(PlayBuf* unit); void TGrains_next(TGrains *unit, int inNumSamples); void TGrains_Ctor(TGrains* unit); @@ -270,17 +277,21 @@ #if NOTYET void SimpleLoopBuf_next_kk(SimpleLoopBuf *unit, int inNumSamples); void SimpleLoopBuf_Ctor(SimpleLoopBuf* unit); + void SimpleLoopBuf_Dtor(SimpleLoopBuf* unit); #endif void BufRd_Ctor(BufRd *unit); + void BufRd_Dtor(BufRd *unit); void BufRd_next_4(BufRd *unit, int inNumSamples); void BufRd_next_2(BufRd *unit, int inNumSamples); void BufRd_next_1(BufRd *unit, int inNumSamples); void BufWr_Ctor(BufWr *unit); + void BufWr_Dtor(BufWr *unit); void BufWr_next(BufWr *unit, int inNumSamples); void RecordBuf_Ctor(RecordBuf *unit); + void RecordBuf_Dtor(RecordBuf *unit); void RecordBuf_next(RecordBuf *unit, int inNumSamples); void RecordBuf_next_10(RecordBuf *unit, int inNumSamples); @@ -369,6 +380,7 @@ void ScopeOut_next(ScopeOut *unit, int inNumSamples); void ScopeOut_Ctor(ScopeOut *unit); + void ScopeOut_Dtor(ScopeOut *unit); void Pluck_Ctor(Pluck* unit); void Pluck_next_aa(Pluck *unit, int inNumSamples); @@ -616,9 +628,19 @@ ClearUnitOutputs(unit, inNumSamples); \ return; \ } \ - float *out[16]; \ - for (uint32 i=0; i<numOutputs; ++i) out[i] = ZOUT(i); + if(!unit->mOut){ \ + unit->mOut = (float**)RTAlloc(unit->mWorld, numOutputs * sizeof(float*)); \ + } \ + float **out = unit->mOut; \ + for (uint32 i=0; i<numOutputs; ++i){ \ + out[i] = ZOUT(i); \ + } +#define TAKEDOWN_OUT \ + if(unit->mOut){ \ + RTFree(unit->mWorld, unit->mOut); \ + } + #define SETUP_IN(offset) \ uint32 numInputs = unit->mNumInputs - (uint32)offset; \ if (numInputs != bufChannels) { \ @@ -629,8 +651,18 @@ ClearUnitOutputs(unit, inNumSamples); \ return; \ } \ - float *in[16]; \ - for (uint32 i=0; i<numInputs; ++i) in[i] = ZIN(i+offset); + if(!unit->mIn){ \ + unit->mIn = (float**)RTAlloc(unit->mWorld, numInputs * sizeof(float*)); \ + } \ + float **in = unit->mIn; \ + for (uint32 i=0; i<numInputs; ++i) { \ + in[i] = ZIN(i+offset); \ + } + +#define TAKEDOWN_IN \ + if(unit->mIn){ \ + RTFree(unit->mWorld, unit->mIn); \ + } #define LOOP_BODY_4 \ @@ -723,11 +755,17 @@ unit->m_fbufnum = -1e9f; unit->m_prevtrig = 0.; + unit->mOut = 0; unit->m_phase = ZIN0(3); ClearUnitOutputs(unit, 1); } +void PlayBuf_Dtor(PlayBuf *unit) +{ + TAKEDOWN_OUT +} + void PlayBuf_next_aa(PlayBuf *unit, int inNumSamples) { float *ratein = ZIN(1); @@ -884,10 +922,16 @@ } unit->m_fbufnum = -1e9f; + unit->mOut = 0; ClearUnitOutputs(unit, 1); } +void BufRd_Dtor(BufRd *unit) +{ + TAKEDOWN_OUT +} + void BufRd_next_4(BufRd *unit, int inNumSamples) { float *phasein = ZIN(1); @@ -952,10 +996,16 @@ SETCALC(BufWr_next); unit->m_fbufnum = -1e9f; + unit->mIn = 0; ClearUnitOutputs(unit, 1); } +void BufWr_Dtor(BufWr *unit) +{ + TAKEDOWN_IN +} + void BufWr_next(BufWr *unit, int inNumSamples) { float *phasein = ZIN(1); @@ -983,8 +1033,9 @@ void RecordBuf_Ctor(RecordBuf *unit) { - uint32 numInputs = unit->mNumInputs - 7; \ + uint32 numInputs = unit->mNumInputs - 7; unit->m_fbufnum = -1e9f; + unit->mIn = 0; unit->m_writepos = (int32)ZIN0(1) * numInputs; unit->m_recLevel = ZIN0(2); unit->m_preLevel = ZIN0(3); @@ -1000,6 +1051,11 @@ ClearUnitOutputs(unit, 1); } +void RecordBuf_Dtor(RecordBuf *unit) +{ + TAKEDOWN_IN +} + void RecordBuf_next(RecordBuf *unit, int inNumSamples) { //printf("RecordBuf_next\n"); @@ -4922,10 +4978,16 @@ unit->m_fbufnum = -1e9f; unit->m_prevtrig = 0.; + unit->mOut = 0; unit->m_phase = ZIN0(2); ClearUnitOutputs(unit, 1); } + +void SimpleLoopBuf_Dtor(SimpleLoopBuf *unit) +{ + TAKEDOWN_OUT +} #endif //////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -5042,10 +5104,16 @@ unit->m_fbufnum = -1e9; unit->m_framepos = 0; unit->m_framecount = 0; + unit->mIn = 0; SETCALC(ScopeOut_next); } +void ScopeOut_Dtor(ScopeOut *unit) +{ + TAKEDOWN_IN +} + //////////////////////////////////////////////////////////////////////////////////////////////////////// struct PitchShift : public Unit @@ -7115,13 +7183,13 @@ DefineBufInfoUnit(BufChannels); DefineBufInfoUnit(BufDur); - DefineSimpleUnit(PlayBuf); + DefineDtorUnit(PlayBuf); #if NOTYET - DefineSimpleUnit(SimpleLoopBuf); + DefineDtorUnit(SimpleLoopBuf); #endif - DefineSimpleUnit(RecordBuf); - DefineSimpleUnit(BufRd); - DefineSimpleUnit(BufWr); + DefineDtorUnit(RecordBuf); + DefineDtorUnit(BufRd); + DefineDtorUnit(BufWr); DefineDtorUnit(Pitch); DefineSimpleUnit(BufDelayN); @@ -7151,7 +7219,7 @@ DefineDtorUnit(PitchShift); DefineSimpleUnit(GrainTap); DefineSimpleCantAliasUnit(TGrains); - DefineSimpleUnit(ScopeOut); + DefineDtorUnit(ScopeOut); DefineDelayUnit(Pluck); } Modified: trunk/build/ChangeLog =================================================================== --- trunk/build/ChangeLog 2008-07-12 22:37:18 UTC (rev 7679) +++ trunk/build/ChangeLog 2008-07-12 22:46:36 UTC (rev 7680) @@ -5,6 +5,7 @@ // HEADLINES: * 2008-04-20 improvements to MIDI sysex handling - added sysex parsing directly in source - thanks to charles picasso * 2008-07-12 scsynth on Mac can now use separate devices for audio input vs audio output. Thanks to Axel Balley for much of the work on this, also a bit by ds. +* 2008-07-12 PlayBuf, RecordBuf, BufWr, BufRd, ScopeOut - used to be limited to 16-channel audio maximum. Now can handle massively multichannel audio - ds // BUGFIXES: * 2008-05-20 fix for the special case when 0.2.asFraction beachballs the lang (bug id 1856972) - jr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ sc-dev mailing list info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880 archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/ search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/ |
|
|
Re: SF.net SVN: supercollider: [7680] trunkthanks for this! could you please check Dbufrd and Dbufwr too? I
don't remember whether they do multichannel at all though. >Revision: 7680 > >http://supercollider.svn.sourceforge.net/supercollider/?rev=7680&view=rev >Author: danstowell >Date: 2008-07-12 15:46:36 -0700 (Sat, 12 Jul 2008) > >Log Message: >----------- >Converted PlayBuf, RecordBuf, BufWr, BufRd, ScopeOut all to RTAlloc >their pointers rather than using a hardcoded list of 16 - should >allow them easi >ly to handle massively multichannel audio/buffers. > >Modified Paths: >-------------- > trunk/Source/plugins/DelayUGens.cpp > trunk/build/ChangeLog > >Modified: trunk/Source/plugins/DelayUGens.cpp >=================================================================== >--- trunk/Source/plugins/DelayUGens.cpp 2008-07-12 22:37:18 >UTC (rev 7679) >+++ trunk/Source/plugins/DelayUGens.cpp 2008-07-12 22:46:36 >UTC (rev 7680) >@@ -31,6 +31,7 @@ > SndBufUpdates *m_bufupdates; > float m_fbufnum; > uint32 m_framepos, m_framecount; >+ float **mIn; > }; > > struct PlayBuf : public Unit >@@ -39,6 +40,7 @@ > float m_prevtrig; > float m_fbufnum; > SndBuf *m_buf; >+ float **mOut; > }; > > >@@ -70,6 +72,7 @@ > float m_prevtrig; > float m_fbufnum; > SndBuf *m_buf; >+ float **mOut; > }; > #endif > >@@ -77,12 +80,14 @@ > { > float m_fbufnum; > SndBuf *m_buf; >+ float **mOut; > }; > > struct BufWr : public Unit > { > float m_fbufnum; > SndBuf *m_buf; >+ float **mIn; > }; > > struct RecordBuf : public Unit >@@ -92,6 +97,7 @@ > int32 m_writepos; > float m_recLevel, m_preLevel; > float m_prevtrig; >+ float **mIn; > }; > > struct Pitch : public Unit >@@ -263,6 +269,7 @@ > void PlayBuf_next_ka(PlayBuf *unit, int inNumSamples); > void PlayBuf_next_kk(PlayBuf *unit, int inNumSamples); > void PlayBuf_Ctor(PlayBuf* unit); >+ void PlayBuf_Dtor(PlayBuf* unit); > > void TGrains_next(TGrains *unit, int inNumSamples); > void TGrains_Ctor(TGrains* unit); >@@ -270,17 +277,21 @@ > #if NOTYET > void SimpleLoopBuf_next_kk(SimpleLoopBuf *unit, int inNumSamples); > void SimpleLoopBuf_Ctor(SimpleLoopBuf* unit); >+ void SimpleLoopBuf_Dtor(SimpleLoopBuf* unit); > #endif > > void BufRd_Ctor(BufRd *unit); >+ void BufRd_Dtor(BufRd *unit); > void BufRd_next_4(BufRd *unit, int inNumSamples); > void BufRd_next_2(BufRd *unit, int inNumSamples); > void BufRd_next_1(BufRd *unit, int inNumSamples); > > void BufWr_Ctor(BufWr *unit); >+ void BufWr_Dtor(BufWr *unit); > void BufWr_next(BufWr *unit, int inNumSamples); > > void RecordBuf_Ctor(RecordBuf *unit); >+ void RecordBuf_Dtor(RecordBuf *unit); > void RecordBuf_next(RecordBuf *unit, int inNumSamples); > void RecordBuf_next_10(RecordBuf *unit, int inNumSamples); > >@@ -369,6 +380,7 @@ > > void ScopeOut_next(ScopeOut *unit, int inNumSamples); > void ScopeOut_Ctor(ScopeOut *unit); >+ void ScopeOut_Dtor(ScopeOut *unit); > > void Pluck_Ctor(Pluck* unit); > void Pluck_next_aa(Pluck *unit, int inNumSamples); >@@ -616,9 +628,19 @@ > ClearUnitOutputs(unit, inNumSamples); \ > return; \ > } \ >- float *out[16]; \ >- for (uint32 i=0; i<numOutputs; ++i) out[i] = ZOUT(i); >+ if(!unit->mOut){ \ >+ unit->mOut = (float**)RTAlloc(unit->mWorld, >numOutputs * sizeof(float*)); \ >+ } \ >+ float **out = unit->mOut; \ >+ for (uint32 i=0; i<numOutputs; ++i){ \ >+ out[i] = ZOUT(i); \ >+ } > >+#define TAKEDOWN_OUT \ >+ if(unit->mOut){ \ >+ RTFree(unit->mWorld, unit->mOut); \ >+ } >+ > #define SETUP_IN(offset) \ > uint32 numInputs = unit->mNumInputs - (uint32)offset; \ > if (numInputs != bufChannels) { \ >@@ -629,8 +651,18 @@ > ClearUnitOutputs(unit, inNumSamples); \ > return; \ > } \ >- float *in[16]; \ >- for (uint32 i=0; i<numInputs; ++i) in[i] = ZIN(i+offset); >+ if(!unit->mIn){ \ >+ unit->mIn = (float**)RTAlloc(unit->mWorld, numInputs >* sizeof(float*)); \ >+ } \ >+ float **in = unit->mIn; \ >+ for (uint32 i=0; i<numInputs; ++i) { \ >+ in[i] = ZIN(i+offset); \ >+ } >+ >+#define TAKEDOWN_IN \ >+ if(unit->mIn){ \ >+ RTFree(unit->mWorld, unit->mIn); \ >+ } > > > #define LOOP_BODY_4 \ >@@ -723,11 +755,17 @@ > > unit->m_fbufnum = -1e9f; > unit->m_prevtrig = 0.; >+ unit->mOut = 0; > unit->m_phase = ZIN0(3); > > ClearUnitOutputs(unit, 1); > } > >+void PlayBuf_Dtor(PlayBuf *unit) >+{ >+ TAKEDOWN_OUT >+} >+ > void PlayBuf_next_aa(PlayBuf *unit, int inNumSamples) > { > float *ratein = ZIN(1); >@@ -884,10 +922,16 @@ > } > > unit->m_fbufnum = -1e9f; >+ unit->mOut = 0; > > ClearUnitOutputs(unit, 1); > } > >+void BufRd_Dtor(BufRd *unit) >+{ >+ TAKEDOWN_OUT >+} >+ > void BufRd_next_4(BufRd *unit, int inNumSamples) > { > float *phasein = ZIN(1); >@@ -952,10 +996,16 @@ > SETCALC(BufWr_next); > > unit->m_fbufnum = -1e9f; >+ unit->mIn = 0; > > ClearUnitOutputs(unit, 1); > } > >+void BufWr_Dtor(BufWr *unit) >+{ >+ TAKEDOWN_IN >+} >+ > void BufWr_next(BufWr *unit, int inNumSamples) > { > float *phasein = ZIN(1); >@@ -983,8 +1033,9 @@ > void RecordBuf_Ctor(RecordBuf *unit) > { > >- uint32 numInputs = unit->mNumInputs - 7; \ >+ uint32 numInputs = unit->mNumInputs - 7; > unit->m_fbufnum = -1e9f; >+ unit->mIn = 0; > unit->m_writepos = (int32)ZIN0(1) * numInputs; > unit->m_recLevel = ZIN0(2); > unit->m_preLevel = ZIN0(3); >@@ -1000,6 +1051,11 @@ > ClearUnitOutputs(unit, 1); > } > >+void RecordBuf_Dtor(RecordBuf *unit) >+{ >+ TAKEDOWN_IN >+} >+ > void RecordBuf_next(RecordBuf *unit, int inNumSamples) > { > //printf("RecordBuf_next\n"); >@@ -4922,10 +4978,16 @@ > > unit->m_fbufnum = -1e9f; > unit->m_prevtrig = 0.; >+ unit->mOut = 0; > unit->m_phase = ZIN0(2); > > ClearUnitOutputs(unit, 1); > } >+ >+void SimpleLoopBuf_Dtor(SimpleLoopBuf *unit) >+{ >+ TAKEDOWN_OUT >+} > #endif > > >//////////////////////////////////////////////////////////////////////////////////////////////////////// >@@ -5042,10 +5104,16 @@ > unit->m_fbufnum = -1e9; > unit->m_framepos = 0; > unit->m_framecount = 0; >+ unit->mIn = 0; > SETCALC(ScopeOut_next); > } > >+void ScopeOut_Dtor(ScopeOut *unit) >+{ >+ TAKEDOWN_IN >+} > >+ > >//////////////////////////////////////////////////////////////////////////////////////////////////////// > > struct PitchShift : public Unit >@@ -7115,13 +7183,13 @@ > DefineBufInfoUnit(BufChannels); > DefineBufInfoUnit(BufDur); > >- DefineSimpleUnit(PlayBuf); >+ DefineDtorUnit(PlayBuf); > #if NOTYET >- DefineSimpleUnit(SimpleLoopBuf); >+ DefineDtorUnit(SimpleLoopBuf); > #endif >- DefineSimpleUnit(RecordBuf); >- DefineSimpleUnit(BufRd); >- DefineSimpleUnit(BufWr); >+ DefineDtorUnit(RecordBuf); >+ DefineDtorUnit(BufRd); >+ DefineDtorUnit(BufWr); > DefineDtorUnit(Pitch); > > DefineSimpleUnit(BufDelayN); >@@ -7151,7 +7219,7 @@ > DefineDtorUnit(PitchShift); > DefineSimpleUnit(GrainTap); > DefineSimpleCantAliasUnit(TGrains); >- DefineSimpleUnit(ScopeOut); >+ DefineDtorUnit(ScopeOut); > DefineDelayUnit(Pluck); > > } > >Modified: trunk/build/ChangeLog >=================================================================== >--- trunk/build/ChangeLog 2008-07-12 22:37:18 UTC (rev 7679) >+++ trunk/build/ChangeLog 2008-07-12 22:46:36 UTC (rev 7680) >@@ -5,6 +5,7 @@ > // HEADLINES: > * 2008-04-20 improvements to MIDI sysex handling - added sysex >parsing directly in source - thanks to charles picasso > * 2008-07-12 scsynth on Mac can now use separate devices for audio >input vs audio output. Thanks to Axel Balley for much of the work on >this, also a bit by ds. >+* 2008-07-12 PlayBuf, RecordBuf, BufWr, BufRd, ScopeOut - used to >be limited to 16-channel audio maximum. Now can handle massively >multichannel audio - ds > > // BUGFIXES: > * 2008-05-20 fix for the special case when 0.2.asFraction >beachballs the lang (bug id 1856972) - jr > > >This was sent by the SourceForge.net collaborative development >platform, the world's largest Open Source development site. > >_______________________________________________ >sc-dev mailing list > >info (subscribe and unsubscribe): >http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880 >archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/ >search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/ -- . _______________________________________________ sc-dev mailing list info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880 archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/ search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/ |
|
|
|
| Free Forum Powered by Nabble | Forum Help |