1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

samplers as oscillators

Discussion in 'Building With Reaktor' started by slightly muddy, Jul 17, 2004.

Thread Status:
Not open for further replies.
  1. slightly muddy

    slightly muddy NI Product Owner

    Messages:
    5
    i've just posted a synth "minimuddyii" the idea was to use samples of real analog synths as oscillator sources. this actually works fine, but one snag is that to get a continuous source each "oscillator" has to be permanently on i.e. the release phase of the amplitude adsr continues to use the looped sample rather than a release phase in the sample. thus, effectively, you need to turn the samplers off to change wave form. Maybe i'm just being dense and there is a more elegant way to do this? suggestions?
     
  2. John Nowak

    John Nowak Account Suspended

    Messages:
    3,493
    I think you're not getting any replies because its not quite clear what you want to do. Or at least, I don't understand. :)
     
  3. slightly muddy

    slightly muddy NI Product Owner

    Messages:
    5
    Sorry, I'll try to be more coherent ;-)

    to use a sample as an oscillator it is necessary to have it running as a continuous loop. i.e. you do not want its own dynamic envelope to affect the sound output. thus, when you reach the midi note off point and any envelope generator such as an adsr hits the release the oscillatoin must continue unchanged. to do this then you cant use the gate to turn the sampler module on and off. rather, as in an analog synth, the sampler/oscillator runs continuously and the output is controlled entirely by the amplitude envelope.

    this works fine. but the problem thenis that to change samples in the sampler module, to switch wave forms, you have to turn the sampler off. in the synth ive developed so far this is accomplished with a button, which is a bit clumsy + it has to incorporate a device which does the same function when changing snapshots.

    thus far i see no way round this, unless i can use the waveform selector switches to automatically disable the sampler/oscillator modules whilst a new waveform is selected.

    I hope this is somewhat clearer
     
  4. John Nowak

    John Nowak Account Suspended

    Messages:
    3,493
    I assume you are using the Sampler Loop module. Why can you not just send an event to the Sel input to change the waveform? The change should be (relatively) instantaneous. If you are using the Sampler module instead... I'd suggest you switch. :)

    I'm not sure I understand why you'd have to turn off the oscillator to select a new waveform. Perhaps if my above comment doesn't help, you can load a link to your file, preferably as stripped down as possible so as to show the problem?
     
  5. triptonizer@yahoo.com

    triptonizer@yahoo.com Forum Member

    Messages:
    277
    I took a look at your ensemble; if you have a knob for sample selection and connect this knob also to the G input you'd be fine (the value change doubles as gate signal, as long as you don't have a sample placed at zero); the problem however is that with a switch (like in your ensemble) this won't work. If you want to keep the panel layout with a menu for the waveforms, I'd suggest you use a list module instead of the switch (will look exactly the same and will gate the sampler when you connect it's output to both G and Sel inputs).
     
  6. ernest

    ernest Forum Member

    Messages:
    509
    ...and changes on the SEL input only take effect on the next activated voice (undocumented feature). If you want to change to a different waveform for a currently playing voice, the trick is to stitch together all the single-cycle waveforms into one long WAV file, load that into a waveset osicllator, and use the POS input to switch between them. For an example, see the ensemble "Heidegger" in the user library.
     
  7. John Nowak

    John Nowak Account Suspended

    Messages:
    3,493
    You can just send to sel then send a new gate message?
     
  8. triptonizer@yahoo.com

    triptonizer@yahoo.com Forum Member

    Messages:
    277
    yeah but I thought our friend didn't want the waveform to restart with each note trigger, therefor I suggested to use *something*else to do the gating (like a sel knob or list module).

    Btw I'm not sure if my solution holds true in case of a snapshot change. Anyway I'm off to http://www.10daysoff.be - shake that booty and pretend I'm 16 again :)
     
  9. ernest

    ernest Forum Member

    Messages:
    509
    If you want to change the waveform without changing the current relative pointer position, it is easiest to do that by flattening all single-cycle waves into one voice and moving the POS by wavelength multiples. Alterbnatively, you could count audio cycles, but by the time you geth through all of that you'd probably be better off using an audio table and ramp generator instead.

    I tried sending a gate-off/gate-on event to change waveforms, and what happened is there was ALOT of clicks. That's because the transitions are obviously not normally on zero crossings. If you've reached that problem, then you'll understand the reason for the Heidegger approach.
     
  10. slightly muddy

    slightly muddy NI Product Owner

    Messages:
    5
    thanks for all the suggestions. I seem to have solved the problem by using the waveform selector to regate the sampler module. one other thing though - i notice that the wave form loops seem to produce sub frequencies when played at high frequencies. would anyone know if this is a)because i'm just crap at looping the waveforms or is it some function of the way the sampler works?
     
  11. ernest

    ernest Forum Member

    Messages:
    509
    That is caled "aliasing" and it is an artefact of the way a sampler works. If you look at the waveforms from the oscillator modules in a scope, you will see they are not 'perfect.' For example the "square wave" oscillator does not produce a perfect square wave. This is because high-frequency components have been removed so they don't beat with the sample rate frequency (called "Nyquist").

    The way to avoid this problem in samplers is to use different samples of the ofitinal sound over different keyboard ranges (usually called "layering" or "spliting"). For example you have one sample for the octve middle C; another sample for octave above middle C; and so on. The more splits, the more accurate the results. Good samplers also crossfade the splits in an overlapping region so that there is not an abrupt change when moving across split points. Alternativey you can use the Gigasampler approach and have one sample for each note, but that uses alot of memory which means Reaktor4.12 starts to stutter because of a graphics bug discussed in another thread.
     
  12. dfa

    dfa NI Product Owner

    Messages:
    474
    Though we hope for anti-aliased sampler modules to solve this someday. (After the flying cars.)
     
  13. janelle_ivers

    janelle_ivers Forum Member

    Messages:
    137
    Wow! This is one of the most productive threads I have seen in a long time. I had long faith in the Reaktor community until now. It's great to see civil and intelligent conversation.

    Janelle
     
  14. janelle_ivers

    janelle_ivers Forum Member

    Messages:
    137
    ...lost faith, not long faith....you know what I mean.
     
  15. Ab Wilson

    Ab Wilson NI Product Owner

    Messages:
    223
    I only just caught up with this thread.

    A possible solution for crossfading/aliasing is to use an audiotable instead of a sampler. Set interpolation on in both directions.
     
  16. slightly muddy

    slightly muddy NI Product Owner

    Messages:
    5
    what ive tried that does work reasonably well is to incorporate a hi pass filter which tracks just below the requency of the oscillator
     
  17. imoteon

    imoteon NI Product Owner

    Messages:
    371
    by crossfading you mean between the end and the begenning of a sample, that's it? If yes, i can't really see how it could be built. Could you give some details?

    Thanks in advance.
     
  18. Ab Wilson

    Ab Wilson NI Product Owner

    Messages:
    223
    No I was thinking more as a way of doing smooth multisamples. Use the X dimension of the table to read out a single waveform. With interpolation turned on this should reduce aliasing problems. Use the Y dimension to represent the note range. ie each row represents a different sample in the multisample set. Setting interpolation on the Y dimension will allow crossfading between samples.
     
  19. CList

    CList Moderator

    Messages:
    3,299
    Of course the downside to doing this sort of y-interpolated x-fade (hmm, or any x-fade for that matter!) is that you'd have to use two voices for the playback because when both samples were playing, you'd have the lower one being pitched up and the higher one being pitched down to reach the desired note in the middle. That means two ramps for the read position = two voices. This gets tricky with an instrument that needs to be polyphonic to begin with (i.e 8 voice for most of the instrument but 16 voice for the ramps and audio tables). Might as well just go with two audio tables, two ramps, and a x-fade between them (each audio table pointing to the same data file). Might just want to stick with the sampler.

    Erm, the other downside for audio table is that all your samples would need to be the same length, so the lowest pitched one would be only one cycle of the waveform, and the higher pitched ones would be more. Getting the samples put together and loaded into the audio table would be a bit of a chore. But that's always the case with loading audio tables with waveforms!

    - CList
     
  20. Ab Wilson

    Ab Wilson NI Product Owner

    Messages:
    223
    Hmm, one of us is confused.

    Yes all the samples would have to be the same length, but no I don't see why you'd need to do stricky stuff using two voices. When a note is playing halfway between the two samples the audio table would interpolate the two waveforms and play a waveform halfway in between. You could have as many waveforms as you like mapped out across the Y dimension of the table. All you'd have to do is control the Y read position from oscilator pitch.
     
Thread Status:
Not open for further replies.