Csound Csound-dev Csound-tekno Search About

[Csnd-dev] GENsone

Date2016-03-20 16:46
Fromjpff
Subject[Csnd-dev] GENsone
There is a manual issue relating to GENsone but the manual example
works for me (64bit Linux-doubles).  I would be interested in other
reports (platform, other csd) so I can track this down
==John ffitch



; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o gensone.wav -W ;;; for file output any platform



sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1	; simple oscillator with loudness correction. 

kcps = cpspch(p4) 
kenv linseg 0, p3*0.25, 1, p3*0.75, 0	;amplitude envelope
kamp tablei 16384 *kenv, 2 
asig oscil kamp, kcps, 1
     outs asig, asig
  
endin 

instr 2	;neutral oscillator to compare with

kcps = cpspch(p4)  
kenv linseg 0, p3*0.25, 1, p3*0.75, 0	;amplitude envelope
asig oscil kenv, kcps, 1
     outs asig, asig
  
endin 

 
 
f 1 0 16384 10 1 	;sine wave
f 2 0 16385 "sone" 0 32000 32000 0 

s
f 0 1	;1 second of silence before we start...
s 
i 1 0 2 7.00 
i 1 + . 7.01 
i 1 + . 8.02 
i 1 + . 8.03 
s 
i 2 0 2 7.00 
i 2 + . 7.01 
i 2 + . 8.02 
i 2 + . 8.03 
e 
 

Date2016-03-20 18:51
From"Dr. Richard Boulanger"
SubjectRe: [Csnd-dev] GENsone

On Sun, Mar 20, 2016 at 12:46 PM, jpff <jpff@codemist.co.uk> wrote:
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o gensone.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1 ; simple oscillator with loudness correction.

kcps = cpspch(p4)
kenv linseg 0, p3*0.25, 1, p3*0.75, 0   ;amplitude envelope
kamp tablei 16384 *kenv, 2
asig oscil kamp, kcps, 1
     outs asig, asig

endin

instr 2 ;neutral oscillator to compare with

kcps = cpspch(p4)
kenv linseg 0, p3*0.25, 1, p3*0.75, 0   ;amplitude envelope
asig oscil kenv, kcps, 1
     outs asig, asig

endin

</CsInstruments>
<CsScore>
f 1 0 16384 10 1        ;sine wave
f 2 0 16385 "sone" 0 32000 32000 0

s
f 0 1   ;1 second of silence before we start...
s
i 1 0 2 7.00
i 1 + . 7.01
i 1 + . 8.02
i 1 + . 8.03
s
i 2 0 2 7.00
i 2 + . 7.01
i 2 + . 8.02
i 2 + . 8.03
e
</CsScore>
</CsoundSynthesizer>

On my machine (osX 10.11) the oscillator with loudness correction is super loud - clipping - and distorted - overdrivven.
Almost like a 0dbfs thing where an older .csd is plugged into a 0dbfs .csd

The straight oscillator "for comparison" is quite tame and seems to be working correctly

   0: adc0 (Built-in Microph)

PortAudio: selected input device 'Built-in Microph'

reading 4096-byte blks of shorts from adc (RAW)

0: dac0 (Built-in Output)

PortAudio: selected output device 'Built-in Output'

writing 2048 sample blks of 64-bit floats to dac

SECTION 1:

ftable 1:

ftable 2:

end of section 1 sect peak amps: 0.00000 0.00000

SECTION 2:

B 0.000 .. 1.000 T 1.000 TT 1.000 M: 0.00000 0.00000

end of section 2 sect peak amps: 0.00000 0.00000

SECTION 3:

new alloc for instr 1:

B 0.000 .. 2.000 T 2.000 TT 3.000 M:31933.8116831933.81168

number of samples out of range: 88044 88044

new alloc for instr 1:

B 2.000 .. 4.000 T 4.000 TT 5.000 M:31933.8116831933.81168

number of samples out of range: 88047 88047

B 4.000 .. 6.000 T 5.999 TT 6.999 M:31995.3759431995.37594

number of samples out of range: 88051 88051

