csound / manual

Csound Reference Manual (English)
Other
46 stars 29 forks source link

add PVANAL analysis to PVOC examples #564

Closed tjingboem closed 3 years ago

tjingboem commented 3 years ago

by adding system_i to PVOC examples:

csounder commented 3 years ago

yes! great.

- dB

Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division

On Mon, Jul 12, 2021 at 4:42 AM Menno Knevel @.***> wrote:

by adding system_i to PVOC examples:

  • pvoc
  • vpvoc
  • pvadd
  • pvcross
  • pvinterp
  • pvread
  • tableseg
  • tablexseg
  • pvbufread

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzU2NA==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=MUZmdjJ2cTJGaDN2OEVQMW5wYm5ndGJIWDN3YTJ3WXd1SFQvdFBCTHVNdz0=&h=b2e6e8d7d59549ad9a9cb481c991ed7f, or unsubscribe https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZUQkxaUVY2SDU0UUNSTUdITFRYS1RHVEFOQ05GU001QUdMMlpCQQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=S1lxVXpuS2Z6NWQwMktieWk1M05acWptaGppQStIb0MwRzRTQUp6QWhqZz0=&h=b2e6e8d7d59549ad9a9cb481c991ed7f .

tjingboem commented 3 years ago

example for pvoc. Comments for improvements are always welcome!

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac   -m0  --limiter=.95 ;;;realtime audio out, with limiter protection
; For Non-realtime ouput leave only the line below:
; -o pvoc.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

; by Menno Knevel 2021

gilen  filelen "fox.wav"        ; get length of impulse soundfile

; analyze sound file and output result to pvoc-ex file
ires system_i 1,{{ pvanal fox.wav fox1.pvx }}          ; default settings

instr 1 ; untreated signal
asig    diskin2   "fox.wav", 1
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
outs    asig*.8, asig*.8
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
ktime line 0, p3, gilen     ; timepointer over the entire sample
asig  pvoc ktime, p4, "fox1.pvx", 1 
      outs asig*.6, asig*.6
endin

</CsInstruments>
<CsScore>

i1 0 2.76      ; original sample

i2  5 2.76  1  ; no change so original sample is played
i2  10 2    1  ; played faster

i2  15 10   1  ; slowed down, same pitch &
i2  15 10   1.2; slowed down and higher pitch

e
</CsScore>
</CsoundSynthesizer>
tjingboem commented 3 years ago

Possible example for vpvoc:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac   -m0   ;;;realtime audio out
; For Non-realtime ouput leave only the line below:
; -o vpvoc.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

; by Menno Knevel 2021

gilen  filelen "fox.wav"        ; get length of impulse soundfile

; analyze sound file and output result to pvoc-ex file
ires system_i 1,{{ pvanal fox.wav fox1.pvx }}          ; default settings

instr 1 ; untreated signal
asig    diskin2   "fox.wav", 1
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
outs    asig*.8, asig*.8
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
ktime line 0, p3, gilen     ; timepointer over the entire sample
      tablexseg 1, p3, 2    ; morph from table 1 to table 2
prints  "2 tables are used as filter envelopes (tables 1 & 2)\n"
asig  vpvoc ktime, p4, "fox1.pvx"
      outs asig, asig
endin

</CsInstruments>
<CsScore>
f 1 0 512 9 .5 1 0
f 2 0 512 5 1 60 0.01 390 0.01 62 1

i1 0 2.76      ; original sample

i2  5 2.76  1  ; no change so original sample is played
i2  10 2    1  ; played faster

i2  15 10   1  ; slowed down, same pitch &
i2  15 10   1.2; slowed down and higher pitch

e
</CsScore>
</CsoundSynthesizer>
tjingboem commented 3 years ago

This is an example where tableseg/vpvoc and tablexseg/vpvoc are compared. Differences are subtle but can be heard....

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac   -m0   ;;;realtime audio out
; For Non-realtime ouput leave only the line below:
; -o tableseg_tablexseg.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

; by Menno Knevel 2021

gilen  filelen "fox.wav"        ; get length of impulse soundfile

; analyze sound file and output result to pvoc-ex file
ires system_i 1,{{ pvanal fox.wav fox1.pvx }}          ; default settings

