## Circular Audio Progress bar

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

bogs
Posts: 3786
Joined: Sat Feb 25, 2017 10:45 pm

### Re: Circular Audio Progress bar

LOL! I was playing around with this myself just before stopping in here . I have even bigger questions about it! (Mind you, I had to fire up a Win vm just to play with this at all, it will take weeks to get the taste out of my mouth I'm sure )

Anyway, I was thinking in simple terms (my usual standard), and also hit duration as a possible break down (are you scared yet Richmond? ).

However, i couldn't get an answer for 100/duration

Code: Select all

``put the duration of player 1 into tmpDur; put (100/tmpDur) && "and " & tmpDur``
... which came up with this
0 and 2005950000
~~~~~!

I was expecting an answer more along the lines of this:

Code: Select all

``put 100 / 2005950``
which gave me 0.00005, but for some reason you can't divide 100 by more than so many digits. When doing it on the Windows Calculator program, you get an answer though. Very puzzling to me.

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

Mind you, this is as crappy as with the player:

Code: Select all

``````on mouseUp
put the size of audioClip "a55.aiff" into SZ
put (SZ / 4) into DURANCE
put ((DURANCE / 48000) * 60) into TIX
put (TIX/360) into DIVZ
-----
play audioClip "a55.aiff"
set the startAngle of grc "CRUNCH" to 0
put 0 into DEG
repeat until DEG > 360
set the arcangle of grc "CRUNCH" to DEG
set the label of grc "MASK" to DEG
wait DIVZ ticks with messages
end repeat
-----
end mouseUp``````
I am absolutely sure that this whole problem comes down to the probable situation that
LiveCode is rounding up 0.xxx ticks to 1 tick.

Of course one of the ways round this problem has got to involve chopping up the 360 degrees of a circle into increments
that timed at 1 tick apart will complete the circle in the duration of one's audioClip: although in all likelihood one will
run up against a circular graphic being unable to set an arcangle involving minutes of arc.
Last edited by richmond62 on Wed Oct 02, 2019 9:34 pm, edited 2 times in total.

Klaus
Posts: 11197
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

### Re: Circular Audio Progress bar

richmond62 wrote:
Wed Oct 02, 2019 8:15 pm
I'm afraid we can't!
I really hate that word 'can't'!
That are actually TWO words!

Code: Select all

``````on mouseUp
put the size of audioClip "a55.aiff" into SZ
put (SZ / 4)
end mouseUp``````
Why SZ/4? What does the 4 represent?

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

'cannot' is one word, and 'can't' is an abbreviation of that single word.
What does the 4 represent?
It's a conventional symbol for a number termed 'four' in English, and 'vier' in German.

Seriously . . . if you import 3 random aiff files into a LiveCode stack
and get their respective sizes, then link to those files with players and get those players' duration,
you will find that their sizes as registered by LiveCode are 4 times
their durations when in a player object.

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

I am absolutely sure that this whole problem comes down to the probable situation that
LiveCode is rounding up 0.xxx ticks to 1 tick.
Just confirmed that as my example finishes as the graphic's arcangle reaches about 146 degrees.

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

And just confirmed this:
one will
run up against a circular graphic being unable to set an arcangle involving minutes of arc.
as

Code: Select all

``````on mouseUp
set the arcangle of grc "CRUNCH" to 123.45
put the arcangle of grc "CRUNCH"
end mouseUp``````
puts 123 into the messageBox

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

Off to have a much-needed bath: maybe, just maybe, something will occur to me . . .
-

Klaus
Posts: 11197
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

### Re: Circular Audio Progress bar

richmond62 wrote:
Wed Oct 02, 2019 8:40 pm
'cannot' is one word, and 'can't' is an abbreviation of that single word.
Ah, really was not aware of that, always thought that "cannot" is some kind of "slang" for "can not"! Go figure!
richmond62 wrote:
Wed Oct 02, 2019 8:40 pm
What does the 4 represent?
Seriously . . . if you import 3 random aiff files into a LiveCode stack
and get their respective sizes, then link to those files with players and get those players' duration,
you will find that their sizes as registered by LiveCode are 4 times
their durations when in a player object.
Oh, I see, so you really handled this with a serious empirical approach!

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

a serious empirical approach
Well: I am an admirer of John Locke and Francis Hutcheson.

dpalmersce@gmail.com
Posts: 25
Joined: Wed Aug 28, 2019 4:58 pm

### Re: Circular Audio Progress bar

I would really like to thank everyone for their help. I used -hh's script method and it worked perfect for what I was doing. So special thanks to -hh. Good to know there are people out there that are willing to share their knowledge!

richmond62
Livecode Opensource Backer
Posts: 3596
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

### Re: Circular Audio Progress bar

Just confirmed that as my example finishes as the graphic's arcangle reaches about 146 degrees.
On a 2018 Mac Mini running Mac OS 10.14.6 (LC 9.5.0)

and . . . .

about 67 degrees on a 2006 iMac running Mac OS 10.7.5 (LC 8.1.8 )

which is very odd indeed.
-
quandary.png (28.99 KiB) Viewed 177 times