B 6.000 .. 6.000 T 6.000 TT 7.000 M: 0.00000 0.00000

B 6.000 .. 8.000 T 8.000 TT 9.000 M:31971.8550731971.85507

number of samples out of range: 88051 88051

end of section 3 sect peak amps:31995.3759431995.37594

number of samples out of range: 352193 352193

inactive allocs returned to freespace

SECTION 4:

new alloc for instr 2:

rtevent: T 1.682 TT 10.682 M: 0.99855 0.99855

new MIDI alloc for instr 1:

rtevent: T 1.775 TT 10.775 M: 0.21093 0.21093

B 0.000 .. 2.000 T 2.000 TT 11.000 M: 0.14998 0.14998

new alloc for instr 2:

rtevent: T 2.610 TT 11.610 M: 0.99855 0.99855

rtevent: T 2.797 TT 11.796 M: 0.92598 0.92598

rtevent: T 2.982 TT 11.982 M: 0.80067 0.80067

rtevent: T 3.261 TT 12.261 M: 0.67779 0.67779

rtevent: T 3.540 TT 12.540 M: 0.49111 0.49111

rtevent: T 3.632 TT 12.632 M: 0.30527 0.30527

rtevent: T 3.725 TT 12.725 M: 0.24476 0.24476

rtevent: T 3.911 TT 12.911 M: 0.18239 0.18239


_____________________________________________
Dr. Richard Boulanger
Professor of Electronic Production and Design
Professional Writing and Music Technology Division
Berklee College of Music
______________________________________________
President of Boulanger Labs - http://boulangerlabs.com
Author & Editor of The Csound Book - http://mitpress.mit.edu/books/csound-book
Author & Editor of The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book
______________________________________________
about: http://www.boulangerlabs.com/about/richardboulanger/
about: http://www.csounds.com/community/developers/dr-richard-boulanger/
music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/

______________________________________________
email: rboulanger@berklee.edu
facebook: https://www.facebook.com/richard.boulanger.58

Date2016-03-20 19:50
Fromjpff
SubjectRe: [Csnd-dev] GENsone
So OSX and I cannot do anything; or is  this just OSX 10?

Date2016-03-21 09:46
FromVictor Lazzarini
SubjectRe: [Csnd-dev] GENsone
The code expected p4 to be a non-negative number, and on OSX it was not. Probably never set and contained garbage.
Fixed in git.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 20 Mar 2016, at 16:46, jpff  wrote:
> 
> There is a manual issue relating to GENsone but the manual example
> works for me (64bit Linux-doubles).  I would be interested in other
> reports (platform, other csd) so I can track this down
> ==John ffitch
> 
> 
> 
> ; Select audio/midi flags here according to platform
> -odac  ;;;realtime audio out
> ;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
> ; For Non-realtime ouput leave only the line below:
> ; -o gensone.wav -W ;;; for file output any platform
> 
> 
> 
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs  = 1
> 
> instr 1	; simple oscillator with loudness correction. 
> 
> kcps = cpspch(p4) 
> kenv linseg 0, p3*0.25, 1, p3*0.75, 0	;amplitude envelope
> kamp tablei 16384 *kenv, 2 
> asig oscil kamp, kcps, 1
>     outs asig, asig
> 
> endin 
> 
> instr 2	;neutral oscillator to compare with
> 
> kcps = cpspch(p4)  
> kenv linseg 0, p3*0.25, 1, p3*0.75, 0	;amplitude envelope
> asig oscil kenv, kcps, 1
>     outs asig, asig
> 
> endin 
> 
>  
>  
> f 1 0 16384 10 1 	;sine wave
> f 2 0 16385 "sone" 0 32000 32000 0 
> 
> s
> f 0 1	;1 second of silence before we start...
> s 
> i 1 0 2 7.00 
> i 1 + . 7.01 
> i 1 + . 8.02 
> i 1 + . 8.03 
> s 
> i 2 0 2 7.00 
> i 2 + . 7.01 
> i 2 + . 8.02 
> i 2 + . 8.03 
> e 
>