If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

My Jukebox !

I'm slowly pulling together quite a nice music playing facility for ED using VLC, VA and HCS but now want to take things a little further......

Here's the story so far:

so far,I have 20 albums in my iTunes which have playlists created through VLC and stored within each folder, When asked, ASTRA will play
any of them by name and I can also ask her to play the playlist tracks randomly or in normal sequence on the fly, I also have next track/ previous
track fully functional along with raising and lowering the volume. I have also created a custom 80's folder (cos I love the 80's) with only my
favourite 80's tracks in it to the tune of around 70 tracks so far. Soon I'll be creating custom ones for 70's one along with 'Going into Battle' playlist
to play when going into combat.... LOLOL Such fun :-D

So what's my next step then ?

I want to ask ASTRA to choose what to play herself so I would like to, for example, give the voice command and have VA generate a random number
between 1 and ##, each of my playlists I have set up will have their unique ID so the random number will define which playlist to fire up. I would also
like to create a second variable to hold the last created random number so if the next time I make this request it happens to choose the same number then
it will be forced to pick a random again.

I'm familiar with how to use loops & IF statements etc in VA so I feel confident I can pull this together but how do I go about getting VA to generate a random
number between two limits like 1 to 20 for example and assign it to a variable ????

There aren't page numbers in the guide unfortunately, so you'll have to search. In that section is a screenshot where it shows "Set small integer value to:" and one option is: "A random value between # and #". That same window is also where you specify the variable name you'd like to use for the value.

A page or two down from there shows you how to use that in a conditional if statement block. The key to remember is that if you use a Small Integer then you need to use the conditional blocks & other stuff that specifically says "Small Integer compare" (etc) or it won't work. (I.e., you can't semantically interchange a Small Integer with a regular Integer).

I think (but am not 100% certain) there is also a way to "cast" that small integer to a 'regular' Integer if needed; google search or search the VA forums for examples.