Re: [PD] smooth random numbers

2014-02-25 Thread Roman Haefeli
On Mon, 2014-02-24 at 15:27 +0100, Ingo wrote:
> Roman, 
> 
> are you using MIDI in theory or "real life"?

Frankly, I use (physical) MIDI quiet rarely and  I'm far from hitting
any of its limits as I mostly use some kind of MIDI controller.

> "Jitter" is MIDI's "alias name".

Yeah, I guess that is true.

> In practice MIDI data is being reduced as much as possible to avoid
> overloading the MIDI bus and in return causing serious timing problems or
> even missing data. Since I would not expect this signal to be the only one
> through the MIDI interface I would actually reduce the data on fast changes
> even drastically more.
> 
> All (decent) MIDI receiving devices interpolate between the values in order
> to avoid zipper noise.

Being even more nit-picking, I say interpolation doesn't address jitter,
though I totally see what you mean. Being that precise doesn't actually
matter that much.

> I see your point - in fact I had the same thought that you had at first!
> I dropped it right away.
> 
> Working on a daily basis with MIDI I know that this is a waste of time.

Waste of programming time or waste of CPU time? The latter doesn't
really make a difference.

> Actually: I would add a [speedlim 5] to reduce data further and you still
> wouldn't hear anything unusual.

I agree that those subtleties are hardly noticable. However, I felt the
need to point out the differences between our approaches, as you removed
what I considered crucial parts of the example.

> That reminds me a little of people asking for 14-bit pitchbend. It would
> take about 11 seconds to move the pitchbend wheel on a keyboard from the
> bottom to the top. Even a 7-bit pitchbend takes more that 80 ms sending all
> values.
> It's impossible to play music with a precise timing like this!
> 
> In practice a very fast volume change going from 0 - 127 usually gets
> reduced to 3-5 numbers in order to allow additional controllers like
> pitchbend and aftertouch to be sent at the same time and still keep the note
> on jitter within a range of maybe 3-8 ms (plus the jitter of the interface
> itself).

Sure, can't argue with that. You are assuming a scenario where this MIDI
fader emulator is used to control real MIDI receivers. I was more
thinking of a scenario where the emulator is used to substitute a real
MIDI controller/sender. There is no precision loss within Pd, so why not
use the "precise" implementation? 

> And BTW - why would "random" need extra precision?
> Doesn't the word random say it all?

No, the endpoints are supposed to be random, not the ramps in between.

> Another neglected thing is the curve that the data change should have. That
> would obviously require some extra calculation. I don't remember reading
> anything about that in the original posting, though.

Me, neither, though in real that is certainly an issue. 

I don't know why I'm so pig-headed with precision. I guess the mere fact
that Pd allows for such implementations makes me want to use them
everywhere. I personally see beauty in this ability of Pd.

Roman




___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-24 Thread Ingo
Roman, 

are you using MIDI in theory or "real life"?

"Jitter" is MIDI's "alias name".

In practice MIDI data is being reduced as much as possible to avoid
overloading the MIDI bus and in return causing serious timing problems or
even missing data. Since I would not expect this signal to be the only one
through the MIDI interface I would actually reduce the data on fast changes
even drastically more.

All (decent) MIDI receiving devices interpolate between the values in order
to avoid zipper noise.

I see your point - in fact I had the same thought that you had at first!
I dropped it right away.

Working on a daily basis with MIDI I know that this is a waste of time.
Actually: I would add a [speedlim 5] to reduce data further and you still
wouldn't hear anything unusual.

That reminds me a little of people asking for 14-bit pitchbend. It would
take about 11 seconds to move the pitchbend wheel on a keyboard from the
bottom to the top. Even a 7-bit pitchbend takes more that 80 ms sending all
values.
It's impossible to play music with a precise timing like this!

In practice a very fast volume change going from 0 - 127 usually gets
reduced to 3-5 numbers in order to allow additional controllers like
pitchbend and aftertouch to be sent at the same time and still keep the note
on jitter within a range of maybe 3-8 ms (plus the jitter of the interface
itself).


And BTW - why would "random" need extra precision?
Doesn't the word random say it all?

Another neglected thing is the curve that the data change should have. That
would obviously require some extra calculation. I don't remember reading
anything about that in the original posting, though.

