The Grainer can fake Unison ;-) Just in case you didnt knew

Hey there o/ Just wanted to share my (probably) last Video about the new Tonverk Update with you:

This time it’s about the fact, that we could fake Unison with the Grainer Machine - and that its sad to see, that we cannot go further with this, as Single Cycle Waveforms are simply not played back from the Grainer right now :frowning:

Hope you like that one. And - have a great Evening everybody o/
umo

8 Likes

Just in case you wanna know: I’ve received an answer to my Bug Report from Elektron today, that i’ve mentioned in the Video. TLDR: My hopes are destroyed :frowning: It is intentional, that the Grainer Machine cannot handle Single Cycle Waveforms :pensive:

Here’s the full Reply from the Support Team:

Hi,

I have let the development team know about your request. However the bug that you described is not really a bug, but a limitation that was set on the granular engine itself, to not run very small samples. They say they will look into it.

Best regards,
Viktor - Elektron Support Team

Now … im a little bit disappointed :frowning: I really hoped it was a bug …

2 Likes

Just copy-paste the cycle until you’ve reached the minimum length, problem solved. You might even just create that via resampling internally.

I’ve worked with Fasttracker 2 a long time using multicopied “single” cycles from a Korg poly 61 (that has no midi).

When i get my Tonverk this week i’ll check out the settings around your video guidelines, they are a good starting point. Maybe loose the pitch wobble and the synced LFO it might just make a tiny more realistic supersaw.

5 Likes

Lemme know how it worked :wink: Copying the Cycles is not so easy, since you can easily get out of tune here. Maybe preparing them in a DAW would work, but it would also take away the immediacy of things. Thats what makes working with the SSWs so nice in the end. But maybe they really do what Viktor said and have another look into this one day.

" Copying the Cycles is not so easy, since you can easily get out of tune here"

Single cycles are already in perfect tune if copied, otherwise it would not work when looped. And like I said, just play it via the single machine at longer length and resample it. Then perfect cut the end. It is simple. If I could do it in Fasttracker it would be a breeze in another newer DAW or sampler.

1 Like

in case you have “sox” audio utility installed you could call

sox source.wav out.wav repeat N

where N is the amount of repeats you want. It would take the source.wav and simply write a file with it as often prolonged as you want.

ffmpeg can do it too, but awkward time number based which is likely not that accurate.

Or go crazy and compile your own tool, here coded as if it where sox doing the job, its not that hard.
Takes mono and makes stereo or takes stereo as is and does what you need.

C source
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#pragma pack(push,1)
typedef struct {
    char     riff[4];
    uint32_t size;
    char     wave[4];
    char     fmt[4];
    uint32_t fmt_size;
    uint16_t audio_format;
    uint16_t channels;
    uint32_t sample_rate;
    uint32_t byte_rate;
    uint16_t block_align;
    uint16_t bits_per_sample;
    char     data_id[4];
    uint32_t data_size;
} WavHeader;
#pragma pack(pop)

int main(int argc, char **argv)
{
    if (argc < 4) {
        printf("usage: input.wav output.wav repeat N\n");
        return 1;
    }
    
    const char *infile  = argv[0]; //input.wav
    const char *outfile = argv[1]; //output.wav
    // "repeat" ignored, just take N
    int repeats = atoi(argv[3]); //N as integer
    
    if (repeats<1) return 1; //nothing to do, fail
    
    FILE *in = fopen(infile, "rb");
    if (!in) return 1; //no input file, fail
    
    WavHeader h;
    fread(&h, sizeof(h), 1, in);
    
    //if (h.channels != 1) {
    //    printf("only mono 16-bit PCM supported\n");
    //    return 1; //reject stereo
    //}
    
    if (h.bits_per_sample != 16) {
        printf("only 16-bit PCM supported\n");
        return 1; //only 16bit wavs
    }
    
    int in_ch = h.channels;
    int bytes_per_sample = 2 * in_ch;
    
    int total_samples = h.data_size / bytes_per_sample;
    int frames = total_samples;
    
    int16_t *inbuf = malloc(h.data_size);
    fread(inbuf, 1, h.data_size, in);
    fclose(in);
    
    // convert mono to stereo if needed
    int out_ch = (in_ch == 1) ? 2 : 2;
    int out_frames = frames * repeats;
    int out_data_size = out_frames * out_ch * 2;
    
    int16_t *outbuf = malloc(out_data_size); //gimme memory
    
    for (int r = 0; r < repeats; r++) {
        int16_t *dst = outbuf + r * frames * out_ch;
        if (in_ch == 2) {
            memcpy(dst, inbuf, h.data_size); //is stereo already, just copy
        } else {
            // take mono and use for stereo
            for (int i = 0; i < frames; i++) {
                int16_t s = inbuf[i];
                dst[i*2    ] = s;
                dst[i*2 + 1] = s;
            }
        }
    }
    
    free(inbuf);
    
    // define needed wave header
    h.channels       = out_ch;
    h.block_align    = out_ch * 2;
    h.byte_rate      = h.sample_rate * h.block_align;
    h.data_size      = out_data_size;
    h.size           = 36 + out_data_size;
    
    FILE *out = fopen(outfile, "wb"); // write WAV file
    fwrite(&h, sizeof(h), 1, out);
    fwrite(outbuf, 1, out_data_size, out);
    fclose(out);
    
    free(outbuf);
    return 0;
}

audio editor → ctrl A → ctrl VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

And see how long it is and adjust accordingly with more ctrl A and V’s.

1 Like