Csound Csound-dev Csound-tekno Search About

[Csnd] progress bar/bug in FLprintk ?/rounding

Date2011-06-25 21:32
Fromzappfinger
Subject[Csnd] progress bar/bug in FLprintk ?/rounding
I am creating a small home intercom system, using csound, python and sockets.
For that I use a simple count down display to show the recording time left -
a progress bar would be nice.
In using the count down with FLprintk, I noticed it does not behave as
expected. It should work similar to printk, says the manual, but it does
not. This patch shows it: the printk command goes all the way to 0 (well,
close to), but the FLprintk does not - it stays round the 1.
BTW, is there some rounding opcode, that allows me to display only integer
values?

 
-iadc0 -otest 
 
 
; use for speech 
sr = 8000
;kr = 4410 
ksmps = 1 
nchnls = 1 
;0dbfs = 1 

FLpanel "Count down", 100, 100, 50, 50
    ; Width of the value display box in pixels
    iwidth = 50
    ; Height of the value display box in pixels
    iheight = 20
    ; Distance of the left edge of the value display
    ; box from the left edge of the panel
    ix = 15
    ; Distance of the top edge of the value display
    ; box from the top edge of the panel
    iy = 55
    gih FLvalue "count", iwidth, iheight, ix, iy
; End of panel contents
FLpanelEnd
; Run the widget thread!
FLrun


instr 1 
  	kval line p3, p3, 0
  	; Print the value of kval, once per second.
  	printk 1,kval
  	FLprintk 1,kval,gih
	asig in 
	out asig
endin 


 
 
i	1 0 5

e 
 

--
View this message in context: http://csound.1045644.n5.nabble.com/progress-bar-bug-in-FLprintk-rounding-tp4524430p4524430.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"

Date2011-06-25 21:49
FromVictor Lazzarini
SubjectRe: [Csnd] progress bar/bug in FLprintk ?/rounding
Try this:



-iadc0 -otest


; use for speech
sr = 8000
;kr = 4410
ksmps = 1
nchnls = 1
;0dbfs = 1
FLpanel "Count down", 100, 100, 50, 50
; Width of the value display box in pixels
iwidth = 50
; Height of the value display box in pixels
iheight = 20
; Distance of the left edge of the value display
; box from the left edge of the panel
ix = 15
; Distance of the top edge of the value display
; box from the top edge of the panel
iy = 55
gih FLvalue "count", iwidth, iheight, ix, iy
; End of panel contents
FLpanelEnd
; Run the widget thread!
FLrun
instr 1
kval line p3, p3, -1
; Print the value of kval, once per second.
printk 1,kval
FLprintk 1,int(kval),gih
asig in
out asig
endin


i	1 0 5
e


On 25 Jun 2011, at 21:32, zappfinger wrote:

> I am creating a small home intercom system, using csound, python and  
> sockets.
> For that I use a simple count down display to show the recording  
> time left -
> a progress bar would be nice.
> In using the count down with FLprintk, I noticed it does not behave as
> expected. It should work similar to printk, says the manual, but it  
> does
> not. This patch shows it: the printk command goes all the way to 0  
> (well,
> close to), but the FLprintk does not - it stays round the 1.
> BTW, is there some rounding opcode, that allows me to display only  
> integer
> values?
>
> 
> -iadc0 -otest
> 
> 
> ; use for speech
> sr = 8000
> ;kr = 4410
> ksmps = 1
> nchnls = 1
> ;0dbfs = 1
>
> FLpanel "Count down", 100, 100, 50, 50
>    ; Width of the value display box in pixels
>    iwidth = 50
>    ; Height of the value display box in pixels
>    iheight = 20
>    ; Distance of the left edge of the value display
>    ; box from the left edge of the panel
>    ix = 15
>    ; Distance of the top edge of the value display
>    ; box from the top edge of the panel
>    iy = 55
>    gih FLvalue "count", iwidth, iheight, ix, iy
> ; End of panel contents
> FLpanelEnd
> ; Run the widget thread!
> FLrun
>
>
> instr 1
>  	kval line p3, p3, 0
>  	; Print the value of kval, once per second.
>  	printk 1,kval
>  	FLprintk 1,kval,gih
> 	asig in
> 	out asig
> endin
>
>
> 
> 
> i	1 0 5
>
> e
> 
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/progress-bar-bug-in-FLprintk-rounding-tp4524430p4524430.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"