Ingo



> -Ursprüngliche Nachricht-
> Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag von
> Roman Haefeli
> Gesendet: Montag, 24. Februar 2014 14:14
> An: pd-list@iem.at
> Betreff: Re: [PD] smooth random numbers
> 
> On Mon, 2014-02-24 at 13:35 +0100, Ingo wrote:
> > Sorry,
> >
> > forgot ta add [change -1] after the [i].
> >
> > I thought this was meant to be used with a MIDI signal - maybe I got
> that
> > wrong?
> 
> Yes, it is. I'm nit-picking here. The patch you posted before also
> works, even without the [change -1]. But even adding the [change -1]
> doesn't address the issues I mentioned. On a fast ramp, it still misses
> some values and it still suffers from jitter. It's only details I'm
> talking about here, yes, but since you decided to remove the features
> from my version, I hoped to be able to illustrate them with words.
> 
> Roman
> 
> 
> 
> 
> > > -Ursprüngliche Nachricht-
> > > Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag
> von
> > > Roman Haefeli
> > > Gesendet: Montag, 24. Februar 2014 10:34
> > > An: pd-list@iem.at
> > > Betreff: Re: [PD] smooth random numbers
> > >
> > > On Sun, 2014-02-23 at 04:20 +0100, Ingo wrote:
> > > > Starting from Roman's patch I would probably do it like the attached
> > > patch.
> > >
> > > Many ways might solve a certain problem and in Pd those many ways can
> > > often be divided into a "subtractive" approach - more than necessary
> is
> > > generated and the overhead is filtered out afterwards - and an
> > > "additive" approach - exactly the data needed is generated.
> > >
> > > I believe you totally missed the point why I chose the latter here.
> > > Using a constant time grain for [line] generates too much data for
> slow
> > > ramps, leading to many duplicates. Attach a print to our patch and
> > > you'll see. At the same time it misses some integer numbers for fast
> > > ramps. Also, by having a fixed time grain the result looks like a
> > > resampled ramp (which it basically is), which means it is jittery and
> > > doesn't emulate a steady movement of the fader.
> > >
> > >
> > > Roman
> > >
> > >
> > >
> > > ___
> > > Pd-list@iem.at mailing list
> > > UNSUBSCRIBE and account-management ->
> > > http://lists.puredata.info/listinfo/pd-list
> >
> 
> 
> 
> ___
> Pd-list@iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-24 Thread Roman Haefeli
On Mon, 2014-02-24 at 13:35 +0100, Ingo wrote:
> Sorry,
> 
> forgot ta add [change -1] after the [i].
> 
> I thought this was meant to be used with a MIDI signal - maybe I got that
> wrong?

Yes, it is. I'm nit-picking here. The patch you posted before also
works, even without the [change -1]. But even adding the [change -1]
doesn't address the issues I mentioned. On a fast ramp, it still misses
some values and it still suffers from jitter. It's only details I'm
talking about here, yes, but since you decided to remove the features
from my version, I hoped to be able to illustrate them with words.

Roman




> > -Ursprüngliche Nachricht-
> > Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag von
> > Roman Haefeli
> > Gesendet: Montag, 24. Februar 2014 10:34
> > An: pd-list@iem.at
> > Betreff: Re: [PD] smooth random numbers
> > 
> > On Sun, 2014-02-23 at 04:20 +0100, Ingo wrote:
> > > Starting from Roman's patch I would probably do it like the attached
> > patch.
> > 
> > Many ways might solve a certain problem and in Pd those many ways can
> > often be divided into a "subtractive" approach - more than necessary is
> > generated and the overhead is filtered out afterwards - and an
> > "additive" approach - exactly the data needed is generated.
> > 
> > I believe you totally missed the point why I chose the latter here.
> > Using a constant time grain for [line] generates too much data for slow
> > ramps, leading to many duplicates. Attach a print to our patch and
> > you'll see. At the same time it misses some integer numbers for fast
> > ramps. Also, by having a fixed time grain the result looks like a
> > resampled ramp (which it basically is), which means it is jittery and
> > doesn't emulate a steady movement of the fader.
> > 
> > 
> > Roman
> > 
> > 
> > 
> > ___
> > Pd-list@iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> > http://lists.puredata.info/listinfo/pd-list
> 



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-24 Thread Ingo
Sorry,

