| Thomas Huber wrote:
>
> Hallo,
>
> I have the following problem: I wanted to use 'samphold' to
> generate a noise LFO, that means, an LFO that changes it's
> output value at an adjustable (low) rate. I first generated
> noise using 'rand' then passed it to 'samphold'. The 'gate'
> port of the 'samphold' was fed by a vco in squarewave mode
> with a very low pulse width.
> It worked fine, but there is a little thing I don't like. The
> low pulsewidth vco is not an ideal 'gate' generator for the
> samphold. I want the gate function to be 0 all the time except 1
> sample every cycle of it's frequency. How can this be done ?
>
> My idea is that this is something we aren't able to do easily
> in csound at the moment, so I would suggest a new opcode called
> 'aout spike kfrequency'. It should generate spikes with
> adjustable frequency that are just 1 sample period long. Maybe
> we could add another parameter that defines for how many sample
> cycles the output should go to 1. This would then be a
> super-precise PWM oscillator (which generates nice aliasing (-;,
> but it's use would be the triggering of samphold, not to create
> an audio signal).
>
> Or do I miss something, an this functionality can already be
> done with another opcode ?
>
> Thomas
Why not use randh, which is a sample&hold in itself and there is no need
for an additional pulse generator.
the opcode is :-
kr randh kamp, kcps[, iseed, ityp]
|