instr 1 ; untreated signal
asig    diskin2   "fox.wav", 1
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
outs    asig*.8, asig*.8
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
ktime line 0, p3, gilen     ; timepointer over the entire sample

if p5 == 1 then        ; make a choice
        tablexseg 1, p3, 2  ; morph from table 1 to table 2
        prints  "2 tables morph exponentially (tables 1 & 2)\n"
    else 
        tableseg 1, p3, 2   ; morph from table 1 to table 2
        prints  "2 tables morph in a linear way (tables 1 & 2)\n"
endif

asig  vpvoc ktime, p4, "fox1.pvx"
      outs asig, asig
endin

</CsInstruments>
<CsScore>
f 1 0 512 9 .5 1 0
f 2 0 512 7 1 512 0

i1  0 2.76          ; original sample

i2  5 2.76  1    0  ; linear morph 
i2  8 2.76  1    1  ; exponential morph of filter

i2  10 10   1    0  ; linear morph
i2  10 10   1.7  0   
i2  20 10   1    1  ; exponential morph
i2  20 10   1.7  1  

e
</CsScore>
</CsoundSynthesizer>
tjingboem commented 3 years ago

pvadd example, with different options

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac   -m0  --limiter=.95 ;;;realtime audio out, with limiter protection
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o pvadd.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

; by Menno Knevel 2021

gilen  filelen "fox.wav"        ; get length of impulse soundfile

; analyze sound file and output result to pvoc-ex file
ires system_i 1,{{ pvanal fox.wav fox1.pvx }}          ; default settings

instr 1 ; untreated signal
asig    diskin2   "fox.wav", 1
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
outs    asig, asig
endin

instr 2
prints  "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
ibins   =  p4
igatefn =  p5
ktime line 0, p3, p3
asig  pvadd ktime, 1, "fox1.pvx", 1, ibins, 0, 1, 0, 0, igatefn
outs asig*.7, asig*.7
endin

</CsInstruments>
<CsScore>
f 1 0 16384 10 1    ; sine wave
f 2 0 512 7 1 512 1 ; 3 different tables for scaling of the gate
f 3 0 512 5 1 256 .001
f 4 0 512 7 0 256 1 256 1

i1 0 2.76          ; original sample
s
;          bins   table
i2 0 2.76   300     2    ; lots of bins & table 2 scales amplitudes (= no change)  
i2 3 2.76   300     3    ; table 3 scales amplitudes
i2 6 2.76   300     4    ; table 4 scales amplitudes
s
;          bins   table
i2 0 2.76   30      2    ; a few bins & table 2 scales amplitudes (= no change)  
i2 3 2.76   30      3    ; table 3 scales amplitudes
i2 6 2.76   30      4    ; table 4 scales amplitudes
e
</CsScore>
</CsoundSynthesizer>
tjingboem commented 3 years ago

pvread in all of its beauty

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac   -m0  --limiter=.95 ;;;realtime audio out, with limiter protection
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o pvread.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

; by Menno Knevel 2021

gilen  filelen "fox.wav"        ; get length of impulse soundfile

; analyze sound file and output result to pvoc-ex file
ires system_i 1,{{ pvanal fox.wav fox1.pvx }}          ; default settings

instr 1 ; untreated signal
asig    diskin2   "fox.wav", 1
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
outs    asig, asig
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
ibin  = p4
ktime line 0, p3, 2.8
kfreq, kamp pvread ktime, "fox1.pvx", ibin  ;read data from 7th analysis bin.
asig  poscil kamp, kfreq
      outs asig*5, asig*5                   ;compensate loss of volume

endin
</CsInstruments>
<CsScore>

i1 0 2.76           ; original sample
s
i2 0 2.76   7       ; 3 different bins
i2 + 2.76   15
i2 + 2.76   25
s
i2 2 6      7       ; slow chord
i2 2 6      50
i2 2 2      75
e
</CsScore>
</CsoundSynthesizer>
csounder commented 3 years ago

great.

-R

Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division

On Mon, Jul 12, 2021 at 4:42 AM Menno Knevel @.***> wrote:

