[solved] Pd sampler.rockafella example on axoloti


#13

First, sorry for my poor english.
Then, when I Wrote this code, I didn't know interpolation object. I think, the best way to have periodic ramp of 0.71Hz is to use lfo/saw object with interpolation object.

But if you want understand formula :
Follow this link http://en.wikiaudio.org/images/b/b4/MIDI_note_number_to_frequency_chart.png
osc/phasor knob to -64 correspond to 8,176Hz frequency, and this is midi note 0.
Then, I use frequency to midi note number formula : https://en.wikipedia.org/wiki/MIDI_Tuning_Standard and obtain -42.3. Problem : how to set pitch of osc/phasor to -42.3 ?
Pitch input of the osc/phasor object is relative to frequency set with the knob. If pitch input is -42.3 and knob set to -64 (corresponding to midi note 0), then 0 + -42.3 correspond to pitch of osc/phasor = -42.3 (midi note) = 0.71Hz !

Yes, its the goal, modifying read speed without effects on the pitch. This is an example in the Puredata tutorial (rockafella).
I think it's a naive approach. But I love artefact that are produced.
There are better technics for time stretching, a good example is http://hypermammut.sourceforge.net/paulstretch/


#14

I can't her the midi n to work doesn't react to usb midi input. What am I doing wrong? (Noob alert)


#15

Perhaps the midi channel in menu View/Settings ? Set to 10 in the patch.


#16

Your English is perfectly understandable.

I think it comes down to my math skills being poor :wink:

I have also tried using window overlap addshift approach, but wasnt sure how actually to calculate it. Gonna try with this formula when I get my boards back :smile:

I actually thought doing pitch and stretch at the same time was the hardest to make. I think that is the approach that is used in some Eventide effects and also the Sound Toys Crystalizer uses that approach.

I guess stretch/pitch togeteher has its benefits as well as stretching only and pitching only has its benefits.

Anyway, thanks for the explanation. Will check it out :wink:


#17

that worked like a charm, thank you Jerome! I feel a less more noob and learned something. :grinning:


#18

Hello Jerome

I am trying to reverse the audio in a table and I've been pointed to your thread here because of your rockafella adaption.


From Jaffasplaffas suggestion in this thread I understand that you would have to invert the phasor reading through the sample so that it would play back in reverse. Unfortunately this didn't work when we tried out because speed and pitch are connected with table read.
As I understand what you achieved with your rockafella is to have speed and pitch independant.
So I tried to invert the output of the main phasor in your patch but didn't have any luck achieving reverse playback. To be honest I don't really understand how your patch exactly works, so I was just going try and error and inserting math/inv at different points asuming "main phasor" woul be a good starting point.

Could you maybe help me out here?

Thanks for the great work btw, although I didn't succed in my reverse playback, sampling little bits of guitar and stretching it is great fun!


Help needed: Clicks in granular patch
#19

hm. A lot os going on in this picture.

Havent tested it, but try inverting STRAIGHT after the saw lfo. Before sample and hold and interp object. You dont need all those audio rate inverters, You just need to get the saw lfo inverted at the right place. Anyway, I would suggest to make a simple test patch and see how it works with just a saw lfo and an inverter running through a table(and something to trigger the table like a square lfo). Just to undestand how it works before implementing into a complicated patch like this.

EDIT: Or maybe even simpler way to get and idea how it works: change the saw lfo to saw down lfo. That should also do the trick. For testing this you dont need any inverters.


#20

Straight after the Lfo didn't work either. Also the saw down showed no results.

But I made a simple test patch as you suggested and finally got my reverse audio! Thank you! I did this also a month ago but it didnt work. I think using a Saw lfo instead phasor somehow did the trick. The only problem I need to solve is to tell the lfo to start at that point in the table where
recording stopped but this is something for my original thread I guess.

Anyways great patch here, love playing around with the rockafella!


#21

Not sure I understand this; You want the reverse to start from the same point as the the forward is located at? So you can scan forth and back over the same snippet pf sound for example?


#22

I want to reverse from the end of the sample, so just straight playback either forwards or backwards. The problem is I don't know how to set up the phasor probably, I tune it by ear at the moment. This works for forward playback because I retrigger the sample all the time by using the reset inlet of the lfo. But with backwards playback it starts playing out the whole table, instead of start at the point where the sample ends.

I think I need to look into look into the compensation value in on of Jerome's calculations. The problem Is that this value in my case is not fixed, because it changes each time I record a sample.

But maybe it's a good Idea to move this here, I don't want to hijack this thread :wink: I will post some examples there.


#23

Sorry, I had not seen yours replies.
Just start from "length" to zero, then take a reset.

I have change the lfo, in order to have a frequency of 0 if, you want "freeze" the sample. Then, freeze inlet is deprecated.

rockafella.axh (10.4 KB)

rockafella.axs (16.5 KB)


Hanning Window Object
#24

@JeromeB

I guess you are using lfo saw lin for this, right? Was wondering if you've figured out what values and data type you need to feed into the freq input? To be able to set a specific frequency?

Thanks


#25

Ha, good question !

First, I don't understand the relation between frequency input of "lfo/saw lin" object and frequency output. I would in this case responded to your question in this discussion ! :smile:

Then, I trig on reset input of the "lfo/saw lin" object if output exceed the threshold "length". For this reason, the table is read with a different frequency as output frequency of the "lfo/saw lin" object... Sorry.

But I think, it's possible to understand relation between frequency input and frequency of output signal of "lfo/saw lin" object reading the code. I investigates.


#26

Cool. Neither do I. Thanks though. Maybe you hadnt seen the post :wink:

dont know much about the coding side of it, so cant help there. But interested in what you find out :wink:


#27

For k-rate, a 1hz saw signal must have a 64/3000 = 0,021333 increment (for each step of 3KHz).
In lfo/saw lin object, freq input is divided by 128 :
">> 2 then >> 5 " <=> ">> 7 " <=> " div by 2^7 (== 128)"

If you multiplie your increment (0,021333...) by 128, you have your "freq input" = 2.73.
In fact, 2.73 in freq input means 1Hz signal...

Test.axp (3.6 KB)


#28

Yeah I managed to find out that 1hz is 2.73 by adjusting according to the regular saw lfo.

And by multiplying 2.73 with and ctrl/i with a value of one, you can adjust the frequency by 1 hz at a time. See you have set it up in another way. But this can only go faster that one hz, not slower. Need to sort this out in some way, so we can go slower too.

WOuld also be really nice to have a second value for finetuning hz in less increments than one . So we could adjust to 1.15 hz or 4.45 hz for example and not only whole frequencies like 1, 2, 5, 6etc.. This I havent figured out yet either.


#29

Are you sure ? I think frequency input is a linear input.
Then, if you multiply by 0.273 (instead of 2.73), your "dial p" value means tenth of Hz, no ?
I am at work, I can't try this, sorry.


#30

I think I only said the same as you did; that 1 hz is 2.73.

How can you set 0.273? Or even better, how can you set 0.0273? :smile:

A divide by 10 or divide by 100 would be a nice object to have :smile: I missed them a few times :wink:


#31

what version are you using this with? currently trying to compile under OS X in 1.0.8 and am unable to use this.

pastebin: http://pastebin.com/g0NzfHPQ


#33

@workerparasite303, I use a from source compiled version. "About" popup says : 1.0.6-2-g1d64bdc
I compiled this version in order to use "ubpatchname/tablename" syntax in another patch. But I don't use this syntax here...

Can you try this :

rockafella.axh (10.0 KB)

rockafella.axs (17.3 KB)