[solved] Pd sampler.rockafella example on axoloti


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


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