I have a Pd patch with 3 separate signals and I want to sequentially weave the signals together so instead of having three separate signals I create 1 large signal that is created by weaving 3 signals together.
Example: (note: the commas are just used as separators and I used letters, numbers, and symbols to help differentiate the signals) *signal_1 array* is *A,B,C,D,E* *signal_2 array * is *1,2,3,4,5* *signal_3 array * is *@,#,%,&,(*
The completed weaved signal to playback would look like this *A,1,@,B,2,#,C,3,%,D,4,&,E,5,(* I've attached an image along with the Pd file that I hope helps explains this.
I've placed each signal into their own separate array in Pd but I'm not sure how to sequentially "weave" the signals together. Any ideas? Thanks
What comes to my mind is to write the three signals on three new arrays which are three times the size of the original ones. These arrays would have each sample from the original signal zero-padded by two samples. That can be done by reading the original signals with tabread~ at a rate which is 1/3 of the initial one (hence repeating each sample three times) and multiply that by a function which is 1 every three samples (the first sample should be 1). That, for example, could be a phasor~ with a period of three samples followed by a [<~ 1/3] (it can be implemented with a max~, -~, and /~). (44.1kHz SR seems to be too tight; use 48kHz.) Of course, you'll need to sync all the phasors and writers involved with a bang. The resulting signal could then be obtained by summing the three arrays, delaying the second by 1 sample, and the third one by 2 samples.
I hope it works.
D
http://dariosanfilippo.tumblr.com
On Mon, 25 Mar 2019 at 19:00, RT ratulloch@gmail.com wrote:
I have a Pd patch with 3 separate signals and I want to sequentially weave the signals together so instead of having three separate signals I create 1 large signal that is created by weaving 3 signals together.
Example: (note: the commas are just used as separators and I used letters, numbers, and symbols to help differentiate the signals) *signal_1 array* is *A,B,C,D,E* *signal_2 array * is *1,2,3,4,5* *signal_3 array * is *@,#,%,&,(*
The completed weaved signal to playback would look like this *A,1,@,B,2,#,C,3,%,D,4,&,E,5,(* I've attached an image along with the Pd file that I hope helps explains this.
I've placed each signal into their own separate array in Pd but I'm not sure how to sequentially "weave" the signals together. Any ideas? Thanks
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I have a Pd patch with 3 separate signals and I want to sequentially weave the signals together so instead of having three separate signals I create 1 large signal that is created by weaving 3 signals together.
Example: (note: the commas are just used as separators and I used letters, numbers, and symbols to help differentiate the signals) *signal_1 array* is *A,B,C,D,E* *signal_2 array * is *1,2,3,4,5* *signal_3 array * is *@,#,%,&,(*
The completed weaved signal to playback would look like this *A,1,@,B,2,#,C,3,%,D,4,&,E,5,(* I've attached an image along with the Pd file that I hope helps explains this.
Without having the time to look at your patch, let me ask briefly if you expect this to work with realtime and hence unlimited length signals? Thank you!
I expect some-type of delay because of processing but each of the 3 signals will be generated using OSC~ (See patch or included image with original message showing possible logic). I guess you could look at it as taking in audio from 3 microphones and processing the sound on each mic then outputting it back to the dac, but the processing is the big piece I'm missing :-) .
It can be done multiple ways using arrays and programming https://www.mathworks.com/matlabcentral/answers/59709-how-do-i-create-a-func... or https://stackoverflow.com/questions/10316304/interweaving-vectors . Just not sure how to do it in Pd.
On Mon, Mar 25, 2019 at 7:16 PM Peter P. peterparker@fastmail.com wrote:
- RT ratulloch@gmail.com [2019-03-25 18:57]:
I have a Pd patch with 3 separate signals and I want to sequentially
weave
the signals together so instead of having three separate signals I
create 1
large signal that is created by weaving 3 signals together.
Example: (note: the commas are just used as separators and I used
letters,
numbers, and symbols to help differentiate the signals) *signal_1 array* is *A,B,C,D,E* *signal_2 array * is *1,2,3,4,5* *signal_3 array * is *@,#,%,&,(*
The completed weaved signal to playback would look like this *A,1,@,B,2,#,C,3,%,D,4,&,E,5,(* I've attached an image along with the Pd file that I hope helps explains this.
Without having the time to look at your patch, let me ask briefly if you expect this to work with realtime and hence unlimited length signals? Thank you!
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 26.03.19 01:08, RT wrote:
I expect some-type of delay because of processing but each of the 3 signals
i guess peter's question was more along the lines: assume your soundcard is set to a sample rate of 44.1kHz. therefore, each of your three signals will create 44100 samples per second. if you interleave (that's the term that is usually used) one second of the three signals, you will have a resulting signal that is 132300 samples long. which is three seconds. after another second of input data, you will have 6 seconds worth of output data. what do you do with the extra data? if you just keep it, then you will accumulate more and more data, until your memory is exhausted.
if your signals are infinitely long (which is one of the points of doing realtime-processing, as opposed to batch processing that can only handle finite length chunks), you will end up needing 2*inf GB of memory.
gfmasd IOhannes
In that case I would think being able to overwrite the current / played 3 seconds of memory with the next 3 seconds of memory would be needed tabwrite~ tabread~ tabwrite~?
On Tue, Mar 26, 2019 at 4:45 AM IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 26.03.19 01:08, RT wrote:
I expect some-type of delay because of processing but each of the 3
signals
i guess peter's question was more along the lines: assume your soundcard is set to a sample rate of 44.1kHz. therefore, each of your three signals will create 44100 samples per second. if you interleave (that's the term that is usually used) one second of the three signals, you will have a resulting signal that is 132300 samples long. which is three seconds. after another second of input data, you will have 6 seconds worth of output data. what do you do with the extra data? if you just keep it, then you will accumulate more and more data, until your memory is exhausted.
if your signals are infinitely long (which is one of the points of doing realtime-processing, as opposed to batch processing that can only handle finite length chunks), you will end up needing 2*inf GB of memory.
gfmasd IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 3/26/19 11:11 AM, RT wrote:
In that case
the problem being, that "that case" is *the* case for a realtime system (like Pd).
I would think being able to overwrite the current / played 3 seconds of memory with the next 3 seconds of memory would be needed tabwrite~ tabread~ tabwrite~?
i'm not sure how this would help.
you could of course just discard the extra 2 seconds of sound you generated. but then the output signal is no longer continuous, as it lacks 2/3 of the continuous data.
gfmrdsa IOhannes
yeah, or “sample” the input signals at samplerate/3 … which is what i guess would be the way to go.
or just only use every 3rd sample from each stream to generate the output.
On 26 Mar 2019, at 12:59, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 3/26/19 11:11 AM, RT wrote:
In that case
the problem being, that "that case" is *the* case for a realtime system (like Pd).
I would think being able to overwrite the current / played 3 seconds of memory with the next 3 seconds of memory would be needed tabwrite~ tabread~ tabwrite~?
i'm not sure how this would help.
you could of course just discard the extra 2 seconds of sound you generated. but then the output signal is no longer continuous, as it lacks 2/3 of the continuous data.
gfmrdsa IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
there's another option you're missing which doesn't involve storage
When you do your interleaving in a literal way, think of it as the sum of 3 signals: A,0,0,B,0,0,C,0,0,... 0,1,0,0,2,0,0,3,0,... 0,0,!,0,0,@,0,0,#,...
Those signals are versions of the original, except pitched down by factor of 3, with an additional bit of harmonic content, and then added together.
If you didn't want to pitch down the signals, and you know that your osc~ frequencies are low (< 4kHz should be enough) you could just multiply by 1,0,0,1,0,0,1,0,0 0,1,0,0,1,0,0,1,0 0,0,1,0,0,1,0,0,1
and add them up. If you DID want them pitched down by factor 3, you could adjust your inputs to osc~ to freq/3
And you can do it with a single fexpr~
[ fexpr~ ($y1+1)*($y1<2); $x1*($y1==0)+$x2*($y1==1)+$x3*($y1==2) ]
That object takes your 3 input signals $x1, $x2, $x3, makes a counter in the first output $y1 (0,1,2,0,1,2,...) and the 2nd output $y2 has your interleaved signal ($x1[-1], $x2[0], $x3[1], $x1[1], ...)
I'd say, give it a try, it's a nice idea, but the high frequencies you're going to introduce may be harsh and in the range of 8kHz and up... and the result in the low frequency range won't be much different from simply adding them up.
Chuck
fexpr~ ($y1+1)*($y1<2); $x1*($y1==0)+$x2*($y1==1)+$x3*($y1==2)
might have a *lot* of high frequency content.
you could replace the counter in the above fexpr~ with a slower counter and it would have a coarser effect. That would reduce the pitch of the noise. If the counter got slow enough, it would sound more like abrubt panning between the signals instead of mixing the signals and adding noise.
fexpr~ ($y1+$f4)-3*($y1+$f4>=3); $x1*($y1<1)+$x2*($y1>=1&&$y1<2)+$x3*($y1>=2)
That adds a $f4 inlet, set to a float less than 1 to slow down the counter. It will pitch the noise down into a more usable range. At around 0.01-0.1, you'd start to hear some tones pop out (80-800 Hz). Probably at around 0.0001, it would start to sound like an arpeggio.
Replace the counter with a random walk with drift on [0,3] might also be good. It would smear out the high frequency noise. It would give you 2 parameters to control the effect, speed and noise amplitude.
Or you could try to add some cross-fading with another parameter that would cut down on the clicks. I don't know what you had in mind for this effect
Chuck
On Wed, Mar 27, 2019 at 5:04 PM Charles Z Henry czhenry@gmail.com wrote:
there's another option you're missing which doesn't involve storage
When you do your interleaving in a literal way, think of it as the sum of 3 signals: A,0,0,B,0,0,C,0,0,... 0,1,0,0,2,0,0,3,0,... 0,0,!,0,0,@,0,0,#,...
Those signals are versions of the original, except pitched down by factor of 3, with an additional bit of harmonic content, and then added together.
If you didn't want to pitch down the signals, and you know that your osc~ frequencies are low (< 4kHz should be enough) you could just multiply by 1,0,0,1,0,0,1,0,0 0,1,0,0,1,0,0,1,0 0,0,1,0,0,1,0,0,1
and add them up. If you DID want them pitched down by factor 3, you could adjust your inputs to osc~ to freq/3
And you can do it with a single fexpr~
[ fexpr~ ($y1+1)*($y1<2); $x1*($y1==0)+$x2*($y1==1)+$x3*($y1==2) ]
That object takes your 3 input signals $x1, $x2, $x3, makes a counter in the first output $y1 (0,1,2,0,1,2,...) and the 2nd output $y2 has your interleaved signal ($x1[-1], $x2[0], $x3[1], $x1[1], ...)
I'd say, give it a try, it's a nice idea, but the high frequencies you're going to introduce may be harsh and in the range of 8kHz and up... and the result in the low frequency range won't be much different from simply adding them up.
Chuck
Wow!! That one line did it thanks so much.
On Wed, Mar 27, 2019 at 10:09 PM Charles Z Henry czhenry@gmail.com wrote:
fexpr~ ($y1+1)*($y1<2); $x1*($y1==0)+$x2*($y1==1)+$x3*($y1==2)
might have a *lot* of high frequency content.
you could replace the counter in the above fexpr~ with a slower counter and it would have a coarser effect. That would reduce the pitch of the noise. If the counter got slow enough, it would sound more like abrubt panning between the signals instead of mixing the signals and adding noise.
fexpr~ ($y1+$f4)-3*($y1+$f4>=3); $x1*($y1<1)+$x2*($y1>=1&&$y1<2)+$x3*($y1>=2)
That adds a $f4 inlet, set to a float less than 1 to slow down the counter. It will pitch the noise down into a more usable range. At around 0.01-0.1, you'd start to hear some tones pop out (80-800 Hz). Probably at around 0.0001, it would start to sound like an arpeggio.
Replace the counter with a random walk with drift on [0,3] might also be good. It would smear out the high frequency noise. It would give you 2 parameters to control the effect, speed and noise amplitude.
Or you could try to add some cross-fading with another parameter that would cut down on the clicks. I don't know what you had in mind for this effect
Chuck
On Wed, Mar 27, 2019 at 5:04 PM Charles Z Henry czhenry@gmail.com wrote:
there's another option you're missing which doesn't involve storage
When you do your interleaving in a literal way, think of it as the sum of 3 signals: A,0,0,B,0,0,C,0,0,... 0,1,0,0,2,0,0,3,0,... 0,0,!,0,0,@,0,0,#,...
Those signals are versions of the original, except pitched down by factor of 3, with an additional bit of harmonic content, and then added together.
If you didn't want to pitch down the signals, and you know that your osc~ frequencies are low (< 4kHz should be enough) you could just multiply by 1,0,0,1,0,0,1,0,0 0,1,0,0,1,0,0,1,0 0,0,1,0,0,1,0,0,1
and add them up. If you DID want them pitched down by factor 3, you could adjust your inputs to osc~ to freq/3
And you can do it with a single fexpr~
[ fexpr~ ($y1+1)*($y1<2); $x1*($y1==0)+$x2*($y1==1)+$x3*($y1==2) ]
That object takes your 3 input signals $x1, $x2, $x3, makes a counter in the first output $y1 (0,1,2,0,1,2,...) and the 2nd output $y2 has your interleaved signal ($x1[-1], $x2[0], $x3[1], $x1[1], ...)
I'd say, give it a try, it's a nice idea, but the high frequencies you're going to introduce may be harsh and in the range of 8kHz and up... and the result in the low frequency range won't be much different from simply adding them up.
Chuck
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list