| 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"
|