Csound Csound-dev Csound-tekno Search About

Re: outline for chrono-proportional score

Date2017-01-22 20:30
FromAndrea Strappa
SubjectRe: outline for chrono-proportional score
thank you Victor! Very useful!
Below  there's the file correct with your help (file name path should be replaced for testing, of course).
But there's some line unexpected in second png file processed.
Maybe is there some critical question on management of images with csound?
Andrea S.
 
<CsoundSynthesizer>
<CsOptions>
;-n
-odac
;-o image_prova_13.wav
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1
0dbfs=1
 
gasig init 0
giimagew = 1000 ;image width in pixel
giimageh = 100 ;image high in pixel
giimage  imagecreate giimagew, giimageh
gicount init 0 ;saved images counter
 
instr 1 ;out process example
ifreq = cpspch(9.00)
iexpfun ftgen 1, 0, 16384, 5, 1, 8196, .1, 8196, 1
kintvl oscil 1, .35, 1
asig mpulse 1, kintvl
gasig reson asig, ifreq, 20
out gasig * .07
endin
 
instr 90 ;draw outline
iimgsec  = p4 ;secs for every image, refresh time
reset:
timout 0, iimgsec, draw
schedule 91, 0, .5
reinit reset
draw:
kx  line 0, iimgsec, 1 ;iimgsec = HOW MANY SECONDS IN A PNG FILE
ay  follow gasig, .001 ;instr out profile
imagesetpixel giimage, kx, 1-ay, 1, 1, 1
endin
 
instr 91 ;save file
if gicount == 0 goto next
;---------
ifn = gicount ;routine for series of file names with numeric progression
Sname sprintf "C:\Andrea\csound\prove_varie\image_%02d.png", ifn
Smsg  sprintf "The file name is: '%s'", Sname
      puts    Smsg, 1
;---------
imagesave giimage, Sname
imagefree giimage
giimage  imagecreate giimagew, giimageh
next:
gicount = gicount + 1
print gicount
endin
</CsInstruments>
 
<CsScore>
f0 z ;indefinited performance duration to ensure 'schedule' activation
i1  0 10
i90 0 14  4 ;p4 = iimgsec. Remember to set p3 = 'iimgsec' + p3 of out instr
;i3 is an instrument activated by 'schedule'
e
</CsScore>
</CsoundSynthesizer>
 
 
 
 
----- Original Message -----
Sent: Sunday, January 22, 2017 4:37 PM
Subject: Re: [Csnd] outline for chrono-proportional score

you can use sprintf for file name strings

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 22 Jan 2017, at 15:19, Andrea Strappa <a_strappa@TIN.IT> wrote:

hi list,
I attach a csd file that I elaborated for drawing in series of png file the whole sound outline, also very long, of whole sound processing.
Unfortunately there is't now (I suppose) a way for saving multiple files named with progressive integer numbers (gicount).
And I can save only last png file processed.
Any idea?
Will be a good point on the agenda for next Csound release?
All the best.
Andrea S.

<CsoundSynthesizer>
<CsOptions>
;-n
-odac
;-o image_prova_13.wav
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1
0dbfs=1
 
gasig init 0
giimagew = 1000 ;image width in pixel
giimageh = 100 ;image high in pixel
gimage1  imagecreate giimagew, giimageh
gicount init 0 ;saved images counter
 
instr 1 ;out process example
ifreq = cpspch(9.00)
iexpfun ftgen 1, 0, 16384, 5, 1, 8196, .1, 8196, 1
kintvl oscil 1, .25, 1
asig mpulse 1, kintvl
gasig reson asig, ifreq, 20
out gasig * .07
endin
 
instr 2 ;draw outline
iimgsec  = p4 ;secs for every image, refresh time
reset:
timout 0, iimgsec, draw
schedule 3, 0, 1
reinit reset
draw:
kx  line 0, iimgsec, 1 ;iimgsec = HOW MANY SECONDS IN A PNG FILE
ay  follow gasig, .001 ;instr out profile
imagesetpixel gimage1, kx, 1-ay, 1, 1, 1
endin
 