forgot ta add [change -1] after the [i].

I thought this was meant to be used with a MIDI signal - maybe I got that
wrong?


Ingo



> -Ursprüngliche Nachricht-
> Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag von
> Roman Haefeli
> Gesendet: Montag, 24. Februar 2014 10:34
> An: pd-list@iem.at
> Betreff: Re: [PD] smooth random numbers
> 
> On Sun, 2014-02-23 at 04:20 +0100, Ingo wrote:
> > Starting from Roman's patch I would probably do it like the attached
> patch.
> 
> Many ways might solve a certain problem and in Pd those many ways can
> often be divided into a "subtractive" approach - more than necessary is
> generated and the overhead is filtered out afterwards - and an
> "additive" approach - exactly the data needed is generated.
> 
> I believe you totally missed the point why I chose the latter here.
> Using a constant time grain for [line] generates too much data for slow
> ramps, leading to many duplicates. Attach a print to our patch and
> you'll see. At the same time it misses some integer numbers for fast
> ramps. Also, by having a fixed time grain the result looks like a
> resampled ramp (which it basically is), which means it is jittery and
> doesn't emulate a steady movement of the fader.
> 
> 
> Roman
> 
> 
> 
> ___
> Pd-list@iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-24 Thread Roman Haefeli
On Sun, 2014-02-23 at 04:20 +0100, Ingo wrote:
> Starting from Roman's patch I would probably do it like the attached patch.

Many ways might solve a certain problem and in Pd those many ways can
often be divided into a "subtractive" approach - more than necessary is
generated and the overhead is filtered out afterwards - and an
"additive" approach - exactly the data needed is generated.

I believe you totally missed the point why I chose the latter here.
Using a constant time grain for [line] generates too much data for slow
ramps, leading to many duplicates. Attach a print to our patch and
you'll see. At the same time it misses some integer numbers for fast
ramps. Also, by having a fixed time grain the result looks like a
resampled ramp (which it basically is), which means it is jittery and
doesn't emulate a steady movement of the fader. 


Roman



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-23 Thread katja
On Sat, Feb 22, 2014 at 10:54 PM, Pagano, Patrick
 wrote:
> Hello
>
> i have asked this is a few different ways and experimented but i am
> wondering, how does one create "smooth random" numbers that flow between
> each number instead of hoping from number to number?

When trying to translate the settings of a 10 band graphic equalizer
to a smooth spectrum I had a similar issue for which I used cubic
interpolation in three steps. The first two steps involves factor 2
'upsampling' each, which renders a 40 point (+interpolation points)
curve smooth enough for interpolation to 1024 points in one last step.
Attached patch cubic_upsampling.pd shows the interpolation steps done
on a sequence of random numbers.

