Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] sample usage by losicl ... or phasor?

Date2008-11-26 12:29
Fromvictor
SubjectRe: [Cs-dev] sample usage by losicl ... or phasor?
Why not use flooper2 or diskin instead. Instead of a frequency control, they 
have
a playback pitch, which might be handier.

if you want to use phasor, you can try 'tab'. This will read any size table.

----- Original Message ----- 
From: "DavidW" 
To: "Developer discussions" 
Sent: Wednesday, November 26, 2008 6:58 AM
Subject: [Cs-dev] sample usage by losicl ... or phasor?


> Hi all,
>
> I've got a short file ("randomSamps.aiff") that I'm attempting to  use
> the samples of to (sub-audio rate) FM a sine oscil.
> Its SR is 20,000Hz and it has 5017 samples in it.
>
> Here's the current arrangement:
> ;-------------------------------------------------------------------------------------------------------------------------
> 
> 
> ; test instr for reading audio file into table so as to use samples at
> sub-audio rate for FM
> sr = 44100
> kr = 4410
> ksmps = 10
> instr 2
> iFileSR = 2.0
> ;            ampOP sampFq fn# basFq loop?
> ar1 loscil 200, 1/232, 4, iFileSR, 0
> ar1 oscili 20000, 500+ ar1, 1
> out ar1
> endin
> 
> 
> f1 0 512 10 1 ; out sine wave
> ; t sze norm fname szeSkip fmt chan
> f4 0 1 1 "randomSamps.aiff" 0 0 1
>
> i2 0 10
> e
> 
> 
> ;-------------------------------------------------------------------------------------------------------------------------
> The idea is to read the samples contiguously and apply them as
> modulation factors to the oscil.
> It works,  except I'm having trouble controlling the rate of the
> sample read, say down to a couple of Hz.
>
> (I tried to do this using the phasor opcode (as per the phasor
> helpfile example) but it exceptions with a GEN01 " Invalid ftable" )
>
> Can anyone provide a clue as to how I might read, say 1 sample/sec?
> Thanks,
> David
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's 
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great 
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the 
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-27 01:00
FromDavidW
SubjectRe: [Cs-dev] sample usage by losicl ... or phasor?
tab did the trick  thanks V!
(T'was nice to learn about flooper2)

I found the html.heml.locsil entry quite obtuse.
> ibas (optional) -- base frequency in Hz of the recorded sound. This  
> optionally overrides the frequency given in the audio file, but is  
> required if the file did not contain one. The default value is  
> 261.626 Hz, i.e. middle C. (New in Csound 4.03). If this value is  
> not known or not present, use 1 here and in kcps.

What does "given in the audio file mean? do it refer to the SR. Given  
that the file is read in using a GEN01, where does loscil find this  
magic number?
I looked for loscil in the sources and only found loscilx for which  
there is no help. deprecated?

re html.help.diskin:    (ditto  for entry for diskin2, which is more  
convoluted)
--------------------------
> Reads audio data from an external device or stream and can alter its  
> pitch.

How does it determine the pitch? Is there some fancy FFT/psychophysics  
routine going on behind the scenes?

> Performance
> kpitch -- can be any real number. a negative number signifies  
> backwards playback. The given number is a pitch ratio, where:
> 	• 1 = normal pitch
> 	• 2 = 1 octave higher
> 	• 3 = 12th higher, etc.


By "kpitch" is what is meant  frequency and, when kpitch=1, a function  
of NumberSampleFrames/SR?
Is there ever a case when the pitch of some input file /table, when  
not explicitly provided by the user, is NOT a frequency indicator?

D.

On 26/11/2008, at 11:29 PM, victor wrote:

> Why not use flooper2 or diskin instead. Instead of a frequency  
> control, they
> have
> a playback pitch, which might be handier.
>
> if you want to use phasor, you can try 'tab'. This will read any  
> size table.
>
> ----- Original Message -----
> From: "DavidW" 
> To: "Developer discussions" 
> Sent: Wednesday, November 26, 2008 6:58 AM
> Subject: [Cs-dev] sample usage by losicl ... or phasor?
>
>
>> Hi all,
>>
>> I've got a short file ("randomSamps.aiff") that I'm attempting to   
>> use
>> the samples of to (sub-audio rate) FM a sine oscil.
>> Its SR is 20,000Hz and it has 5017 samples in it.
>>
>> Here's the current arrangement:
>> ;-------------------------------------------------------------------------------------------------------------------------
>> 
>> 
>> ; test instr for reading audio file into table so as to use samples  
>> at
>> sub-audio rate for FM
>> sr = 44100
>> kr = 4410
>> ksmps = 10
>> instr 2
>> iFileSR = 2.0
>> ;            ampOP sampFq fn# basFq loop?
>> ar1 loscil 200, 1/232, 4, iFileSR, 0
>> ar1 oscili 20000, 500+ ar1, 1
>> out ar1
>> endin
>> 
>> 
>> f1 0 512 10 1 ; out sine wave
>> ; t sze norm fname szeSkip fmt chan
>> f4 0 1 1 "randomSamps.aiff" 0 0 1
>>
>> i2 0 10
>> e
>> 
>> 
>> ;-------------------------------------------------------------------------------------------------------------------------
>> The idea is to read the samples contiguously and apply them as
>> modulation factors to the oscil.
>> It works,  except I'm having trouble controlling the rate of the
>> sample read, say down to a couple of Hz.
>>
>> (I tried to do this using the phasor opcode (as per the phasor
>> helpfile example) but it exceptions with a GEN01 " Invalid ftable" )
>>
>> Can anyone provide a clue as to how I might read, say 1 sample/sec?
>> Thanks,
>> David
>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win  
>> great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

________________________________________________
David Worrall.
- Experimental Polymedia:	www.avatar.com.au
- Education for Financial Independence: www.mindthemarkets.com.au
Australian research affiliations:
- Capital Markets Cooperative Research Centre: www.cmcrc.com
- Sonic Communications Research Group:	creative.canberra.edu.au/scrg
- MARCS Auditory Laboratories: marcs.uws.edu.au




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-27 09:17
FromVictor Lazzarini
SubjectRe: [Cs-dev] sample usage by losicl ... or phasor?
It means set as one of the file 'sample' attributes (one of its chunks).
It works for WAV and AIFF.

And by 'pitch' it only means playback rate. Nothing fancy. '1' means
read sample by sample. '2' means skip every other sample, and
so on (as well as in between).

At 01:00 27/11/2008, you wrote:
>tab did the trick  thanks V!
>(T'was nice to learn about flooper2)
>
>I found the html.heml.locsil entry quite obtuse.
> > ibas (optional) -- base frequency in Hz of the recorded sound. This
> > optionally overrides the frequency given in the audio file, but is
> > required if the file did not contain one. The default value is
> > 261.626 Hz, i.e. middle C. (New in Csound 4.03). If this value is
> > not known or not present, use 1 here and in kcps.
>
>What does "given in the audio file mean? do it refer to the SR. Given
>that the file is read in using a GEN01, where does loscil find this
>magic number?
>I looked for loscil in the sources and only found loscilx for which
>there is no help. deprecated?
>
>re html.help.diskin:    (ditto  for entry for diskin2, which is more
>convoluted)
>--------------------------
> > Reads audio data from an external device or stream and can alter its
> > pitch.
>
>How does it determine the pitch? Is there some fancy FFT/psychophysics
>routine going on behind the scenes?
>
> > Performance
> > kpitch -- can be any real number. a negative number signifies
> > backwards playback. The given number is a pitch ratio, where:
> >       • 1 = normal pitch
> >       • 2 = 1 octave higher
> >       • 3 = 12th higher, etc.
>
>
>By "kpitch" is what is meant  frequency and, when kpitch=1, a function
>of NumberSampleFrames/SR?
>Is there ever a case when the pitch of some input file /table, when
>not explicitly provided by the user, is NOT a frequency indicator?
>
>D.
>
>On 26/11/2008, at 11:29 PM, victor wrote:
>
> > Why not use flooper2 or diskin instead. Instead of a frequency
> > control, they
> > have
> > a playback pitch, which might be handier.
> >
> > if you want to use phasor, you can try 'tab'. This will read any
> > size table.
> >
> > ----- Original Message -----
> > From: "DavidW" 
> > To: "Developer discussions" 
> > Sent: Wednesday, November 26, 2008 6:58 AM
> > Subject: [Cs-dev] sample usage by losicl ... or phasor?
> >
> >
> >> Hi all,
> >>
> >> I've got a short file ("randomSamps.aiff") that I'm attempting to
> >> use
> >> the samples of to (sub-audio rate) FM a sine oscil.
> >> Its SR is 20,000Hz and it has 5017 samples in it.
> >>
> >> Here's the current arrangement:
> >> 
> ;-------------------------------------------------------------------------------------------------------------------------
> >> 
> >> 
> >> ; test instr for reading audio file into table so as to use samples
> >> at
> >> sub-audio rate for FM
> >> sr = 44100
> >> kr = 4410
> >> ksmps = 10
> >> instr 2
> >> iFileSR = 2.0
> >> ;            ampOP sampFq fn# basFq loop?
> >> ar1 loscil 200, 1/232, 4, iFileSR, 0
> >> ar1 oscili 20000, 500+ ar1, 1
> >> out ar1
> >> endin
> >> 
> >> 
> >> f1 0 512 10 1 ; out sine wave
> >> ; t sze norm fname szeSkip fmt chan
> >> f4 0 1 1 "randomSamps.aiff" 0 0 1
> >>
> >> i2 0 10
> >> e
> >> 
> >> 
> >> 
> ;-------------------------------------------------------------------------------------------------------------------------
> >> The idea is to read the samples contiguously and apply them as
> >> modulation factors to the oscil.
> >> It works,  except I'm having trouble controlling the rate of the
> >> sample read, say down to a couple of Hz.
> >>
> >> (I tried to do this using the phasor opcode (as per the phasor
> >> helpfile example) but it exceptions with a GEN01 " Invalid ftable" )
> >>
> >> Can anyone provide a clue as to how I might read, say 1 sample/sec?
> >> Thanks,
> >> David
> >>
> >>
> >>
> >>
> >> -------------------------------------------------------------------------
> >> This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> challenge
> >> Build the coolest Linux based applications with Moblin SDK & win
> >> great
> >> prizes
> >> Grand prize is a trip for two to an Open Source event anywhere in the
> >> world
> >> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> _______________________________________________
> >> Csound-devel mailing list
> >> Csound-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge
> > Build the coolest Linux based applications with Moblin SDK & win
> > great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in
> > the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
>
>________________________________________________
>David Worrall.
>- Experimental Polymedia:       www.avatar.com.au
>- Education for Financial Independence: www.mindthemarkets.com.au
>Australian research affiliations:
>- Capital Markets Cooperative Research Centre: www.cmcrc.com
>- Sonic Communications Research Group:  creative.canberra.edu.au/scrg
>- MARCS Auditory Laboratories: marcs.uws.edu.au
>
>
>
>
>-------------------------------------------------------------------------
>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>Build the coolest Linux based applications with Moblin SDK & win great prizes
>Grand prize is a trip for two to an Open Source event anywhere in the world
>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-11-27 09:58
FromDavidW
SubjectRe: [Cs-dev] sample usage by losicl ... or phasor?
Thanks, V.
It might help others if such a succinct explanation is appended to the  
helpfile entries.
D.
(I don't have access to the sources).

On 27/11/2008, at 8:17 PM, Victor Lazzarini wrote:

> It means set as one of the file 'sample' attributes (one of its  
> chunks).
> It works for WAV and AIFF.
>
> And by 'pitch' it only means playback rate. Nothing fancy. '1' means
> read sample by sample. '2' means skip every other sample, and
> so on (as well as in between).
>
> At 01:00 27/11/2008, you wrote:
>> tab did the trick  thanks V!
>> (T'was nice to learn about flooper2)
>>
>> I found the html.heml.locsil entry quite obtuse.
>>> ibas (optional) -- base frequency in Hz of the recorded sound. This
>>> optionally overrides the frequency given in the audio file, but is
>>> required if the file did not contain one. The default value is
>>> 261.626 Hz, i.e. middle C. (New in Csound 4.03). If this value is
>>> not known or not present, use 1 here and in kcps.
>>
>> What does "given in the audio file mean? do it refer to the SR. Given
>> that the file is read in using a GEN01, where does loscil find this
>> magic number?
>> I looked for loscil in the sources and only found loscilx for which
>> there is no help. deprecated?
>>
>> re html.help.diskin:    (ditto  for entry for diskin2, which is more
>> convoluted)
>> --------------------------
>>> Reads audio data from an external device or stream and can alter its
>>> pitch.
>>
>> How does it determine the pitch? Is there some fancy FFT/ 
>> psychophysics
>> routine going on behind the scenes?
>>
>>> Performance
>>> kpitch -- can be any real number. a negative number signifies
>>> backwards playback. The given number is a pitch ratio, where:
>>>      • 1 = normal pitch
>>>      • 2 = 1 octave higher
>>>      • 3 = 12th higher, etc.
>>
>>
>> By "kpitch" is what is meant  frequency and, when kpitch=1, a  
>> function
>> of NumberSampleFrames/SR?
>> Is there ever a case when the pitch of some input file /table, when
>> not explicitly provided by the user, is NOT a frequency indicator?
>>
>> D.
>>
>> On 26/11/2008, at 11:29 PM, victor wrote:
>>
>>> Why not use flooper2 or diskin instead. Instead of a frequency
>>> control, they
>>> have
>>> a playback pitch, which might be handier.
>>>
>>> if you want to use phasor, you can try 'tab'. This will read any
>>> size table.
>>>
>>> ----- Original Message -----
>>> From: "DavidW" 
>>> To: "Developer discussions" 
>>> Sent: Wednesday, November 26, 2008 6:58 AM
>>> Subject: [Cs-dev] sample usage by losicl ... or phasor?
>>>
>>>
>>>> Hi all,
>>>>
>>>> I've got a short file ("randomSamps.aiff") that I'm attempting to
>>>> use
>>>> the samples of to (sub-audio rate) FM a sine oscil.
>>>> Its SR is 20,000Hz and it has 5017 samples in it.
>>>>
>>>> Here's the current arrangement:
>>>>
>> ;-------------------------------------------------------------------------------------------------------------------------
>>>> 
>>>> 
>>>> ; test instr for reading audio file into table so as to use samples
>>>> at
>>>> sub-audio rate for FM
>>>> sr = 44100
>>>> kr = 4410
>>>> ksmps = 10
>>>> instr 2
>>>> iFileSR = 2.0
>>>> ;            ampOP sampFq fn# basFq loop?
>>>> ar1 loscil 200, 1/232, 4, iFileSR, 0
>>>> ar1 oscili 20000, 500+ ar1, 1
>>>> out ar1
>>>> endin
>>>> 
>>>> 
>>>> f1 0 512 10 1 ; out sine wave
>>>> ; t sze norm fname szeSkip fmt chan
>>>> f4 0 1 1 "randomSamps.aiff" 0 0 1
>>>>
>>>> i2 0 10
>>>> e
>>>> 
>>>> 
>>>>
>> ;-------------------------------------------------------------------------------------------------------------------------
>>>> The idea is to read the samples contiguously and apply them as
>>>> modulation factors to the oscil.
>>>> It works,  except I'm having trouble controlling the rate of the
>>>> sample read, say down to a couple of Hz.
>>>>
>>>> (I tried to do this using the phasor opcode (as per the phasor
>>>> helpfile example) but it exceptions with a GEN01 " Invalid  
>>>> ftable" )
>>>>
>>>> Can anyone provide a clue as to how I might read, say 1 sample/sec?
>>>> Thanks,
>>>> David




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net