Csound Csound-dev Csound-tekno Search About

imageopcodes

Date2015-12-18 14:50
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
Subjectimageopcodes
 Ciao a tutti,

sto cercando una soluzione per ricavare da grafici (come  questo
 
) i dati di y (ordinata) nelle coordinate cartesiane in cui il tempo
rappresenta la x (ascisse)

Forse con il gruppo di *imageopcodes*?

Qualche idea per risolvere questa cosa?

Molte grazie per ogni aiuto e suggerimento.

Enrico





--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-19 13:56
FromMenno Knevel
SubjectRe: imageopcodes
i have some experience in using the imageopcodes. I have built, within Blue,
a GUI for an instrument that reads PNG images and plays them. It is based
upon the example from http://csound.github.io/docs/manual/imagegetpixel.html

The image opcodes react to the RGB information in an image. Looking at your
image and seeing the moving lines - they can be converted to sound and be
played. The frequency of the sound will follow the curves of the lines.

But this image has a few properties that you may not want: there is text 
and a border is plotted. That information will be played too, resulting in
case of the border in some constant frequencies. Also, the imageopcodes do
not make any sound if you play a black picture. A white image will result in
noise. So, in this case, the colors of the picture should be inverted, the
line to follow will become white ( and thus contain the RGB colors ) and the
text and border lines removed.




--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745516.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 15:28
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
Hello Menno,

the image I had loaded on it is one of many on which I should work, but it
was not the final one.

Instead here I attached a picture that can - after being inverted colors -
could then be passed (in .png) in Csound. It would be possible?

Admitting that the graph represents the pitch (y) over time (x), my goal is
to extract the first value (pitch) in time, then it can be re-used ...


I do not use Blue but I'd like to see some pictures of your GUI ... or the
csd, you can?

Thanks,
Enrico

 



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745525.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 16:06
FromMenno Knevel
SubjectRe: imageopcodes
Yes - i was curious myself how this would turn out.

In order to produce silence and let the imageopcodes only follow the
trajectory of the lines, i had to:
1. invert the black lines so it became white (= all RGB colors combined)
2. in Gimp with the bucket: fill all the gaps with black (= silence) so only
the line will be played
3. flip the image because the blue instrument assigns the highest position
in th image as the lowest frequency and vica versa

The resulting image:  cage_invert3.png
  

And played in the ImagePlayer instrument with some settings like: sine,
stereo etc.:
cage01.ogg   
It start like in the image, ie. silence. At 1/3 the lines will be played.

About this particular Blue instrument you can read it here:
https://github.com/kunstmusik/blue/wiki/A-Blue-instrument:-ImagePlayer 



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745526.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 16:13
FromMenno Knevel
SubjectRe: imageopcodes
sorry, wrong image. Must be:  cage_invert4.png
  




--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745527.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 16:51
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
Menno... Thanks, very nice,

*but*

what interests me the most is being able to extract values (k) of the pitch
(in time);

it will be possible?

enrico



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745528.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 16:56
FromMenno Knevel
SubjectRe: imageopcodes
Like in the original example
http://csound.github.io/docs/manual/imagegetpixel.html
the scanned frequency values will be filled in the table: gifrqs ftgen
2,0,512,-5, 1,512,10
Perhaps there you can extract these pitch values?



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745529.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 17:08
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
...perhaps the values in the table (-5) are now table in an instant?

but I would like to obtain the values kpitch to pass such opcode "mincer" to
change the frequency, * but in time ; the horizontal space of the graph
becomes the time and I do not know how fast they read the graph opcodes
imagegetopcodes ...



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745531.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 18:43
FromMenno Knevel
SubjectRe: imageopcodes
As it happens, these days i was thinking along the same line, not so much in
my case for use with the mincer opcode but just for the amplitude and
frequency for poscil. 

Once the pixel values are read and put in a table, these values could be
used for freq and amp for example for poscil or mincer. 

I'm afraid i will yet give another (modified) example - this time from The
Csound Book, example 209 - that shows what i am thinking about. 
I'm sorry that i am giving examples all the time, but for me it is the way
to get some grip on the abstraction of code.






sr      =      	48000
ksmps  	=     	32
nchnls	=		2

        instr 209       
