Csound Csound-dev Csound-tekno Search About

[Csnd] Generate control signal

Date2009-06-05 21:12
FromDavid Banks
Subject[Csnd] Generate control signal
Hi csounders,

I want to generate a control signal for use in my instrument.  It's
easy to describe and (probably) easy to implement, but I just can't
think how.

This is the signal: value 0 for 9 seconds, then value 1 for 1 second;
value 0 for the next 9 seconds, then value 1 for 1 second again... and
so on, for the length of the note.  (The exact durations are
arbitrary.)

Is it necessary to use the 'loopseg' opcode to create this envelope?
Obviously there's lots of different ways to do it, but I feel like it
should be possible (even easy) to use combinations of  'oscil' and
'linseg' to create it.

Any thoughts?

Cheers,
-- 
David Banks  

Date2009-06-06 15:33
FromRory Walsh
Subject[Csnd] Re: Generate control signal
I would use a function table and an oscillator. You could fill a
function table using gen07 like this:

f2 0 1024 7 0 [[9/10]*1024] 0 0 1 [[1/10]*1024] 1

This states that 9/10ths of the table will be 0 while 1/10th of the
table will be 1. Then set you oscillator frequency to 1/10. I've never
used loopseg. You should be able to set up any kind of control signal
using function tables and oscillators. Note that you must use square
brackets in the score section.

Rory.







2009/6/5 David Banks :
> Hi csounders,
>
> I want to generate a control signal for use in my instrument.  It's
> easy to describe and (probably) easy to implement, but I just can't
> think how.
>
> This is the signal: value 0 for 9 seconds, then value 1 for 1 second;
> value 0 for the next 9 seconds, then value 1 for 1 second again... and
> so on, for the length of the note.  (The exact durations are
> arbitrary.)
>
> Is it necessary to use the 'loopseg' opcode to create this envelope?
> Obviously there's lots of different ways to do it, but I feel like it
> should be possible (even easy) to use combinations of  'oscil' and
> 'linseg' to create it.
>
> Any thoughts?
>
> Cheers,
> --
> David Banks  
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>