Csound Csound-dev Csound-tekno Search About

[Csnd] loscil doesn't work

Date2010-05-03 08:46
FromStefan Thomas
Subject[Csnd] loscil doesn't work
Dear community,
I tried to do one of the exercises from the csound-book, chapter one:
Make three copies of f 4 and renumber them f 5, f 6 and f 7. Load in your own samples (yoursound1.aif, yoursound2.aif, yoursound3.aif). Create multiple copies of instr 106 and number them instr 66, instr 67 and instr 68. Edit the instruments so that they each read a different soundfile at a different pitch. Play the different samples simultaneously.
As a sample-source I used the file hello.wav
When I run csound -odac -d simplesample.orc simplesample.wav I get the error message:
ACHTUNG: [mhello.wav sr = 22050, orch sr = 44100.0
[maudio sr = 22050, monaural
opening WAV infile hello.wav
  defer length 18859
new alloc for instr 106:
ACHTUNG: [mloscil: sustain defers to non-looping source
[mB  0.000 ..  3.000 T  3.000 TT  3.000 M:   6333.3
ACHTUNG: [mloscil: sustain defers to non-looping source
[mB  3.000 ..  5.300 T  5.300 TT  5.300 M:   6333.3
I can't hear any sound after running the file.
I can't find my mistake.
Here are the orchestra and score-file:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  simplesample.orc ;;;;;;;;;;;;;;;;
sr         =         44100
kr         =         4410
ksmps     =         10
nchnls     =         1

        instr     106       
iamplitude = p4
ipitch = p5           
a1         loscil  iamplitude, ipitch, 4, 1 ; sample-based looping oscillator
        out     a1
        endin
;;;;;;;;;;;;;;;;;;;;;;;;;;; simplesample.sco ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,
; Function 4 uses the GEN01 subroutine to read in an audio file

f 4  0 0    1   "hello.wav" 0 4 0

;inst    start    duration  amplitude    pitch
i 106     0      2.3       10000        440
i 106     3      2.3       10000        440





Date2010-05-03 15:50
From
Subject[Csnd] Re: loscil doesn't work
hi -

the line
a1         loscil  iamplitude, ipitch, 4, 1
plays the sample at ipitch=440 with a speed (and pitch) 440 times as high
as the original speed (pitch).
you must use ipitch=1 and related values.

i'm not sure whether it's a problem that the sr of the sample differs from
the sr of the orchestra.

best -

      joachim


On Mon, 3 May 2010 09:46:31 +0200, Stefan Thomas
 wrote:
> Dear community,
> I tried to do one of the exercises from the csound-book, chapter one:
> 
>> Make three copies of *f 4* and renumber them *f 5, f 6 and f 7*. Load
in
>> your own samples (yoursound1.aif, yoursound2.aif, yoursound3.aif).
Create
>> multiple copies of *instr 106* and number them *instr 66*, *instr 67*
and
>> *instr 68*. Edit the instruments so that they each read a different
>> soundfile at a different pitch. Play the different samples
>> simultaneously.
>>
> As a sample-source I used the file
>
hello.wav
> When I run csound -odac -d simplesample.orc simplesample.wav I get the
> error
> message:
> 
>> ACHTUNG: [mhello.wav sr = 22050, orch sr = 44100.0
>> [maudio sr = 22050, monaural
>> opening WAV infile hello.wav
>>   defer length 18859
>> new alloc for instr 106:
>> ACHTUNG: [mloscil: sustain defers to non-looping source
>> [mB  0.000 ..  3.000 T  3.000 TT  3.000 M:   6333.3
>> ACHTUNG: [mloscil: sustain defers to non-looping source
>> [mB  3.000 ..  5.300 T  5.300 TT  5.300 M:   6333.3
>>
> I can't hear any sound after running the file.
> I can't find my mistake.
> Here are the orchestra and score-file:
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  simplesample.orc ;;;;;;;;;;;;;;;;
> sr         =         44100
> kr         =         4410
> ksmps     =         10
> nchnls     =         1
> 
>         instr     106
> iamplitude = p4
> ipitch = p5
> a1         loscil  iamplitude, ipitch, 4, 1 ; sample-based looping
> oscillator
>         out     a1
>         endin
> ;;;;;;;;;;;;;;;;;;;;;;;;;;; simplesample.sco
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,
> ; Function 4 uses the GEN01 subroutine to read in an audio file
> 
> f 4  0 0    1   "hello.wav" 0 4 0
> 
> ;inst    start    duration  amplitude    pitch
> i 106     0      2.3       10000        440
> i 106     3      2.3       10000        440
> 
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"