Katja
#N canvas 143 79 708 617 10;
#N canvas 328 438 667 277 stretch 0;
#X obj 17 178 tabread4 \$0-ampsettings;
#X obj 17 205 tabwrite \$0-stretched-settings;
#X obj 228 97 t f f;
#X obj 228 125 / 2;
#X obj 228 178 tabread4 \$0-stretched-settings;
#X obj 228 205 tabwrite \$0-stretched-settings2;
#X obj 433 100 t f f;
#X obj 433 74 for++ 0 1024;
#X obj 433 180 tabread4 \$0-stretched-settings2;
#X obj 433 206 tabwrite \$0-stretched-settings3;
#X obj 433 127 / 25.6;
#X obj 433 153 + 2;
#X obj 17 78 t f f;
#X obj 17 138 / 2;
#X obj 228 57 for++ 0 43;
#X obj 17 14 inlet;
#X text 305 11 Intermediate tables \$0-stretched-settings and \$0-stretched-settings2
each have 3 points extra for cubic interpolation.;
#X obj 17 40 for++ 0 23;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X connect 2 1 5 1;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 6 0 10 0;
#X connect 6 1 9 1;
#X connect 7 0 6 0;
#X connect 8 0 9 0;
#X connect 10 0 11 0;
#X connect 11 0 8 0;
#X connect 12 0 13 0;
#X connect 12 1 1 1;
#X connect 13 0 0 0;
#X connect 14 0 2 0;
#X connect 14 1 7 0;
#X connect 15 0 17 0;
#X connect 17 0 12 0;
#X connect 17 1 14 0;
#X restore 60 338 pd stretch;
#N canvas 485 132 310 415 write-settings 0;
#X msg 165 345 arrayviewlistnew;
#X obj 165 374 s \$0-ampsettings;
#N canvas 1 79 450 300 (subpatch) 0;
#X array \$0-ampsettings 13 float 2;
#X coords 0 1 13 0 200 100 1 0 0;
#X restore 69 225 graph;
#X obj 56 23 inlet;
#X obj 56 49 unpack;
#X obj 70 178 tabwrite \$0-ampsettings;
#X obj 70 148 max 0;
#X obj 31 375 outlet;
#X text 80 375 done;
#X obj 89 95 + 1;
#X obj 31 94 t b f f;
#N canvas 358 356 357 340 copy 0;
#X obj 35 13 inlet;
#X obj 35 240 tabread \$0-ampsettings;
#X obj 35 269 tabwrite \$0-ampsettings;
#X obj 88 13 inlet;
#X obj 35 62 f;
#X obj 35 90 sel 1 10;
#X obj 35 210 unpack;
#X msg 35 184 1 0;
#X obj 91 173 tabread \$0-ampsettings;
#X obj 91 202 tabwrite \$0-ampsettings;
#X obj 91 143 unpack;
#X text 146 103 copy from index 10 to 11 and 12;
#X text 182 238 copy from index 1 to 0;
#X text 33 300 copy values so [tabread4] can interpolate later;
#X msg 91 107 10 11 \, 10 12;
#X obj 35 39 bang;
#X connect 0 0 15 0;
#X connect 1 0 2 0;
#X connect 3 0 4 1;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 5 1 14 0;
#X connect 6 0 1 0;
#X connect 6 1 2 1;
#X connect 7 0 6 0;
#X connect 8 0 9 0;
#X connect 10 0 8 0;
#X connect 10 1 9 1;
#X connect 14 0 10 0;
#X connect 15 0 4 0;
#X restore 50 121 pd copy;
#X text 101 120 copy if index 1 or 10;
#X text 114 94 shift index number;
#X text 97 23 list: RMS value + slider index;
#X connect 0 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 10 0;
#X connect 4 1 9 0;
#X connect 6 0 5 0;
#X connect 9 0 5 1;
#X connect 9 0 11 1;
#X connect 10 0 7 0;
#X connect 10 1 11 0;
#X connect 10 2 6 0;
#X restore 60 313 pd write-settings;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-randomnumbers 10 float 2;
#X coords 0 1 10 0 200 100 1 0 0;
#X restore 457 24 graph;
#X obj 26 182 random 100;
#X obj 26 210 / 100;
#X obj 26 94 until;
#X obj 26 123 f;
#X obj 26 40 t b b;
#X obj 26 153 t b f;
#X msg 26 66 10;
#X msg 65 94 0;
#X obj 26 15 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 26 240 tabwrite \$0-randomnumbers;
#X obj 59 123 + 1;
#X obj 60 289 pack;
#N canvas 1 73 450 300 (subpatch) 0;
#X array \$0-stretched-settings 23 float 2;
#X coords 0 1 23 0 200 100 1 0 0;
#X restore 457 160 graph;
#N canvas 1 73 450 300 (subpatch) 0;
#X array \$0-stretched-settings2 43 float 2;
#X coords 0 1 43 0 200 100 1 0 0;
#X restore 458 318 graph;
#N canvas 1 79 450 300 (subpatch) 0;
#X array \$0-stretched-settings3 1024 float 2;
#X coords 0 1 1024 0 200 100 1 0 0;
#X restore 459 474 graph;
#X text 53 14 generate random numbers;
#X text 465 261 upsampled 2 times;
#X text 475 419 upsampled 4 times;
#X text 472 574 upsampled 102.4 times;
#X text 21 461 Katja Vetter Feb. 2014;
#X text 20 384 Smooth 'upsampling' of a random number series by cubic
interpolation. The first two stages must be factor 2 upsampling each.
After that \, the curve is smooth enough for arbitrary upsampling factors.
;
#X connect 1 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 12 0;
#X connect 4 0 14 0;
#X connect 5 0 6 0;
#X connect 6 0 8 0;
#X connect 6 0 13 0;
#X connect 7 0 9 0;
#X connect 7 1 10 0;
#X connect 8 0 3 0;