idur    =       p3  
iamp    =       p4          
irow    =       12/idur             ; 12 NOTES PER NOTE DURATION
irowrep =       p5*irow             ; NUMBER OF TIMES TO REPEAT THE ROW
kenv    oscil   iamp, irowrep, 10   ; f10 = ENVELOPE FUNCTION
kcnt1   phasor  1/idur              ; COUNTS 0-1 OVER NOTE DURATION
kcnt2   =       kcnt1*12            ; COUNTS 0-12 OVER NOTE DURATION
kcps     table   kcnt2, 38           ; f38 = ROW
asig    poscil   kenv, 400 + kcps       ; sine
        outs asig , asig   
        endin       




f 10 0 1024 -19 1 .5 270 .5
f 38 0 16 -2 200 100 90 10 -100 3 4 0 8 7 6 11

i209 0 4  20000 1  .1

e



I don't know if this is any help to you, but i'm trying like hell...



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745534.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-21 20:37
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
Menno,

about this thing you write:
"** The higher part of the image Corresponds to the lower frequencies, the
bottom to the higher frequencies*"

changing your patch (ImagePlayer) would be possible to do the opposite?
Below the low frequencies and high acute ones?

e



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745536.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-22 12:48
FromMenno Knevel
SubjectRe: imageopcodes
yes, okay.
I will make it an option to choose where the low and high frequencies will
be on the Y axis.
The start time and end time in this instrument allows to read the image from
left to right or right to left.

I hope that in the future it will be possible to show the image in the
instrument itself, so that you can "read the drawing" while it plays
(Top-bottom or bottom-top and Left-right or right-left). The capability of
showing an image is not yet implemented in the Blue Instrument Builder.






--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745543.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-23 15:06
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
Hi Menno,

as you said, I think that the success of digital values is necessary:

1.
be able to wipe away the background so that it is completely black; of
course, to do what is necessary to thoroughly clean the original graph that
shows a white background ... and then invert the colors (white> black /
black> white);

2.
get graphics that do not have excessive and continuous micro-irregularities
in the stretch, this course will result in more routes frequencial net and
not micro jagged.

In fact from the evidence that I conducted the stretch of the graph results
in a path that makes us think about the frequency of micro frequency
modulation, for the very reason that I said above.

do not you think?

enrico



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745559.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-23 16:07
FromMenno Knevel
SubjectRe: imageopcodes
the frequencies, as i see it, derived from a line will not be only one
frequency, but a package of, say, freqs from 300 - 310 Hz, or 280 - 350 Hz.
It depends on the resolution of your image, where higher resolution will
provide a bigger chance to produce that 300 - 310 Hz, or perhjaps 300 - 305,
while a lower resolution image would give 280 - 350 Hz range.

Also, the thickness of the pencil or brush strokes are important in that
regard. A setting lower than 1 pixel is not possible.






--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745565.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-23 18:21
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
yes,
I agree with what you claim ...

Another point I want to overcome:
I would make sure that the image should not be turned upside down to get the
right values (zero down and 1 up), instead I would change anything in the
code to do this,
do you have any idea?

e



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745569.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-23 20:27
FromMenno Knevel
SubjectRe: imageopcodes
When you look at the csd example of
http://csound.github.io/docs/manual/imagegetpixel.html on which my
ImagePlayer is based, you will find this snippet:

......
loop:
    ky_ = kindex/giimageh
.....
...

to flip the scanning of the image, this works:
......
loop:
    ky = 1-(kindex/imageh)
......
...

Because all the values inside the image opcodes are scaled to 0 - 1, it
would mean that when you substract the scanned value from the image scanning
will be flipped, so 1-(kindex/imageh)



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745570.html
Sent from the Csound - General mailing list archive at Nabble.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

Date2015-12-23 22:09
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: imageopcodes
ok! It works.

About your previous message it is clear to me that only affect the values of
pitch (frequency, y) and not the result of sound adsynt.

***

Instead I was wondering:

1.
is properly understood in this way, data of the arguments in the function
(with the GEN 5)?

gifrqs ftgen 2, 0, 1024, -5, 1, 640, 20

iarga = 1 second (action time)
iargb = 640 = width in pixels
iargc = 20 second (Duration)

2.
the image must be necessarily square?



--
View this message in context: http://csound.1045644.n5.nabble.com/imageopcodes-tp5745507p5745571.html
Sent from the Csound - General mailing list archive at Nabble.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