by adding system_i to PVOC examples:

  • pvoc
  • vpvoc
  • pvadd
  • pvcross
  • pvinterp
  • pvread
  • tableseg
  • tablexseg
  • pvbufread

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzU2NA==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=MUZmdjJ2cTJGaDN2OEVQMW5wYm5ndGJIWDN3YTJ3WXd1SFQvdFBCTHVNdz0=&h=b2e6e8d7d59549ad9a9cb481c991ed7f, or unsubscribe https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZUQkxaUVY2SDU0UUNSTUdITFRYS1RHVEFOQ05GU001QUdMMlpCQQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=S1lxVXpuS2Z6NWQwMktieWk1M05acWptaGppQStIb0MwRzRTQUp6QWhqZz0=&h=b2e6e8d7d59549ad9a9cb481c991ed7f .

tjingboem commented 3 years ago

a bit trickier as number of channels must be equal for both files. Example for pvinterp

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

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

; by Menno Knevel 2021

gilen1  filelen "fox.wav"       ; get length of impulse soundfile
gilen2  filelen "finneganswake1.flac"

; analyze sound file and output result to pvoc-ex file
ires1 system_i 1,{{ pvanal fox.wav fox1.pvx }}          ; default settings
ires2 system_i 1,{{ pvanal finneganswake1.flac finneganswake1.pvx }}          ; default settings

instr 1 ; untreated signals
asig    diskin2   p4 , 1
print gilen1
print gilen2
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLES***---\n"
outs    asig, asig
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THE ANALYZED FILES:***---\n"
kfox    line 0, p3, gilen1       ; timepointer in the "fox.pvx" file
kflute  line 0, p3, gilen2       ; & in the "flute.pvx" file
kinterp line 1, p3, 0
        pvbufread kfox, "fox.pvx"
asig    pvinterp kflute, 1, "finneganswake1.pvx", p4, p5, 1, 1, 1-kinterp, 1-kinterp
        outs asig, asig

endin
</CsInstruments>
<CsScore>
s
i1 0 2.76   "fox.wav"
i1 3 12.7   "finneganswake1.flac"
s 
;           freq.fox    freq.finne 
i2 0 2.76      1           1   ; use duration of the fox
i2 5 12.7      1           1   ; duration of finneganswake
s  
i2 0 2.76      .1          4   ; duration of the fox &
i2 5 12.7      .1          4   ; duration of finneganswake but different pitches
e
</CsScore>
</CsoundSynthesizer>
tjingboem commented 3 years ago

i think there is something going on with pvcross.

This is an example, but it is not quite what i expected.

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

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

; by Menno Knevel 2021

gilen1  filelen "fox.wav"       ; get length of soundfiles
gilen2  filelen "flute.aiff"
gilen3  filelen "beats.wav"

; analyze sound files and output results to pvoc-ex files
ires1 system_i 1,{{ pvanal fox.wav fox1.pvx }}   ; use default settings
ires2 system_i 1,{{ pvanal flute.aiff flute.pvx }} 
ires3 system_i 1,{{ pvanal beats.wav beats.pvx }}  

instr 1 ; untreated signals
asig    diskin2   p4 , 1
print gilen1
print gilen2
print gilen3
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLES***---\n"
    outs    asig, asig
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THE ANALYZED FILES:***---\n"
ktime1 line 0, p3, gilen1           ; timepointer in "fox1.pvx" file
kcross expon     0.001, p3, 1
pvbufread ktime1, "fox1.pvx"    ;take only amplitude from "beats.pvx"

if p4 = 0 then
    ktime2 line 0, p3, gilen2           ; timepointer in "flute.pvx"
    asig   pvcross  ktime2, 1, "flute.pvx", 1-kcross, kcross ;and keep freqs of "flute.aiff"
else
    ktime3 line 0, p3, gilen3           ; timepointer in "beats.pvx"
    asig   pvcross  ktime3, 1, "beats.pvx", 1-kcross, kcross ;and keep freqs of "beats.wav"
endif
    outs asig, asig

endin
</CsInstruments>
<CsScore>
s
i1 0 2.76   "fox.wav"
i1 3 2.62   "flute.aiff"
i1 5 2      "beats.wav"
s
i2 0 3.5 0   ; cross the fox with the flute
i2 5 2.6 1   ; cross the fox with beats
e
</CsScore>
</CsoundSynthesizer>
tjingboem commented 3 years ago

example for pvbufread

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

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

; by Menno Knevel 2021

gilen1  filelen "flute.aiff"    ; get length of soundfiles
gilen2  filelen "beats.wav"