Re: [PD] smooth random numbers

2014-02-23 Thread Charles Goyard
Hi,

Pagano, Patrick wrote:
> i have asked this is a few different ways and experimented but i am
> wondering, how does one create "smooth random" numbers that flow
> between each number instead of hoping from number to number?

Maybe you can also use Perlin noise to get deviation rather than pure
random ?

There's been a thread about that a few months ago on the list.


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-22 Thread Ingo
This one can be retriggered to change speed anytime.

Ingo

#N canvas 988 0 345 419 10;
#X obj 71 135 random 128;
#X obj 71 108 metro 5000;
#X obj 71 90 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1 ; #X obj
71 189 line; #X obj 71 209 i; #X obj 71 162 pack f 5000; #X msg 254 32 5000;
#X obj 161 384 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 161 365 5 0 0 0 - - -;
#X obj 71 231 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 4400 1;
#X floatatom 71 365 5 0 0 0 - - -;
#X text 197 363 target;
#X text 287 20 time;
#X obj 14 73 loadbang;
#X msg 253 10 1000;
#X obj 181 69 t b f b;
#X msg 134 19 0;
#X msg 134 39 1;
#X connect 0 0 5 0;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 9 0;
#X connect 5 0 3 0;
#X connect 6 0 15 0;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 13 0 2 0;
#X connect 14 0 15 0;
#X connect 15 0 17 0;
#X connect 15 1 1 1;
#X connect 15 1 5 1;
#X connect 15 2 16 0;
#X connect 16 0 2 0;
#X connect 17 0 2 0;




> -Ursprüngliche Nachricht-
> Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag 
> von Ingo
> Gesendet: Sonntag, 23. Februar 2014 04:21
> An: 'Roman Haefeli'; pd-list@iem.at
> Betreff: Re: [PD] smooth random numbers
> 
> Starting from Roman's patch I would probably do it like the attached 
> patch.
> 
> Ingo
> 
> 
> #N canvas 988 0 286 367 10;
> #X obj 71 76 random 128;
> #X obj 71 49 metro 5000;
> #X obj 71 31 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1 ; 
> #X obj 71 130 line; #X obj 71 150 i; #X obj 71 103 pack f 5000; #X msg 
> 184 32 5000; #X obj 161 325 bng 15 250 50 0 empty empty empty 17 7 0 
> 10 -262144
> -1 -1;
> #X floatatom 161 306 5 0 0 0 - - -;
> #X obj 71 172 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
> -1 -1 900 1;
> #X floatatom 71 306 5 0 0 0 - - -;
> #X text 197 304 target;
> #X text 217 20 time;
> #X obj 14 14 loadbang;
> #X msg 183 10 1000;
> #X connect 0 0 5 0;
> #X connect 0 0 8 0;
> #X connect 1 0 0 0;
> #X connect 2 0 1 0;
> #X connect 3 0 4 0;
> #X connect 4 0 9 0;
> #X connect 5 0 3 0;
> #X connect 6 0 1 1;
> #X connect 6 0 5 1;
> #X connect 8 0 7 0;
> #X connect 9 0 10 0;
> #X connect 13 0 2 0;
> #X connect 14 0 1 1;
> #X connect 14 0 5 1;
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag
> von
> > Roman Haefeli
> > Gesendet: Samstag, 22. Februar 2014 23:27
> > An: pd-list@iem.at
> > Betreff: Re: [PD] smooth random numbers
> >
> > On Sam, 2014-02-22 at 21:54 +, Pagano, Patrick wrote:
> >
> > >
> > > I would like to start creating random midi values from 0-127 and pick
> > > each number say every 5 second and have each random number then flow
> > > to the next smoothly. so if say the first number is 60 and the second
> > > is 85, the data stream would flow from 60, 61, 62 63.until it
> > > reached 85 and then from 85 smoothly to the next random selection.
> >
> > See attached patch.
> >
> > > I have not had the luck i was hoping with Vline, someone suggested an
> > > array but i am hoping someone might share some math or abstraction so
> > > i can get a handle on how to implement it
> >
> > Though one could do it with [vline~ ], it is probably cheaper (cpu-wise)
> > and actually simpler with [line]. The trick is to adjust the time grain
> > to make it output only integer numbers.
> >
> > Roman
> >

