<div dir="ltr"><div>I tested it, if I have 64 samples and how it plays back. It's a bit strange to me. I was preferred to use [vline~], but it's incorrect, neither line~ does.</div><div><br></div><div>akntk</div><div><br></div><div>=====</div><div>0,    64    1.451247</div><div><br></div>vline~ outputs<div><div>vline~:</div><div>1  2  3  4  5  6  7  8  </div><div>9  10  11  12  13  14  15  16  </div><div>17  18  19  20  21  22  23  24  </div><div>25  26  27  28  29  30  31  32  </div><div>33  34  35  36  37  38  39  40  </div><div>41  42  43  44  45  46  47  48  </div><div>49  50  51  52  53  54  55  56  </div><div>57  58  59  60  61  62  63  64  </div><div><br></div><div>line~ outputs</div><div>line~:</div><div>0  1  2  3  4  5  6  7  </div><div>8  9  10  11  12  13  14  15  </div><div>16  17  18  19  20  21  22  23  </div><div>24  25  26  27  28  29  30  31  </div><div>32  33  34  35  36  37  38  39  </div><div>40  41  42  43  44  45  46  47  </div><div>48  49  50  51  52  53  54  55  </div><div>56  57  58  59  60  61  62  63  </div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 8:17 AM, Thomas Grill <span dir="ltr"><<a href="mailto:gr@grrrr.org" target="_blank">gr@grrrr.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As a followup on that old thread:<br>
<br>
- I strongely advice against the use of line~ to drive tabread4~. Under the hood, it works with single precision, so that the sample positions are prone to round off errors pretty quickly.<br>
Make the test and send the output of [line~] to [print~]. In the simplest case of sending a [0, 44100 1000( message to line (and sending a bang to [print~] at the same time), the output should show incremented sample positions by exactly one. It is easy to see that the numbers are off integers quite quickly.<br>
<br>
- vline~ works with double precision and doesn't show the same numeric problems, but has a different issue, which i consider a severe bug.<br>
Doing the same as above, the output of [vline~] starts with 1, not with 0 !<br>
This can be circumvented by delaying the output of vline~ by a sample, e.g. by sending [0, 44100 1000 0.0226757(, but this is certainly a bad workaround.<br>
<br>
<br>
The test patch is this:<br>
<br>
#N canvas 68 90 450 300 10;<br>
#X obj 26 98 print~;<br>
#X obj 26 16 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1;<br>
#X msg 58 42 0 \, 44100 1000;<br>
#X obj 58 65 line~;<br>
#X text 99 66 or vline~;<br>
#X connect 1 0 2 0;<br>
#X connect 1 0 0 0;<br>
#X connect 2 0 3 0;<br>
#X connect 3 0 0 0;<br>
<br>
<br>
--<br>
Thomas Grill<br>
<a href="http://grrrr.org" rel="noreferrer" target="_blank">http://grrrr.org</a><br>
<span class=""><br>
<br>
<br>
> Am 23.03.2015 um 05:50 schrieb Reed Perkins <<a href="mailto:reedperkins32@gmail.com">reedperkins32@gmail.com</a>>:<br>
><br>
> Hi Jonathan. Thank you for the reply. I still have a question about something you wrote, with my original question reproduced below:<br>
><br>
> 3. Does the output of [line~] and [vline~] vary due to being asked to generate a ramp faster or slower? If I ask [line~] to go from 0-555987 in 3789 milliseconds, will the actual output be the same or different if I then ask [line~] to go from 0-9876545 in 40 milliseconds<br>
><br>
> ​You wrote: "I'm not sure what you're asking.  Are you asking whether the samples output from 0-555987 will be the same in both cases?  If so, the answer is no.  The [line~] object is outputting floating point numbers in the range you specify, over the duration you specify, aligned to block boundaries."<br>
><br>
> What I meant to ask is whether or not [phasor~], [line~], and [vline~] behave the same in terms of outputting sequential values regardless of the "speed" they are "driven at".<br>
><br>
> From what I understand now, if you "drive" [line~] at the speed of the sample rate, the output should be a steady stream of numbers that increase by 1 from number to number.​ However, if you try to "drive" [line~]​ at a speed that is faster or slower than the sample rate, you'll get dropped samples or duplicated samples, respectively. So in this example:<br>
><br>
> [0, 40999 1000( <--jump to 0, then read from 0-40999 in 1000 ms<br>
> |<br>
> [line~]<br>
> |<br>
> [tabread4~ array1] <--where array1 is a size of 41000<br>
><br>
>       • If we were to print the output of the first ten ​numbers of [line~]​, it should look like this: 0,​ ​1, 2, 3, 4, 5, 6, 7, 8, 9​.​​<br>
</span>>       • If we change the time in the message box to 2000, does the output of line become 0, 0, 1, 1, 2, 2, 3, 3, 4, because we are now taking twice as long to read through the table?<br>
<div class="HOEnZb"><div class="h5">>       • If we change the time in the message box to 500, does the output of the [line~] become 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, because now [line~] has to skip samples in order to reach the end goal of 40999 in time?<br>
> I did some tests using the patch I outlined above using [print~] and these stipulations seems to hold true. So now I am curious about what [tabread4~]​ does. For the second scenario I outlined (2000ms time), does [tabread4~] change 0, 0, 1, 1, 2, 2, 3, 3, 4, 4... into 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5...? Or in the third scenario (500ms time), does [tabread4~] change, 0, 2, 4, 6, 8, 10... into 0, 1, 2, 3, 4, 5, 6...?<br>
><br>
> ​<br>
> On Sun, Mar 22, 2015 at 10:43 AM, Jonathan Wilkes via Pd-list <<a href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>> wrote:<br>
> > On 03/20/2015 12:57 PM, Reed Perkins wrote:<br>
> ><br>
> > Hello all,<br>
> ><br>
> > [line~], [vline~], and [phasor~] are used to generate line ramps in basic<br>
> > sample-playback patches. The output of these objects is usually multiplied<br>
> > by the total number of samples in a sound file (that has already been loaded<br>
> > into an array or table) and fed into the input of something like<br>
> > [tabread4~]. In other words, we use these line-ramp objects to traverse the<br>
> > indices of a table where a sample is loaded at a given speed.<br>
> ><br>
> > My questions are these:<br>
> ><br>
> > 1. Do these line-ramps generate enough numbers such that every sample in a<br>
> > table will be read?<br>
> ><br>
> ><br>
> > No.  (And I assume you are wanting the values of the table to be output one<br>
> > after the other, in sequence, when you output them as a signal.)<br>
> ><br>
> > The determining factors for how table values are output: a) ramp duration<br>
> > (in time units), b) ramp height (end value - start value), c) the sample<br>
> > rate, and d) whether the object doing the reading is interpolating the index<br>
> > values.<br>
> ><br>
> > The sample rate in Pd is fixed, so you are only guaranteed to read every<br>
> > table value when the ratio of ramp height/duration matches the sample rate<br>
> > ratio.  If you wanted something like [line~] and [tabread~] to guarantee<br>
> > that every sample of the table is read/output/whatever, you'd need a system<br>
> > in which the sample rate changes based on the size of the array being read.<br>
> ><br>
> ><br>
> > 2. Does it matter if, say for example, [tabread4~] receives a decimal number<br>
> > for an index, like 333987.8, which can be caused by multiplying the output<br>
> > of [phasor~] (which goes from 0-1) by the total amount of samples (usually a<br>
> > much larger number).<br>
> ><br>
> ><br>
> > Yes, because [tabread4~] does interpolation.  The [tabread~] object does no<br>
> > interpolation so the number after the decimal point in your index wouldn't<br>
> > make any difference.<br>
> ><br>
> > For example:<br>
> ><br>
> > [0 44099 2000(<br>
> > |<br>
> > [line~]<br>
> > |<br>
> > [tabread~ array1] <-- a table of size 44,100<br>
> ><br>
> > This will output every value of your table twice in a row, because your<br>
> > taking twice as long to read the entire table.  However, that's probably not<br>
> > what you want, and if you listen to that results vs. [tabread4~], you'll<br>
> > hear why interpolation is a good thing in this case.<br>
> ><br>
> ><br>
> > 3. Does the output of [line~] and [vline~] vary due to being asked to<br>
> > generate a ramp faster or slower? If I ask [line~] to go from 0-555987 in<br>
> > 3789 milliseconds, will the actual output be the same or different if I then<br>
> > ask [line~] to go from 0-9876545 in 40 milliseconds<br>
> ><br>
> ><br>
> > I'm not sure what you're asking.  Are you asking whether the samples output<br>
> > from 0-555987 will be the same in both cases?  If so, the answer is no.  The<br>
> > [line~] object is outputting floating point numbers in the range you<br>
> > specify, over the duration you specify, aligned to block boundaries.<br>
> ><br>
> ><br>
> > I realize this is totally theoretical, because in all honestly I wouldn't be<br>
> > able to hear a difference if samples are being skipped, but I want to know<br>
> > :)<br>
> ><br>
> ><br>
> > But you do.  If the sample rate is 44,100 samples per second, and you read<br>
> > from 0 to 44,099 in one second with [tabread~] you'll hear all the samples<br>
> > being output.  But if you read from 0 to 44,099 in _half_ of a second you'll<br>
> > be skipping every other sample.  You'll certainly perceive the difference as<br>
> > the sound recording going _twice_ as fast.<br>
> ><br>
> > Essentially, the [tabread4~] object is for those situations where you know<br>
> > you'll be playing back at a ramp height/duration ratio that doesn't match<br>
> > the sample rate ratio.  Or where you'll often be speeding up or slowing<br>
> > down.<br>
> ><br>
> > -Jonathan<br>
> ><br>
> ><br>
> > Thanks for your time.<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > <a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
> > UNSUBSCRIBE and account-management -><br>
> > <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > <a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
> > UNSUBSCRIBE and account-management -><br>
> > <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
> ><br>
><br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
</div></div><br>_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div>