Date2011-06-25 21:51
FromVictor Lazzarini
SubjectRe: [Csnd] progress bar/bug in FLprintk ?/rounding
Btw, you can use round() or int() functions.

On 25 Jun 2011, at 21:32, zappfinger wrote:

> I am creating a small home intercom system, using csound, python and  
> sockets.
> For that I use a simple count down display to show the recording  
> time left -
> a progress bar would be nice.
> In using the count down with FLprintk, I noticed it does not behave as
> expected. It should work similar to printk, says the manual, but it  
> does
> not. This patch shows it: the printk command goes all the way to 0  
> (well,
> close to), but the FLprintk does not - it stays round the 1.
> BTW, is there some rounding opcode, that allows me to display only  
> integer
> values?
>
> 
> -iadc0 -otest
> 
> 
> ; use for speech
> sr = 8000
> ;kr = 4410
> ksmps = 1
> nchnls = 1
> ;0dbfs = 1
>
> FLpanel "Count down", 100, 100, 50, 50
>    ; Width of the value display box in pixels
>    iwidth = 50
>    ; Height of the value display box in pixels
>    iheight = 20
>    ; Distance of the left edge of the value display
>    ; box from the left edge of the panel
>    ix = 15
>    ; Distance of the top edge of the value display
>    ; box from the top edge of the panel
>    iy = 55
>    gih FLvalue "count", iwidth, iheight, ix, iy
> ; End of panel contents
> FLpanelEnd
> ; Run the widget thread!
> FLrun
>
>
> instr 1
>  	kval line p3, p3, 0
>  	; Print the value of kval, once per second.
>  	printk 1,kval
>  	FLprintk 1,kval,gih
> 	asig in
> 	out asig
> endin
>
>
> 
> 
> i	1 0 5
>
> e
> 
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/progress-bar-bug-in-FLprintk-rounding-tp4524430p4524430.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"

Date2011-06-25 21:54
Fromjoachim heintz
SubjectRe: [Csnd] progress bar/bug in FLprintk ?/rounding
rounding can be done in several ways, for instance with the round()
opcode/function.
for the print opcodes, there is the %d modifier. see for instance the
manual page for printks.
	joachim


Am 25.06.2011 22:32, schrieb zappfinger:
> I am creating a small home intercom system, using csound, python and sockets.
> For that I use a simple count down display to show the recording time left -
> a progress bar would be nice.
> In using the count down with FLprintk, I noticed it does not behave as
> expected. It should work similar to printk, says the manual, but it does
> not. This patch shows it: the printk command goes all the way to 0 (well,
> close to), but the FLprintk does not - it stays round the 1.
> BTW, is there some rounding opcode, that allows me to display only integer
> values?
> 
>  
> -iadc0 -otest 
>  
>  
> ; use for speech 
> sr = 8000
> ;kr = 4410 
> ksmps = 1 
> nchnls = 1 
> ;0dbfs = 1 
> 
> FLpanel "Count down", 100, 100, 50, 50
>     ; Width of the value display box in pixels
>     iwidth = 50
>     ; Height of the value display box in pixels
>     iheight = 20
>     ; Distance of the left edge of the value display
>     ; box from the left edge of the panel
>     ix = 15
>     ; Distance of the top edge of the value display
>     ; box from the top edge of the panel
>     iy = 55
>     gih FLvalue "count", iwidth, iheight, ix, iy
> ; End of panel contents
> FLpanelEnd
> ; Run the widget thread!
> FLrun
> 
> 
> instr 1 
>   	kval line p3, p3, 0
>   	; Print the value of kval, once per second.
>   	printk 1,kval
>   	FLprintk 1,kval,gih
> 	asig in 
> 	out asig
> endin 
> 
> 
>  
>  
> i	1 0 5
> 
> e 
>  
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/progress-bar-bug-in-FLprintk-rounding-tp4524430p4524430.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> 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"