did I already reach the limits of my patching creativity?

n871's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I have made an oscillator out of chromatic samples using the polybuffer object. Each buffer inside the polybuffer has the recording of one tone. Everything is working well except for a very annoying "click" each time the buffer (=midinote) is changed which messes up everything. Is there a solution? Please help!

dtr's icon

Without looking at your patch, are you fading your samples in and out with a short [line~] or something similar?

n871's icon

I can't use line~ in my patch, the oscillator has to be able to make a big glissando (glide) without any interruptions..

dtr's icon

Sorry I misread and thought you were using [poly~].

n871's icon

I'm trying to do this with poly too, I guess this really is impossible with Max..

Peter McCulloch's icon

Not impossible, just a bit of a pain. (But this is true in most DSP languages) If you have two different samples you need to read from both of them at the same time and cross fade.

dtr's icon

Limits of Max? Don't think so. Limits of your patching creativity? Perhaps ;)

n871's icon

thank you for your comment. I already tried using crossfades instead, but if I make big fast jumps,
the volume-sliders don't seem to be fast enough to follow. Do I need a super-computer for this? : )

n871's icon

@loadmess: I already tried out so many patches. I'd gladly pay someone who thinks this is possible : )
remember I'm using over 100 recordings to make a single oscillator, a big jump requires easily 50+ crossfades in less than a second..

seems like I also get more replies when using a more provoking title for my topics ; )

brendan mccloskey's icon

In the absence of an alternative suggestion, I should shy from commenting but I think your frustration (I've read all the other threads) has resulted in an approach that seems flawed, rather than Max itself. It strikes me as very heavy-handed to use 100+ samples to get the sound of 1 oscillator. Someone else suggested using [wave~] and loading your sample into a buffer; surely this makes more sense? There are also numerous threads on here about waveshaping and (re-)creating unique oscillators.

Sorry not be more constructive/helpful

Brendan

brendan mccloskey's icon

for example, from the toots:

and Peter's own contributions to this thread:

(I'm assuming this thread relates to an earlier question regarding a customised oscillator - if not, erm, oops sorry)

Brendan

Wetterberg's icon

or... emailing the people who designed the original softsynth oscillator?

BTW, were we ever told what the samples came from to begin with?

*shrug*

brendan mccloskey's icon
Peter McCulloch's icon

It's all in the implementation for crossfades. You need an equal power cross fade. There should be one in the M4L abstractions. (M4L.bal1~ ?)
If there's a slider involved, that's probably not going to work well, since it needs to change at signal rate. (I.e. you should be able to control your oscillator with a signal)

I'd also encourage you to use fewer samples, especially if these are from an oscillator. One sample per three half-steps is typical for samples of acoustic instruments, and I'd imagine you could probably get away with less.

Inflammatory titles may get more notice, but when used too often they may get you ignored by the old-timers...

n871's icon

thanks a lot guys, I will investigate the given options. I changed the title of the topic : )

Peter McCulloch's icon

P.S. So how much money we talking about?...

Here's a version that uses stepped subdivisions per octave. (one chunk of buffer~ per octave) Uses a linear crossfade to go between the two oscillators.

Can't upload the files directly, but here's TableSaw.js:

function generate_harmonics(base_freq,sample_rate,start_sample,length)
{
    fib_a = 1;
    fib_b = 1;
    fib_tmp = 1;

    fib_max = (0.5*sample_rate) / base_freq;

    for (i = 0.; i
        v = 0.;
        for (fib_a = 1, fib_b = 1; fib_a
            amp = 1/Math.pow(fib_a,0.75);
            v = v + amp * Math.sin(fib_a*2.*Math.PI*i/length);
        }
        outlet(0,i+start_sample,v*0.4);
    }
}

Max Patch
Copy patch and select New From Clipboard in Max.

And here's TableSaw.maxpat:

n871's icon

Peter, did you made this patch for me? Thanks a lot!
I'm very curious to see it in action ..but I'm afraid I'm doing something wrong.

I copied your text (starting from "function generate..." till "outlet(0,i+start_sample,v*0.4);}}") into a text file which I renamed to TableSaw.js.
In Max I get the following error:

-tableSaw.js: Javascript SyntaxError: Illegal charachter, line 1

I'm sorry/embarrassed I know so little about programming..it's probably something very simple.
If your patch works we can certainly discuss a "reward" : )

greetings from belgium,
Nils

Peter McCulloch's icon

Hi Nils, I'll see if I can put it up on Dropbox/Yousendit/etc. later.

dtr's icon

How about a link to that softsynth?

Is it VST/AU? Why not use it in Max?

n871's icon

I can't use the softsynth because the oscillators are cut down to chromatic samples.
It concerns vintage electronic instruments like the trautonium on which the ability of
playing microtonal intervals in glissando like movements was one of the great benefits..

Thanks Peter!

n871's icon

Ok, everything's working now. When I clicked the bang "generate fibonacci..." I got an error again, the .js file showed up in Max and seemed to contain completely different text. I pasted the text again in this window and now it works. I'm off for some testing.

n871's icon

Peter,

These crossfades are working wonderfully well. Very interesting patch. I tried to load 2 samples of my own to check if the timbral difference between them would be audible. But since their frequency is different (an octave) they don't go in unison. There is also quite a bit distortion. I assume the patch isn't ready for this.

Would it be possible to modify it so I can load 7 samples (miditone 24, 36, 48, 60, 72, 84, 96) to have them crossfaded into an oscillator? This way I can check if 7 samples is enough for smooth transitions. It's possible I will need stepped subdivisions per tritone (or less..) for some of the more bright sounding oscillators. Concerning costs please send me an email: nils.vanderplancken@telenet.be

Peter McCulloch's icon

It's very possible. You would need to use lookup tables to specify the boundaries rather than doing them via arithmetic, but it's very doable.

You'll notice that I've specified as multiples of 100 Hz. This is because it will always be an integer subdivision if the sample rate (e.g. 441 samples). You'll get tuning errors with frequencies that don't map to integer subdivisions (say, 101 Hz). One solution is to use longer oscillator samples and divide the fundamental frequency. It's not perfect but it will be an improvement. Can contact you off list.

n871's icon

Yes you can contact me.

I have some further questions, but it might indeed be better to discuss them privately. I have to admit I will have to read your post a couple of times to fully understand, most of this stuff is new to me as I'm still learning Max.

Again, if it is possible to hire you to make a fully working patch, I'm very interested. You seem to know what you're doing.

n871's icon

Hi Peter,

just to let you know I sent you some recordings,

all the best,

Nils

n871's icon

for those who were/are interested in this topic:

2d.wave~ is the way to go to make an oscillator out of multiple samples.

I speed-shifted all my recorded notes to the same frequency (same waveform length). After this I made sure that all my recordings are "loopable" and that they are all existing of exactly the same amount of samples. After this I pasted them all together in 1 bigger sound file.

2d.wave slices this recording (loaded in a buffer) in as many parts as I have recorded notes and makes it possible to scroll both horizontally (=speed of the sliced parts = frequency) as vertically (crossfading between sliced parts) through the buffer.

I made it work so that for each frequency the right sliced buffer part with it's own distinctive wave shape is chosen. Problem solved : )

dtr's icon

and that sounds like...? ;)