; analyze sound files and output results to pvoc-ex files
ires1 system_i 1,{{ pvanal flute.aiff flute.pvx }} ; use default settings
ires2 system_i 1,{{ pvanal beats.wav beats.pvx }}  

instr 1 ; untreated signals

asig    diskin2   p4 , 1
print gilen1
print gilen2
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLES***---\n"
    outs    asig, asig
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THE ANALYZED FILES:***---\n"
ktime1 line  0, p3, .8      ; use a part of "flute.pvx" file
ktime2 line  0, p3, 1       ; use a part of "beats.pvx" file
kcross line  0, p3, 1       ; from flute to beats
       pvbufread ktime1, "flute.pvx"
asig   pvcross   ktime2, 1, "beats.pvx", 1-kcross, kcross
       outs asig, asig

endin
</CsInstruments>
<CsScore>
s
i1 0 2.62   "flute.aiff"
i1 3 2      "beats.wav"
s
i2 1 3
i2 5 10
e
</CsScore>
</CsoundSynthesizer>

i will wait a bit before i commit these examples, so they can be examined and commented by others. And i am awaiting the reply to a possible error in pvcross "pvcross option not working #1513"

csounder commented 3 years ago

pvoc - nice vpvoc - nice vpvoc2 - nice pvadd - nice pvread - nice pvinterp - bugs and errors in comments and file naming. Corrected below

; Select audio/midi flags here according to platform -odac -m0 ;;;realtime audio out ;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o pvinterp.wav -W ;;; for file output any platform sr = 44100 ksmps = 32 0dbfs = 1 nchnls = 2 ; by Menno Knevel 2021 gilen1 filelen "fox.wav" ; get length of impulse soundfile gilen2 filelen "finneganswake1.flac" ; analyze sound file and output result to pvoc-ex file ires1 system_i 1,{{ pvanal fox.wav fox.pvx }} ; default settings ires2 system_i 1,{{ pvanal finneganswake1.flac finneganswake1.pvx }} ; default settings instr 1 ; untreated signals asig diskin2 p4 , 1 print gilen1 print gilen2 prints "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLES***---\n" outs asig, asig endin instr 2 prints "\n---***YOU NOW HEAR THE RESULT OF THE ANALYZED FILES:***---\n" kfox line 0, p3, gilen1 ; timepointer in the "fox.pvx" file kflute line 0, p3, gilen2 ; & in the "finneganswake1.pvx" file kinterp line 1, p3, 0 pvbufread kfox, "fox.pvx" asig pvinterp kflute, 1, "finneganswake1.pvx", p4, p5, 1, 1, 1-kinterp, 1-kinterp outs asig, asig endin s i1 0 2.76 "fox.wav" i1 3 12.7 "finneganswake1.flac" s ; freq.fox freq.finne i2 0 2.76 1 1 ; use duration of the fox i2 5 12.7 1 1 ; duration of finneganswake s i2 0 2.76 .1 4 ; duration of the fox & i2 5 12.7 .1 4 ; duration of finneganswake but different pitches e

pvcross - works - and a good starting point for user exploration, but I think that the samples might be too short to hear and appreciate the crossing - also, they might need to be more contrasting - or need more spectral content

pvbufread - nice - because these files are slowed down, one can appreciate the crossing here a bit more

You should speak to Tarmo about ‘why’ the system_i opcode does not work in CsoundQt but only when one selects - Run in Terminal from CsoundQt

tjingboem commented 3 years ago

Great feedback- thanks! And thanks for the corrections for pvinterp...

I agree with you about the sounding result of pvcross. It is a bit 'thin' as example. I have yet to find better suited samples for it, but the soundfiles found in the examples folder do perhaps lack the criteria needed. To be continued... but i will commit the other examples shortly.

Also, there is another issue i have with pvcross: https://github.com/csound/csound/issues/1513 When this is solved i will commit a better example for pvcross, showing this option of pvcross as well.

Regarding CsoundQt: i never use it, but i have opened this issue in the CsoundQt issue tracker: https://github.com/CsoundQt/CsoundQt/issues/360

csounder commented 3 years ago

