Frank Barknecht wrote:
- Simply using a vline~ object and ?loop it? with a different
start position the second time onwards.
I'd simply do 4).
That's ok if you're not gonna change the pitch while playing the sample.
Suppose for a moment that you don't need a sample start point different from the loop start point, i.e. the begin and end point don't change from the first to the second time. The phasor solution (which is trivial in this case) allows you to have a signal as an input to the phasor, thus allowing to change the pitch of the sampler in real time and smoothly. This is not possible (afaics) with the vline~ solution.
I would like to find a solution that mantain that possibility but does switch to the loop region after reproducing the correct sample portion the first time.
Obviously I don't know if Mikael Gunner, who posted the original message, wanted this :)
One solution for reproducing a sample with a signal pitch input without using a phasor is:
(input pitch ~) | [rpole 1] | [tabread4~]
(sending a [clear( to the rpole when starting playing)
However, the only way I can think of in order to switch from this to the phasor (or to jump to a given point of the sample) at the correct time independently of pitch history, is to use a [threshold~]; but that wouldn't be accurate because it's block-quantized.
Any other idea?
Hey!!! I just had one. But I would like anybody to suggest a simpler or more elegant one.
I may use 2 phasors (or an rpole and a phasor), both fed with the same pitch input.
Let's suppose this is the sample: |-----SS-----LB-----LE------| where: SS= sample start (where we want the sample to start playing the first time) LB= loop begin LE= loop end
With appropriate calculations, the two phasors can be adjusted so that:
cycle. In subsequent cycles it would do the same but it will be muted so we don't mind. 2) Phasor B reproduces the loop region; its initial phase is calculated in such a way that at the beginning, when it is muted, it will be producing garbage, but when phasor A will reach point LB for the first time, phasor B will also be on LB, so that, during ONE cycle of phasor B, the two phasors will be reproducing *exactly* the same portion LB-LE synchronously.
So, at any moment of that cycle, we can (and we must) safely switch from the output of phasor A to that of phasor B; we don't need to do a crossfade because the two outputs are perfectly identical.
So, for detecting when to switch, we can use a [threshold~] on LB on the output of phasor A, even if threshold is block quantized. No matter if the actual switching occurs with a delay of almost one block, it will still be safe to switch.
There is a limitation, that is a minimum loop region size: if B is the block size (usually 64) and P is the maximum pitch we are willing to allow (where a pitch of 1 means original speed, 2 means twice the original speed etc), the loop region must be at least B*P..... this formula may be wrong but however there is a minimum loop size related to the block size. I guess this is rarely an issue.
Any simpler idea?
Bye m.
-- Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor: La Cronaca del Carnevale di Ivrea 2007 visto su www.localport.it: per conoscere il Carnevale, per rivivere lÂedizione 2007. Acquistalo on line Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6430&d=17-5
On Thu, 2007-05-17 at 11:21 +0200, Matteo Sisti Sette wrote:
Frank Barknecht wrote:
- Simply using a vline~ object and ?loop it? with a different
start position the second time onwards.
I'd simply do 4).
That's ok if you're not gonna change the pitch while playing the sample.
theoretically, this approach should also work well with changing the pitch while playing, if i am not totally mistaken. i never tried to implement it myself yet, but since you send a message to [vline~] you also know at any time, where [vline~] actually is. the idea is to measure the time between the inital message to [vline~] and the moment, where you want to change the pitch. with the timevalue and the values from the initial message you could calculate [vline~] actual position. with taking into account [vline~]'s actual position and the new pitch, you could generate a new message for [vline~]. like that, it should be possible to change the pitch at any time with (sub-?)sample accuracy and without having jumps in the playback.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
Yes, I did once exactly what you describe, and it works.
(well to be precise I didn't do *exactly* what you described: I snapshotted the vline~ output to get the current position, so it worked only within block accuracy; however, I understand your solution and it should definitely work with (sub)sample accuracy)
However, in this approach the pitch input is control, i.e. number, it is not a signal. This doesn't allow for a signal input pitch.
You can "change the pitch at any time" but you cannot have an oscillator *continuously* regulating the pitch for instance.
----- Original Message ----- From: "Roman Haefeli" reduzierer@yahoo.de To: "Matteo Sisti Sette" matteo.sistisette@email.it Cc: pd-list@iem.at Sent: Thursday, May 17, 2007 12:27 PM Subject: Re: [PD] Looping samples with tabread4~
On Thu, 2007-05-17 at 11:21 +0200, Matteo Sisti Sette wrote:
Frank Barknecht wrote:
- Simply using a vline~ object and ?loop it? with a different
start position the second time onwards.
I'd simply do 4).
That's ok if you're not gonna change the pitch while playing the sample.
theoretically, this approach should also work well with changing the pitch while playing, if i am not totally mistaken. i never tried to implement it myself yet, but since you send a message to [vline~] you also know at any time, where [vline~] actually is. the idea is to measure the time between the inital message to [vline~] and the moment, where you want to change the pitch. with the timevalue and the values from the initial message you could calculate [vline~] actual position. with taking into account [vline~]'s actual position and the new pitch, you could generate a new message for [vline~]. like that, it should be possible to change the pitch at any time with (sub-?)sample accuracy and without having jumps in the playback.
roman
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
-- Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor: Gioca on-line con Best Western e parti in vacanza! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6500&d=17-5
On Thu, 2007-05-17 at 12:49 +0200, Matteo Sisti Sette wrote:
Yes, I did once exactly what you describe, and it works.
(well to be precise I didn't do *exactly* what you described: I snapshotted the vline~ output to get the current position, so it worked only within block accuracy; however, I understand your solution and it should definitely work with (sub)sample accuracy)
since there is [vsnapshot~], even this approach should work with sample accuracy.
However, in this approach the pitch input is control, i.e. number, it is not a signal. This doesn't allow for a signal input pitch.
hey, but you showed us an interesting use of [rpole~] for doing that. i think that this is a nice example of using the elementary filters in other contexts than filter design. i probably would have found often much more straightforwards solutions for certain problems, if i'd thought of using elementary filters.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
However, in this approach the pitch input is control, i.e. number, it is not a signal. This doesn't allow for a signal input pitch.
hey, but you showed us an interesting use of [rpole~] for doing that.
Yeah, what I miss is how to seamlessly switch from the first cycle to the next ones. I did propose a solution to that, but I hope there's a simpler one.... I guess a sort of [vthreshold~] would do that.
However I'm glad you appreciated the elementary filter stuff.
Btw, I think we never got (or I missed) the answer to the interesting question: what does the "v" stand for?
-- Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor: Gioca on-line con Best Western! Puoi vincere buoni-sconto per soggiorni in tutto il mondo e un week-end per due persone a Positano. Iscriviti subito! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6497&d=17-5
On Thu, 2007-05-17 at 13:40 +0200, Matteo Sisti Sette wrote:
However, in this approach the pitch input is control, i.e. number, it is not a signal. This doesn't allow for a signal input pitch.
hey, but you showed us an interesting use of [rpole~] for doing that.
Yeah, what I miss is how to seamlessly switch from the first cycle to the next ones. I did propose a solution to that, but I hope there's a simpler one.... I guess a sort of [vthreshold~] would do that.
yeah, there are a lot of objects in pd, that need to be 'v'-ized. there is [tabwrite~], the phase-inlets of all oscillators [osc~], [phasor~], [tabosc~], [threshold~] and maybe [tabplay~], which come to my mind
However I'm glad you appreciated the elementary filter stuff.
Btw, I think we never got (or I missed) the answer to the interesting question: what does the "v" stand for?
i think, this is still unanswered.
roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Roman Haefeli wrote:
On Thu, 2007-05-17 at 13:40 +0200, Matteo Sisti Sette wrote:
Btw, I think we never got (or I missed) the answer to the interesting question: what does the "v" stand for?
i think, this is still unanswered.
Most likely it stands for 'vector', which is the name used in the pd source code for a block of samples.
Martin
Hallo, Matteo Sisti Sette hat gesagt: // Matteo Sisti Sette wrote:
Frank Barknecht wrote:
- Simply using a vline~ object and ?loop it? with a different
start position the second time onwards.
I'd simply do 4).
That's ok if you're not gonna change the pitch while playing the sample.
Yes, my suggestion is for a one-shot sampler with a looping end and constant pitch.
Suppose for a moment that you don't need a sample start point different from the loop start point, i.e. the begin and end point don't change from the first to the second time. The phasor solution (which is trivial in this case) allows you to have a signal as an input to the phasor, thus allowing to change the pitch of the sampler in real time and smoothly. This is not possible (afaics) with the vline~ solution.
For one-shot sampler phasor~ is not good IMO because of the quantiztion of the phase-inlet. phasor~ samplers would be terrible for drum-samplers.
Also because of the phasor~ quantization it's hard to start playing with vline~ and then switch to looping phasor, unless you do a crossfade. (But a crossfade would work.)
One solution for reproducing a sample with a signal pitch input without using a phasor is:
(input pitch ~) | [rpole 1] | [tabread4~]
(sending a [clear( to the rpole when starting playing)
Puh, wouldn't [rpole~ 1] maybe be dangerous? Anyway I don't see any advantage in rpole~ over phasor~.
However, the only way I can think of in order to switch from this to the phasor (or to jump to a given point of the sample) at the correct time independently of pitch history, is to use a [threshold~]; but that wouldn't be accurate because it's block-quantized.
Any other idea?
Hey!!! I just had one. But I would like anybody to suggest a simpler or more elegant one.
I may use 2 phasors (or an rpole and a phasor), both fed with the same pitch input.
Let's suppose this is the sample: |-----SS-----LB-----LE------| where: SS= sample start (where we want the sample to start playing the first time) LB= loop begin LE= loop end
With appropriate calculations, the two phasors can be adjusted so that:
- Phasor A reproduces the sample the first time from SS to LE in its first
cycle. In subsequent cycles it would do the same but it will be muted so we don't mind. 2) Phasor B reproduces the loop region; its initial phase is calculated in such a way that at the beginning, when it is muted, it will be producing garbage, but when phasor A will reach point LB for the first time, phasor B will also be on LB, so that, during ONE cycle of phasor B, the two phasors will be reproducing *exactly* the same portion LB-LE synchronously.
Show us the code! ;)
This may work, but indeed would be very complicated. Also I assume, that changing the frequency of the phasor~ before you've reached the loop area would completely mess up the caluclations of phase and/or frequency of the second phasor~, especially as you can only set the phase of a phasor~ once every block.
Any simpler idea?
susloop~
Frank Barknecht _ ______footils.org_ __goto10.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
One solution for reproducing a sample with a signal pitch input without using a phasor is:
(input pitch ~) | [rpole 1] | [tabread4~]
(sending a [clear( to the rpole when starting playing)
Puh, wouldn't [rpole~ 1] maybe be dangerous? Anyway I don't see any advantage in rpole~ over phasor~.
Ah, now I see that you probably mean rpole~ as a vline~ replacement, not as one for phasor~. Yes, that would be interesting, however one needs to adjust to possibly different sample rates between the sample file and Pd, for example if you load a 44.1 kHz sample into a Pd running with 48 kHz: The speed of the ramp would need to be adjusted accordingly as rpole~ always advances with Pd's sample rate, while for playing a 44.1 sample at normal speed you need to use a ramp that advances with 44.1 kHz every sample.
Frank Barknecht _ ______footils.org_ __goto10.org__