Csound Csound-dev Csound-tekno Search About

impulse: was Re: Introduction and a Question

Date1999-06-15 10:32
FromRichard Dobson
Subjectimpulse: was Re: Introduction and a Question
If you want the impulse at the start of the file, the orc is easy:

;impulse.orc
sr = 44100
kr = 44100
ksmps = 1
nchnls= 1


gaimp  init 32767	; or whatever

instr 1
asig = gaimp
out     asig
gaimp = 0

endin

I haven't tried it with ksmps > 1, but it should still do what you need.
To offset the impulse, I guess you would need to maintain a counter.

Richard Dobson


David Ogborn wrote:
> 

> 
>    I have a question.  How does one insert a single value at a
> specified offset into an a-rate audio buffer?  The application is the
> need for a single impulse that is fed to a comb filter, i.e. so that the
> very first sample of the buffer is set to some value, and all other
> values are 0.  At present, I have defined a function table using
> GEN02 that contains the values 1 and 0 in order, which I
> subsequently access with osciln.  Is there something more straight
> forward than this?
> 
>    Thanks!
> 
>       David Ogborn

-- 
Test your DAW with my Soundcard Attrition Page!
http://wkweb5.cableinet.co.uk/rwd (LU: 19th May 1999)

Date1999-06-15 21:16
FromDavid Ogborn
SubjectRe: impulse
Thanks to Richard Dobson for putting me on the right track re: 
placing a single impulse, one sample in length, in an audio buffer!  A 
slight modification to his suggestion allows the impulse to be 
repeated with successive calls to the instrument in question.

instr 1
aimp init p5    ; p5 contains impulse strength
...
out ...
aimp=0
endin