regarding CsoundQt - my students always and only use this - and now some cabbage too. when doing my testing (because I am always thinking of my students too), if it runs in Qt, then... it runs in the terminal too (and so, I am saying works in Qt - that means it works!

You should check out CsoundQt - because the examples in there, and the widgets, and the integration of things are pretty great.

On Tue, Aug 24, 2021 at 6:26 AM Menno Knevel @.***> wrote:

Great feedback- thanks! And thanks for the corrections for pvinterp...

I agree with you about the sounding result of pvcross. It is a bit 'thin' as example. I have yet to find better suited samples for it, but the soundfiles found in the examples folder do perhaps lack the criteria needed. To be continued... but i will commit the other examples shortly.

Also, there is another issue i have with pvcross: csound/csound#1513 https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9jc291bmQvaXNzdWVzLzE1MTM=&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=MjNXQ2FNUGVuTzhzQ1BxTUFtQVloM0g2QUhpSjhIWXVlWG5oeHNEMlcycz0=&h=84965ed8bbe8426e913dfd7d361c9ccf When this is solved i will commit a better example for pvcross, showing this option of pvcross as well.

Regarding CsoundQt: i never use it, but i have opened this issue in the CsoundQt issue tracker: CsoundQt/CsoundQt#360 https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL0Nzb3VuZFF0L0Nzb3VuZFF0L2lzc3Vlcy8zNjA=&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=eHZScVRsTzN2aDcxSzhteWdQVGZ0Wm5jbkVGNzd4T2pTS0NabjdVelVKYz0=&h=84965ed8bbe8426e913dfd7d361c9ccf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzU2NCNpc3N1ZWNvbW1lbnQtOTA0NTE4ODQx&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=UlYxbmlWU3d1bFJqNiswdVJieFhXK0ZMNEpna3gxRTFBOWRjc2hGcFpRVT0=&h=84965ed8bbe8426e913dfd7d361c9ccf, or unsubscribe https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZTVkI1VVZIUEpWNVlXTzVQRFQ2TlhUVkFOQ05GU001QUdMMlpCQQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=bzhUY01WTHVTQzBQUVVOd2tyQjhkWDhQSHMwTWpSVUI4WVRQSk9kd3h6Zz0=&h=84965ed8bbe8426e913dfd7d361c9ccf . Triage notifications on the go with GitHub Mobile for iOS https://us-west-2.protection.sophos.com?d=apple.com&u=aHR0cHM6Ly9hcHBzLmFwcGxlLmNvbS9hcHAvYXBwbGUtc3RvcmUvaWQxNDc3Mzc2OTA1P2N0PW5vdGlmaWNhdGlvbi1lbWFpbCZtdD04JnB0PTUyNDY3NQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=L2ZMbFFvL1ZhdjEyQ1NGazc1cFVraHliaEp5U0lERUJmd1BoWnVHU3JiRT0=&h=84965ed8bbe8426e913dfd7d361c9ccf or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tjingboem commented 3 years ago

I do check out CsoundQt from time to time, but it always hangs here :-( Then i decide i'd better concentrate on the terminal for the basic examples for the manual and my work with Blue- i think this will keep me busy for years to come....

csounder commented 3 years ago

Your focus is perfect. And your work with Blue is also very very important

- dB

Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division

On Tue, Aug 24, 2021 at 7:17 AM Menno Knevel @.***> wrote:

I do check out CsoundQt from time to time, but it always hangs here :-) Then i decide i'd better concentrate on the terminal for the basic examples for the manual and my work with Blue- i think this will occupy me for years to come....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzU2NCNpc3N1ZWNvbW1lbnQtOTA0NTQ5Njgx&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=eWFrM3NKRVdtemVBb0ZDeTc2Y0JMekwvdjI3enZtTjdOdDMxamtuVzJmTT0=&h=17d644a0ab0248c0a3d5d756f0f8906b, or unsubscribe https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZWNEhERVZOS1lHMlZUU1Y2M1Q2TjVVRkFOQ05GU001QUdMMlpCQQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=OTFNUXZKUmNWRVFmZTlRTWFDRUxpYlA5dUwvSjlLSm1lcWZwVGZ3YTVPST0=&h=17d644a0ab0248c0a3d5d756f0f8906b . Triage notifications on the go with GitHub Mobile for iOS https://us-west-2.protection.sophos.com?d=apple.com&u=aHR0cHM6Ly9hcHBzLmFwcGxlLmNvbS9hcHAvYXBwbGUtc3RvcmUvaWQxNDc3Mzc2OTA1P2N0PW5vdGlmaWNhdGlvbi1lbWFpbCZtdD04JnB0PTUyNDY3NQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=L2ZMbFFvL1ZhdjEyQ1NGazc1cFVraHliaEp5U0lERUJmd1BoWnVHU3JiRT0=&h=17d644a0ab0248c0a3d5d756f0f8906b or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tjingboem commented 3 years ago

All PVANAL opcodes are committed except pvcross. The updates can be found: https://csound.com/manual/pvadd.html etc.

csounder commented 3 years ago

Wonderful. They are great.

Dr. Richard Boulanger Professor Electronic Production and Design Berklee College of Music

On Aug 25, 2021, at 12:36 PM, Menno Knevel @.***> wrote:

 All PVANAL opcodes are committed except pvcross. The updates can be found: https://csound.com/manual/pvadd.html etc.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

tjingboem commented 3 years ago

i do believe this example of pvcross is much more entertaining. Still all sound files are to be found in the examples folder, no need to introduce a new one.

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

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

; by Menno Knevel 2021

gilen1  filelen "fox.wav"       ; get length of soundfiles
gilen2  filelen "flute.aiff"    ; these files are all
gilen3  filelen "wave.wav"      ; around 2.7 seconds...

; analyze sound files and output results to pvoc-ex files
ires1 system_i 1,{{ pvanal flutec3.wav flutec3.pvx }}   ; use default settings
ires2 system_i 1,{{ pvanal flute.aiff flute.pvx }} 
ires3 system_i 1,{{ pvanal wave.wav wave.pvx }}  

instr 1 ; untreated signals
asig    diskin2   p4 , 1
print gilen1
print gilen2
print gilen3
prints  "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLES***---\n"
    outs    asig, asig
endin

instr 2

prints  "\n---***YOU NOW HEAR THE RESULT OF THE ANALYZED FILES:***---\n"
ktime1 line 0, p3, gilen1           ; timepointer in "flutec3.pvx" file
kcross expon     0.001, p3, 1
pvbufread ktime1, "flutec3.pvx"     ;take only amplitude from "flute3c.pvx"

if p4 = 0 then
    ktime2 line 0, p3, gilen2       ; timepointer in "flute.pvx"
    kfreq line .5, p3, 2            ; frequency rise
    asig   pvcross  ktime2, kfreq, "flute.pvx", 1-kcross, kcross, p5 ;p5 = preserve spectral envelope
    prints  "--** preserve spectral envelope = %d **--\n", p5
else
    ktime2 line 0, p3, gilen3       ; timepointer in "wave.pvx"
    kfreq line .5, p3, 2            ; frequency rise
    asig   pvcross  ktime2, kfreq, "wave.pvx", 1-kcross, kcross, p5  ;p5 = preserve spectral envelope
    prints  "--** preserve spectral envelope = %d **--\n", p5
endif
    outs asig, asig

endin
</CsInstruments>
<CsScore>
s                       
i1 0 2.76   "flutec3.wav"   ; this is the file to cross with
i1 3 2.62   "flute.aiff"    ; this one, or..
i1 6 2      "wave.wav"      ; this one

s;       sample  formant    ; all slowed down to have a good listen   
i2 0 10     0       0       ; cross flutec3 with the flute, do not preserve formants
i2 10 10    1       0       ; cross flutec3 with wave, do not preserve formants
s;       sample   formant
i2 0 10     0       1       ; cross flutec3 with the flute & preserve formants
i2 10 10    1       1       ; cross flutec3 with wave & preserve formants
e
</CsScore>
</CsoundSynthesizer>
csounder commented 3 years ago

Very nice - inspiring.
I did find a little bug. Your example is all about flute, flutec3 and wave, but... in the beginning you ask it to get the length of the fox.wav rather than flutec3 - I didn't have fox in my test folder and so... I got two errors.

The fix

;gilen1 filelen "fox.wav" ; get length of soundfiles. ---- (remove this line) gilen1 filelen "flutec3.wav" ; get length of soundfiles ---- (replace with this line)

tjingboem commented 3 years ago

ah yes- thanks for checking the example and finding that!

(This was the last example to improve for the Csound Utilities. )