#N canvas 988 0 345 419 10;
#X obj 71 135 random 128;
#X obj 71 108 metro 5000;
#X obj 71 90 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X obj 71 189 line;
#X obj 71 209 i;
#X obj 71 162 pack f 5000;
#X msg 254 32 5000;
#X obj 161 384 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 161 365 5 0 0 0 - - -;
#X obj 71 231 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 4400 1;
#X floatatom 71 365 5 0 0 0 - - -;
#X text 197 363 target;
#X text 287 20 time;
#X obj 14 73 loadbang;
#X msg 253 10 1000;
#X obj 181 69 t b f b;
#X msg 134 19 0;
#X msg 134 39 1;
#X connect 0 0 5 0;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 9 0;
#X connect 5 0 3 0;
#X connect 6 0 15 0;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 13 0 2 0;
#X connect 14 0 15 0;
#X connect 15 0 17 0;
#X connect 15 1 1 1;
#X connect 15 1 5 1;
#X connect 15 2 16 0;
#X connect 16 0 2 0;
#X connect 17 0 2 0;
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-22 Thread Ingo
Starting from Roman's patch I would probably do it like the attached patch.

Ingo


#N canvas 988 0 286 367 10;
#X obj 71 76 random 128;
#X obj 71 49 metro 5000;
#X obj 71 31 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X obj 71 130 line;
#X obj 71 150 i;
#X obj 71 103 pack f 5000;
#X msg 184 32 5000;
#X obj 161 325 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 161 306 5 0 0 0 - - -;
#X obj 71 172 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 900 1;
#X floatatom 71 306 5 0 0 0 - - -;
#X text 197 304 target;
#X text 217 20 time;
#X obj 14 14 loadbang;
#X msg 183 10 1000;
#X connect 0 0 5 0;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 9 0;
#X connect 5 0 3 0;
#X connect 6 0 1 1;
#X connect 6 0 5 1;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 13 0 2 0;
#X connect 14 0 1 1;
#X connect 14 0 5 1;



> -Ursprüngliche Nachricht-
> Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag von
> Roman Haefeli
> Gesendet: Samstag, 22. Februar 2014 23:27
> An: pd-list@iem.at
> Betreff: Re: [PD] smooth random numbers
> 
> On Sam, 2014-02-22 at 21:54 +, Pagano, Patrick wrote:
> 
> >
> > I would like to start creating random midi values from 0-127 and pick
> > each number say every 5 second and have each random number then flow
> > to the next smoothly. so if say the first number is 60 and the second
> > is 85, the data stream would flow from 60, 61, 62 63.until it
> > reached 85 and then from 85 smoothly to the next random selection.
> 
> See attached patch.
> 
> > I have not had the luck i was hoping with Vline, someone suggested an
> > array but i am hoping someone might share some math or abstraction so
> > i can get a handle on how to implement it
> 
> Though one could do it with [vline~ ], it is probably cheaper (cpu-wise)
> and actually simpler with [line]. The trick is to adjust the time grain
> to make it output only integer numbers.
> 
> Roman
> 

#N canvas 988 0 286 367 10;
#X obj 71 76 random 128;
#X obj 71 49 metro 5000;
#X obj 71 31 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X obj 71 130 line;
#X obj 71 150 i;
#X obj 71 103 pack f 5000;
#X msg 184 32 5000;
#X obj 161 325 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 161 306 5 0 0 0 - - -;
#X obj 71 172 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 900 1;
#X floatatom 71 306 5 0 0 0 - - -;
#X text 197 304 target;
#X text 217 20 time;
#X obj 14 14 loadbang;
#X msg 183 10 1000;
#X connect 0 0 5 0;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 9 0;
#X connect 5 0 3 0;
#X connect 6 0 1 1;
#X connect 6 0 5 1;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 13 0 2 0;
#X connect 14 0 1 1;
#X connect 14 0 5 1;
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-22 Thread Martin Peach

On 2014-02-22 16:54, Pagano, Patrick wrote:

