Csound Csound-dev Csound-tekno Search About

[Csnd] generating single cycle waveforms to an audio file

Date2008-01-29 21:23
FromP R Figueiredo
Subject[Csnd] generating single cycle waveforms to an audio file
Hello,

Is there any simple way of creating a single cycle waveform (from any 
table I could use with an oscillator) and save it to a .wav file to use 
in a sampler, for instance? Obviously I can use an oscillator to play 
the waveform, render to a file, and then edit to a single cycle. But I 
wonder if it's possible to generate a single cycle, and save me all the 
editing.

Thanks
Pedro

Date2008-01-29 21:30
FromRory Walsh
Subject[Csnd] Re: generating single cycle waveforms to an audio file
Perhaps I misunderstood but if you know how long one cycle is then just 
run the instrument for one cycle. You could also catch a cycle during 
performance using a conditional test with fout.

Rory.




P R Figueiredo wrote:
> Hello,
> 
> Is there any simple way of creating a single cycle waveform (from any 
> table I could use with an oscillator) and save it to a .wav file to use 
> in a sampler, for instance? Obviously I can use an oscillator to play 
> the waveform, render to a file, and then edit to a single cycle. But I 
> wonder if it's possible to generate a single cycle, and save me all the 
> editing.
> 
> Thanks
> Pedro
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound"
> 

Date2008-01-29 21:37
FromJohn Lato
Subject[Csnd] Re: generating single cycle waveforms to an audio file
Hello,
The canonical way would be to use oscil1 or oscil1i, but those only output at k-rate, 
and with just linear interpolation.  If you want an a-rate output, you can use a 
standard oscillator of your choice (I would choose poscil3) with a frequency of 1/p3.

John W. Lato
School of Music
The University of Texas at Austin
1 University Station E3100
Austin, TX 78712-0435
(512) 232-2090

P R Figueiredo wrote:
> Hello,
> 
> Is there any simple way of creating a single cycle waveform (from any 
> table I could use with an oscillator) and save it to a .wav file to use 
> in a sampler, for instance? Obviously I can use an oscillator to play 
> the waveform, render to a file, and then edit to a single cycle. But I 
> wonder if it's possible to generate a single cycle, and save me all the 
> editing.
> 
> Thanks
> Pedro
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound"

Date2008-01-29 21:54
FromVictor.Lazzarini@nuim.ie
Subject[Csnd] Re: Re: generating single cycle waveforms to an audio file
AttachmentsNone  None  

Date2008-01-29 22:13
FromAnthony Kozar
Subject[Csnd] Re: Re: generating single cycle waveforms to an audio file
Csound note events always last a multiple of ksmps samples though.  So, you
have to be careful no matter which opcode you use to generate the sound.
Settings ksmps = 1 is probably necessary to get the best results.

This question is very similar to the ftsave/WAV question from the other day.
The other issue of course is that Csound's idea of a single-cycle waveform
in an ftable is independent of pitch.  The precision attainable when reading
such a waveform in a sampler will depend on what frequency you output it at.
I suggest that you may want to start with a Csound table size of 65536 and a
1 Hz output frequency using an interpolating opcode (oscil3 or oscil1i could
work since kr = sr).  That would give you 44100 samples in the WAV file
(assuming 44.1 kHz sampling rate) for one cycle.  You may even want more
than that.

Anthony Kozar
mailing-lists-1001 AT anthonykozar DOT net
http://anthonykozar.net/


Rory Walsh wrote on 1/29/08 4:30 PM:

> Perhaps I misunderstood but if you know how long one cycle is then just
> run the instrument for one cycle. You could also catch a cycle during
> performance using a conditional test with fout.

> P R Figueiredo wrote:
>> Hello,
>> 
>> Is there any simple way of creating a single cycle waveform (from any
>> table I could use with an oscillator) and save it to a .wav file to use
>> in a sampler, for instance? Obviously I can use an oscillator to play
>> the waveform, render to a file, and then edit to a single cycle. But I
>> wonder if it's possible to generate a single cycle, and save me all the
>> editing.


Date2008-01-29 22:49
FromP R Figueiredo
Subject[Csnd] Re: generating single cycle waveforms to an audio file
I got it now. Thank you all.

Pedro

Date2008-01-29 23:16
FromJohn Lato
Subject[Csnd] Re: Re: Re: generating single cycle waveforms to an audio file
If you wanted to save as a wave file, oscil1 would require upconverting to an a-rate 
variable as the oscil1 family only outputs at k-rate.  There wouldn't be any data 
loss at sr=kr, but it's an extra step.

Of course Anthony is right that, if high precision is desired, you should use a large 
table to begin with.

John W. Lato
School of Music
The University of Texas at Austin
1 University Station E3100
Austin, TX 78712-0435
(512) 232-2090

