[solved] Pd sampler.rockafella example on axoloti


#1

Hi all,

Noob question : I try to reproduce B14.sampler.rockafella.pd on an Axoloti patch.
Here Sampler_1_5.axp (6.6 KB) a patch that play sample with time compression/expansion by looped sample.

But I can't link "chunk length" with the first phasor frequency in order to change chunk size, without change the global pitch.

An idea ?

PS : my last patch for playing with samples Sampler_4.axp (21.9 KB)


Is a Morphagene or Phonogene clone possible with Axoloti?
Phasors/Tables - how to set playback frequency dynamically?
#2

Problem solved !

rockafella_test.axp (2.6 KB)
rockafella.axs (15.9 KB)


JeromeB Contributions
Axoloti as ableton style audio clip player w timestretching
Time stretching from a buffer
#3

Awesome approach, it gave me some cool ideas, since i tried to do same thing for some time. So i made my own version learning yours.

Regarding feedback path going from fractional s/h object to fractional reciprocal — i'd better swap every fractional objects to audiorate ones since chunk size gets stuck if you turn knob too fast to small values. I guess it's because of 3000hz control rate resolution. With audiorate objects everything works fine.


#4

Thanks for your proposal @kausto.
I tried to insert a k-rate to s-rate interpolation between "chunk size" knob and the samplehold object and I have not heard differences. If I set "chunk size" knob to the max, then I turn fast to small value, samplehold object stuck chunk size value in long time (greater than k-rate and then greater than s-rate because samplehold object wait until all the chunk is playing). It's my goal : I want to avoid doppler effect, if frequency of current chunk playing is modified when it's reading (it's explain in the puredata example).
However, if you want change chunk size instantly and if doppler effect is not a problem for you, it's possible to suppress samplehold object and to use s-rate signal for chunk size control.


#5

Here is my attempt based on yours using s-rate chain.
granulator004.axp (4.4 KB)
granola.axs (20.5 KB)
allpasser.axs (3.2 KB)

Yeah i notice doppler effect here when i introduce second (delayed) grain.


#6

A question:

what does the second calculation do?

Does that make the lfo run at the speed the file is supposed to be played at? I mean if the file is a 150 bpm loop.. It will actually be played back at 150 bpm?


#7

Sorry, this is an old comment, when I use osc/phasor object. With osc/phasor, I can't set frequency knob to 0,71Hz (this too low frequency value), and I must use pitch entry to set the frequency to 0,71Hz. The comment explain the way to obtain the good picth value for this.

A phasor with a frequency of 0,71 Hz produce ramps with a period of 1,40 seconds : this is the length of sample store in voice.raw file. Axoloti table have a fixed length and sample load in the table is smaller than the total table length. Then I reduce the max of read point of the table with "compensation" value (percents of table occupied by the sample).

It's my first experience with Axoloti, I don't no if this the better approach.


#8

Thanks mate :smile: I understand the calcualtion for the compensation. But in general I think its a fine way and I was inspired by it. Even though I understood it wrong :smile: It made me think about how to calculate at which frquency to set an lfo, to scan through the table to get the sample to play back at regular speed. You know if it is a 150 bpm loop it woud be nice if it played back at 150 bpm to start with.. and then we would be able to stretch it very precisely :smile:

There is probably a formula for that.


#9

Thanks @kausto !
Subpatch without table declaration is very good idea.
I read here, that is possible to instantiate subpatch instance with a specific table. Good enhancement.

I made a new version, after reading the 23_stretcher example. My first version is too complicated.

The last version have "window" object for chunk envelope, instead of cosine envelope.
I use "phasor compl" object instead of "phasor lin".
Finally I integrate your proposal : I use s-rate signal for chunk size information.

rockafella.axp (4.0 KB)

rockafella.axs (11.2 KB)


#10

Awesome. Gonna look into this today.


#11

Very small update of the .axs and a new example, with auto-record and automatic length adjustment.

rockafella_full.axs (16.2 KB)

rockafella_full_test.axp (10.0 KB)


Fastest envelope attack time? How to remove clicks effectively?
#12

@JeromeB

I am still not sure I understand the calculations. The part about the 0.71 hz I understood. I didnt understand this:

I have tried in another way, but I was mostly guessing. Not so good. Seems like you have got the "formula" right. It sounds really good :wink:

The newest one, does that automatically compensate the pitch so doesnt become lower when stretching it?

Thanks


#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!