Hello

i have asked this is a few different ways and experimented but i am
wondering, how does one create "smooth random" numbers that flow between
each number instead of hoping from number to number?



One way is to do a random walk, where you would start with 64 and then 
add one if random(128) is greater than 63 or subtract one if it's less. 
(or add zero for some deadband around 63).
You could use a constant sample rate or vary that as well with random 
delays between samples.
Random walks tend to walk outside the range so you also need a way to 
bring it back when it crosses a boundary (0 or 127).


Martin


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-22 Thread Roman Haefeli
On Sam, 2014-02-22 at 21:54 +, Pagano, Patrick wrote:

> 
> I would like to start creating random midi values from 0-127 and pick
> each number say every 5 second and have each random number then flow
> to the next smoothly. so if say the first number is 60 and the second
> is 85, the data stream would flow from 60, 61, 62 63.until it
> reached 85 and then from 85 smoothly to the next random selection.

See attached patch.

> I have not had the luck i was hoping with Vline, someone suggested an
> array but i am hoping someone might share some math or abstraction so
> i can get a handle on how to implement it

Though one could do it with [vline~ ], it is probably cheaper (cpu-wise)
and actually simpler with [line]. The trick is to adjust the time grain
to make it output only integer numbers.

Roman


#N canvas 645 162 450 300 10;
#X obj 71 231 line 0 1000;
#X obj 71 55 random 128;
#X obj 105 105 -;
#X msg 105 158 5000 \$1;
#X obj 105 180 /;
#X obj 71 29 metro 5000;
#X msg 71 206 \$1 5000;
#X obj 71 4 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X obj 105 127 abs;
#X obj 71 77 t a a a a;
#X obj 132 103 print next_target;
#X floatatom 71 253 5 0 0 0 - - -, f 5;
#X connect 0 0 11 0;
#X connect 1 0 9 0;
#X connect 2 0 8 0;
#X connect 3 0 4 0;
#X connect 4 0 0 2;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 7 0 5 0;
#X connect 8 0 3 0;
#X connect 9 0 6 0;
#X connect 9 1 2 1;
#X connect 9 2 2 0;
#X connect 9 3 10 0;
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] smooth random numbers

2014-02-22 Thread jrsv
I guess you should just use [line] and make sure the line time is equal or just 
a bit shorter than the object you use to ask random for a new number.

--
Lic. José Rafael Subía Valdez
www.jrsv.net

> On 22/02/2014, at 16:54, "Pagano, Patrick"  wrote:
> 
> Hello
> 
> i have asked this is a few different ways and experimented but i am 
> wondering, how does one create "smooth random" numbers that flow between each 
> number instead of hoping from number to number? 
> 
> I would like to start creating random midi values from 0-127 and pick each 
> number say every 5 second and have each random number then flow to the next 
> smoothly. so if say the first number is 60 and the second is 85, the data 
> stream would flow from 60, 61, 62 63.until it reached 85 and then from 85 
> smoothly to the next random selection.
> 
> I have not had the luck i was hoping with Vline, someone suggested an array 
> but i am hoping someone might share some math or abstraction so i can get a 
> handle on how to implement it
> 
> thank you
> 
> Patrick
> 
> 
> Patrick Pagano B.S, M.F.A
> Audio and Projection Design Faculty
> Digital Worlds Institute
> University of Florida, USA
> (352)294-2020
> ___
> Pd-list@iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


[PD] smooth random numbers

2014-02-22 Thread Pagano, Patrick
Hello

i have asked this is a few different ways and experimented but i am wondering, 
how does one create "smooth random" numbers that flow between each number 
instead of hoping from number to number?

I would like to start creating random midi values from 0-127 and pick each 
number say every 5 second and have each random number then flow to the next 
smoothly. so if say the first number is 60 and the second is 85, the data 
stream would flow from 60, 61, 62 63.until it reached 85 and then from 85 
smoothly to the next random selection.

I have not had the luck i was hoping with Vline, someone suggested an array but 
i am hoping someone might share some math or abstraction so i can get a handle 
on how to implement it

thank you

Patrick


Patrick Pagano B.S, M.F.A
Audio and Projection Design Faculty
Digital Worlds Institute
University of Florida, USA
(352)294-2020
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list