instr 3 ;save file
gicount = gicount + 1
print gicount
imagesave gimage1, "C:\Andrea\csound\prove_varie\image_prova_13.png"
;for multiple images, it is necessary an opcode for naming file with numeric progression
;is it lacking an opcode that convert integer to string?
imagefree gimage1
gimage1  imagecreate giimagew, giimageh
endin
</CsInstruments>
 
<CsScore>
f0 z ;indefinited performance duration to ensure 'schedule' activation
i1 0 6 ;p4 = ifreq
i2 0 9 3 ;p4 = iimgsec. Remember to set p3 = 'iimgsec' + p3 of out instr
;i3 is an instrument activated by 'schedule'
e
</CsScore>
</CsoundSynthesizer>
 



Avast logo

Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



Avast logo

Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com



Date2017-01-22 20:38
FromVictor Lazzarini
SubjectRe: outline for chrono-proportional score
Sorry, can't help you there, I don't know anything about png files.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 22 Jan 2017, at 20:30, Andrea Strappa <a_strappa@TIN.IT> wrote:

thank you Victor! Very useful!
Below  there's the file correct with your help (file name path should be replaced for testing, of course).
But there's some line unexpected in second png file processed.
Maybe is there some critical question on management of images with csound?
Andrea S.
 
<CsoundSynthesizer>
<CsOptions>
;-n
-odac
;-o image_prova_13.wav
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1
0dbfs=1
 
gasig init 0
giimagew = 1000 ;image width in pixel
giimageh = 100 ;image high in pixel
giimage  imagecreate giimagew, giimageh
gicount init 0 ;saved images counter
 
instr 1 ;out process example
ifreq = cpspch(9.00)
iexpfun ftgen 1, 0, 16384, 5, 1, 8196, .1, 8196, 1
kintvl oscil 1, .35, 1
asig mpulse 1, kintvl
gasig reson asig, ifreq, 20
out gasig * .07
endin
 
instr 90 ;draw outline
iimgsec  = p4 ;secs for every image, refresh time
reset:
timout 0, iimgsec, draw
schedule 91, 0, .5
reinit reset
draw:
kx  line 0, iimgsec, 1 ;iimgsec = HOW MANY SECONDS IN A PNG FILE
ay  follow gasig, .001 ;instr out profile
imagesetpixel giimage, kx, 1-ay, 1, 1, 1
endin
 
instr 91 ;save file
if gicount == 0 goto next
;---------
ifn = gicount ;routine for series of file names with numeric progression
Sname sprintf "C:\Andrea\csound\prove_varie\image_%02d.png", ifn
Smsg  sprintf "The file name is: '%s'", Sname
      puts    Smsg, 1
;---------
imagesave giimage, Sname
imagefree giimage
giimage  imagecreate giimagew, giimageh
next:
gicount = gicount + 1
print gicount
endin
</CsInstruments>
 
<CsScore>
f0 z ;indefinited performance duration to ensure 'schedule' activation
i1  0 10
i90 0 14  4 ;p4 = iimgsec. Remember to set p3 = 'iimgsec' + p3 of out instr
;i3 is an instrument activated by 'schedule'
e
</CsScore>
</CsoundSynthesizer>
 
 
 
 
----- Original Message -----
Sent: Sunday, January 22, 2017 4:37 PM
Subject: Re: [Csnd] outline for chrono-proportional score

you can use sprintf for file name strings

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 22 Jan 2017, at 15:19, Andrea Strappa <a_strappa@TIN.IT> wrote:

hi list,
I attach a csd file that I elaborated for drawing in series of png file the whole sound outline, also very long, of whole sound processing.
Unfortunately there is't now (I suppose) a way for saving multiple files named with progressive integer numbers (gicount).
And I can save only last png file processed.
Any idea?
Will be a good point on the agenda for next Csound release?
All the best.
Andrea S.

<CsoundSynthesizer>
<CsOptions>
;-n
-odac
;-o image_prova_13.wav
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1
0dbfs=1
 