Victor.Lazzarini@nuim.ie wrote:
> or oscil1 (i,3)
> 
> Victor
> ----- Original Message -----
> From: John Lato 
> Date: Tuesday, January 29, 2008 9:30 pm
> Subject: [Csnd] Re: generating single cycle waveforms to an audio file
> To: csound@lists.bath.ac.uk
> 
>  > Hello,
>  > The canonical way would be to use oscil1 or oscil1i, but those
>  > only output at k-rate,
>  > and with just linear interpolation.  If you want an a-rate
>  > output, you can use a
>  > standard oscillator of your choice (I would choose poscil3) with
>  > a frequency of 1/p3.
>  >
>  > John W. Lato
>  > School of Music
>  > The University of Texas at Austin
>  > 1 University Station E3100
>  > Austin, TX 78712-0435
>  > (512) 232-2090
>  >
>  > P R Figueiredo wrote:
>  > > Hello,
>  > >
>  > > Is there any simple way of creating a single cycle waveform
>  > (from any
>  > > table I could use with an oscillator) and save it to a .wav
>  > file to use
>  > > in a sampler, for instance? Obviously I can use an oscillator
>  > to play
>  > > the waveform, render to a file, and then edit to a single
>  > cycle. But I
>  > > wonder if it's possible to generate a single cycle, and save
>  > me all the
>  > > editing.
>  > >
>  > > Thanks
>  > > Pedro
>  > >
>  > >
>  > > Send bugs reports to this list.
>  > > To unsubscribe, send email sympa@lists.bath.ac.uk with body
>  > "unsubscribe
>  > > csound"
>  >
>  >
>  > Send bugs reports to this list.
>  > To unsubscribe, send email sympa@lists.bath.ac.uk with body
>  > "unsubscribe csound"

Date2008-01-30 04:25
FromBrian Wong
Subject[Csnd] RE: Re: Re: generating single cycle waveforms to an audio file
Actually my ftsave question is about trying to do a very similar process, except in my case I am trying to create wave files with a specific (small) number of samples in the single-cycle waveform, to load into a synthesizer. Any advice would be appreciated!




> Date: Tue, 29 Jan 2008 17:13:57 -0500
> From: mailing-lists-1001@anthonykozar.net
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re: Re: generating single cycle waveforms to an audio file
>
> Csound note events always last a multiple of ksmps samples though. So, you
> have to be careful no matter which opcode you use to generate the sound.
> Settings ksmps = 1 is probably necessary to get the best results.
>
> This question is very similar to the ftsave/WAV question from the other day.
> The other issue of course is that Csound's idea of a single-cycle waveform
> in an ftable is independent of pitch. The precision attainable when reading
> such a waveform in a sampler will depend on what frequency you output it at.
> I suggest that you may want to start with a Csound table size of 65536 and a
> 1 Hz output frequency using an interpolating opcode (oscil3 or oscil1i could
> work since kr = sr). That would give you 44100 samples in the WAV file
> (assuming 44.1 kHz sampling rate) for one cycle. You may even want more
> than that.
>
> Anthony Kozar
> mailing-lists-1001 AT anthonykozar DOT net
> http://anthonykozar.net/
>
>
> Rory Walsh wrote on 1/29/08 4:30 PM:
>
> > Perhaps I misunderstood but if you know how long one cycle is then just
> > run the instrument for one cycle. You could also catch a cycle during
> > performance using a conditional test with fout.
>
> > P R Figueiredo wrote:
> >> Hello,
> >>
> >> Is there any simple way of creating a single cycle waveform (from any
> >> table I could use with an oscillator) and save it to a .wav file to use
> >> in a sampler, for instance? Obviously I can use an oscillator to play
> >> the waveform, render to a file, and then edit to a single cycle. But I
> >> wonder if it's possible to generate a single cycle, and save me all the
> >> editing.
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2008-01-30 04:33
From"Steven Yi"
Subject[Csnd] Re: RE: Re: Re: generating single cycle waveforms to an audio file
AttachmentsNone  

Date2008-01-30 05:33
FromDavidW
Subject[Csnd] Re: RE: Re: Re: generating single cycle waveforms to an audio file
Perhaps I didn't understand, but what's the problem w. generating the  
file from scratch in your favourite programming  language?

On 30/01/2008, at 3:25 PM, Brian Wong wrote:

> Actually my ftsave question is about trying to do a very similar  
> process, except in my case I am trying to create wave files with a  
> specific (small) number of samples in the single-cycle waveform, to  
> load into a synthesizer. Any advice would be appreciated!
>



David Worrall
________________________________________________
_________________________________________________
experimental polymedia:	www.avatar.com.au
Sonic Communications Research Group,
University of Canberra:	 creative.canberra.edu.au/scrg/



Date2008-01-30 05:52
FromBrian Wong
Subject[Csnd] RE: Re: RE: Re: Re: generating single cycle waveforms to an audio file
I am looking at doing it with SciLab, which seems to have the necessary functions, however I would prefer to make it work with Csound and be able to use ftables.



> From: vip@avatar.com.au
> To: csound@lists.bath.ac.uk
> Date: Wed, 30 Jan 2008 16:33:23 +1100
> Subject: [Csnd] Re: RE: Re: Re: generating single cycle waveforms to an audio file
>
> Perhaps I didn't understand, but what's the problem w. generating the
> file from scratch in your favourite programming language?
>
> On 30/01/2008, at 3:25 PM, Brian Wong wrote:
>
> > Actually my ftsave question is about trying to do a very similar
> > process, except in my case I am trying to create wave files with a
> > specific (small) number of samples in the single-cycle waveform, to
> > load into a synthesizer. Any advice would be appreciated!
> >
>
>
>
> David Worrall
> ________________________________________________
> _________________________________________________
> experimental polymedia: www.avatar.com.au
> Sonic Communications Research Group,
> University of Canberra: creative.canberra.edu.au/scrg/
>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2008-01-30 09:14
From"Oeyvind Brandtsegg"
Subject[Csnd] Re: Re: RE: Re: Re: generating single cycle waveforms to an audio file
AttachmentsNone