gasig init 0
giimagew = 1000 ;image width in pixel
giimageh = 100 ;image high in pixel
gimage1  imagecreate giimagew, giimageh
gicount init 0 ;saved images counter
 
instr 1 ;out process example
ifreq = cpspch(9.00)
iexpfun ftgen 1, 0, 16384, 5, 1, 8196, .1, 8196, 1
kintvl oscil 1, .25, 1
asig mpulse 1, kintvl
gasig reson asig, ifreq, 20
out gasig * .07
endin
 
instr 2 ;draw outline
iimgsec  = p4 ;secs for every image, refresh time
reset:
timout 0, iimgsec, draw
schedule 3, 0, 1
reinit reset
draw:
kx  line 0, iimgsec, 1 ;iimgsec = HOW MANY SECONDS IN A PNG FILE
ay  follow gasig, .001 ;instr out profile
imagesetpixel gimage1, kx, 1-ay, 1, 1, 1
endin
 
instr 3 ;save file
gicount = gicount + 1
print gicount
imagesave gimage1, "C:\Andrea\csound\prove_varie\image_prova_13.png"
;for multiple images, it is necessary an opcode for naming file with numeric progression
;is it lacking an opcode that convert integer to string?
imagefree gimage1
gimage1  imagecreate giimagew, giimageh
endin
</CsInstruments>
 
<CsScore>
f0 z ;indefinited performance duration to ensure 'schedule' activation
i1 0 6 ;p4 = ifreq
i2 0 9 3 ;p4 = iimgsec. Remember to set p3 = 'iimgsec' + p3 of out instr
;i3 is an instrument activated by 'schedule'
e
</CsScore>
</CsoundSynthesizer>
 



Avast logo

Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



Avast logo

Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-01-25 19:27
FromOeyvind Brandtsegg
SubjectRe: outline for chrono-proportional score
Hi Andrea,
I tested the csd and it seems to run (sort of) fine here. I don't fully understand how it should exit, and it hangs (just stays open) after producing 3 images.
I needed to terminate csound with Ctrl+C
The images are black with some white downward exponential slopes

The console print is 

SECTION 1:
new alloc for instr 1:
ftable 1:
ftable 1:       16384 points, scalemax 1.000
_
 .                                                                             .
  '.                                                                         .'
    '._                                                                   _-'
       -.                                                               .-
         '-._                                                       _.-'
             -._                                                 _.-
                ''-._                                       _.-''
                     ''--.__                         __.--''
                            '''--...._______....--'''
new alloc for instr 90:
new alloc for instr 91:
instr 91:  gicount = 1.000
  rtevent:         T  4.000 TT  4.000 M:  0.91419
The file name is: 'image_01.png'
instr 91:  gicount = 2.000
  rtevent:         T  8.000 TT  8.000 M:  0.91410
The file name is: 'image_02.png'
instr 91:  gicount = 3.000
  rtevent:         T 12.000 TT 12.000 M:  0.91325
The file name is: 'image_03.png'
instr 91:  gicount = 4.000

csound command: Interrupt
csoundPerform(): stopped.
inactive allocs returned to freespace
end of score.              overall amps:  0.91419
           overall samples out of range:        0
0 errors in performance


best
Oeyvind


2017-01-22 12:38 GMT-08:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
Sorry, can't help you there, I don't know anything about png files.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 22 Jan 2017, at 20:30, Andrea Strappa <a_strappa@TIN.IT> wrote:

thank you Victor! Very useful!
Below  there's the file correct with your help (file name path should be replaced for testing, of course).
But there's some line unexpected in second png file processed.
Maybe is there some critical question on management of images with csound?
Andrea S.
 
<CsoundSynthesizer>
<CsOptions>
;-n
-odac
;-o image_prova_13.wav
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1
0dbfs=1
 
gasig init 0
giimagew = 1000 ;image width in pixel
giimageh = 100 ;image high in pixel
giimage  imagecreate giimagew, giimageh
gicount init 0 ;saved images counter
 
instr 1 ;out process example
ifreq = cpspch(9.00)
iexpfun ftgen 1, 0, 16384, 5, 1, 8196, .1, 8196, 1
kintvl oscil 1, .35, 1
asig mpulse 1, kintvl
gasig reson asig, ifreq, 20
out gasig * .07
endin
 
instr 90 ;draw outline
iimgsec  = p4 ;secs for every image, refresh time
reset:
timout 0, iimgsec, draw
schedule 91, 0, .5
reinit reset
draw:
kx  line 0, iimgsec, 1 ;iimgsec = HOW MANY SECONDS IN A PNG FILE
ay  follow gasig, .001 ;instr out profile
imagesetpixel giimage, kx, 1-ay, 1, 1, 1
endin
 
instr 91 ;save file
if gicount == 0 goto next
;---------
ifn = gicount ;routine for series of file names with numeric progression
Sname sprintf "C:\Andrea\csound\prove_varie\image_%02d.png", ifn
Smsg  sprintf "The file name is: '%s'", Sname
      puts    Smsg, 1
;---------
imagesave giimage, Sname
imagefree giimage
giimage  imagecreate giimagew, giimageh
next:
gicount = gicount + 1
print gicount
endin
</CsInstruments>
 
<CsScore>
f0 z ;indefinited performance duration to ensure 'schedule' activation
i1  0 10
i90 0 14  4 ;p4 = iimgsec. Remember to set p3 = 'iimgsec' + p3 of out instr
;i3 is an instrument activated by 'schedule'
e
</CsScore>
</CsoundSynthesizer>
 
 
 
 
----- Original Message -----
Sent: Sunday, January 22, 2017 4:37 PM
Subject: Re: [Csnd] outline for chrono-proportional score

you can use sprintf for file name strings

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 22 Jan 2017, at 15:19, Andrea Strappa <a_strappa@TIN.IT> wrote:

hi list,
I attach a csd file that I elaborated for drawing in series of png file the whole sound outline, also very long, of whole sound processing.
Unfortunately there is't now (I suppose) a way for saving multiple files named with progressive integer numbers (gicount).
And I can save only last png file processed.
Any idea?
Will be a good point on the agenda for next Csound release?
All the best.
Andrea S.

<CsoundSynthesizer>
<CsOptions>
;-n
-odac
;-o image_prova_13.wav
</CsOptions>
<CsInstruments>
sr=44100
ksmps=1
nchnls=1
0dbfs=1
 
gasig init 0
giimagew = 1000 ;image width in pixel
giimageh = 100 ;image high in pixel
gimage1  imagecreate giimagew, giimageh
gicount init 0 ;saved images counter
 
instr 1 ;out process example
ifreq = cpspch(9.00)
iexpfun ftgen 1, 0, 16384, 5, 1, 8196, .1, 8196, 1
kintvl oscil 1, .25, 1
asig mpulse 1, kintvl
gasig reson asig, ifreq, 20
out gasig * .07
endin
 
instr 2 ;draw outline
iimgsec  = p4 ;secs for every image, refresh time
reset:
timout 0, iimgsec, draw
schedule 3, 0, 1
reinit reset
draw:
kx  line 0, iimgsec, 1 ;iimgsec = HOW MANY SECONDS IN A PNG FILE
ay  follow gasig, .001 ;instr out profile
imagesetpixel gimage1, kx, 1-ay, 1, 1, 1
endin
 
instr 3 ;save file
gicount = gicount + 1
print gicount
imagesave gimage1, "C:\Andrea\csound\prove_varie\image_prova_13.png"
;for multiple images, it is necessary an opcode for naming file with numeric progression
;is it lacking an opcode that convert integer to string?
imagefree gimage1
gimage1  imagecreate giimagew, giimageh
endin
</CsInstruments>
 
<CsScore>
f0 z ;indefinited performance duration to ensure 'schedule' activation
i1 0 6 ;p4 = ifreq
i2 0 9 3 ;p4 = iimgsec. Remember to set p3 = 'iimgsec' + p3 of out instr
;i3 is an instrument activated by 'schedule'
e
</CsScore>
</CsoundSynthesizer>
 



Avast logo

Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



Avast logo

Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here