I can see
"API messages treated as: gm"
should clicking on "gm" toggle to "pc"? Seemed like an intuitive toggle, but it simply stays on "gm". I do have a playlist and tracks imported if that matters.
A new version is out in there: https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
- I broke a couple of things with the last round of fixes. That's been corrected.
- Fade In/Fade Out volumes were causing issues when the fade volume was different than the main volume and the main volume was being increased or decreased. I've removed Fade In/Fade Out (for the moment) completely. Fade In will go to Volume Level and Fade Out will go to 0.
- When starting a track that's part of a playlist, playlist volume was being used instead of track volume. This has been changed to use the track volume. If you start a playlist (not an individual track), it will use the playlist volume.
- When starting a track that's part of a playlist, the playlist is set to playing also, so you can quickly see where the music is playing on the Playlists Menu. When the track stops, the playlist is set to stopped. If the track is in multiple lists, multiple playlists will be set to playing and will be stopped upon completion
Currently Working On
- There's no ability to get a text box into chat window, so I'm going to use RollQuery to assign up to 10 groups (Group 1 through Group 10). These may be assigned into tracks across play lists. When you go to the Track Menu, you'll see a new menu that allows you to choose a group (or not). If you choose a group, the track view will display that group. If you don't choose a group, you'll see all tracks that are in Jukebox. This will enable you to create dynamic playlists for specific encounters, etc...
Thanks Victor, I'll give it a test. One thing: I'm not sure if I read the code right, but the version (as written on line 11 of the code) continues to be 2.00. Should that be incrementing so that users can make sure they are replacing any code with something newer? Or is that for some internal purpose? I know the Aaron had suggested people use a version variable in their scripts, so maybe this is that?
LOL we crossed between here and PM. Great minds.....
Oh, I was leaving it at 2 until we are out of beta. You are probably right. I'll do 2.01.
2.01 Deployed
I'm going to implement The Aaron's esRE functions in an attempt to "escape" all of the special characters coming out of Jukebox Track Titles. Some of the titles are causing issues within Roll20AM. I'd really like to avoid forcing people to change track titles in Jukebox.
Are you talking about this guy?
const HE = (() => { const esRE = (s) => s.replace(/(\\|\/|\[|\]|\(|\)|\{|\}|\?|\+|\*|\||\.|\^|\$)/g,'\\$1'); const e = (s) => `&${s};`; const entities = { '<' : e('lt'), '>' : e('gt'), "'" : e('#39'), '@' : e('#64'), '{' : e('#123'), '|' : e('#124'), '}' : e('#125'), '[' : e('#91'), ']' : e('#93'), '"' : e('quot') }; const re = new RegExp(`(${Object.keys(entities).map(esRE).join('|')})`,'g'); return (s) => s.replace(re, (c) => (entities[c] || c) ); })();
for substituting HtmlEntities?
Responded to your PM with the how to Victor:
HE("Here's some problem characters: &@{"); // returns the string 'Here's some problem characters: }@}'
I'm going with encodeURIComponent and decodeURIComponent simply so I don't have to keep adding special characters coming out of Jukebox. If someone sees an issue with this, please let me know. It fixed a couple of tracks I was having headaches with.
A new version (2.02) is deployed to https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
Fixes
- added encoding/decoding to handle special characters in tracks. You shouldn't have to rename your tracks unless Scott or Aaron see an issue with the javascript functions I'm using
- Found a missing menu refresh for track fade out. It wasn't refreshing the menu so the track would still show playing (though it was stopped)
It seems like I've run into some issues with Unicode when passed to decodeURIComponent, but I've got no hard examples. If you start getting errors during the decide, try unescape() (which is deprecated, but I think handles our case better).
New version deployed. https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
- Delay added to process. Add any delay: <number of seconds> to any audio command to delay action on it
-- audio,play,delay:5| <comma delimited list of tracks or playlists>
- Added nomenu so menu's are displayed for macro users. When fade out occurs and the end of the fade out, the menu is refreshed in the chat window to show the track as stopped. For macro users, this isn't wanted.
-- audio,fade,out,nomenu|<comma delimited list of tracks or playlists>
To Do:
- Adding 4 tags that can be used to dynamically create up to 4 playlists. These are "extra" playlists that aren't defined in Jukebox. So you can quickly form up a "tag" of tracks you want for whatever reason. You'll have playlist level functionality over these 4 tags or open them to view/play the individual tracks assigned to them.
When this is done, I'll update help on the WIKI and I'll deploy to GitHub. Once it's deployed you'll need to either 1) get prior version to avoid making changes to your commands or 2) update your commands
Ok, this is final version before pushing it to Github.
- audio,stop| will stop all tracks
- Tags have been added. You'll be able to assign tracks into any of the Tag Lists. You can play a Tag List just like a Play list. You can open a Tag List and view the tracks, remove them or add more. Tag Lists are dynamic playlists so you don't need to go back to Jukebox and modify the play lists there, nor will you need to import them into Roll20AM
1. Changing "Master Volume" from the config menu doesn't seem to have any noticeable effect for me. Is the "Master Volume" supposed to sync with the sidebar settings, "Master music volume level" ?
2. How so I play a group of similarly tagged tracks? Maybe this is done by macro only? Example?
2a. As a test, I tagged each of my tracks as tag1, yet when I choose Tags from the menu, each track has a title "Tag1", "Tag2", "Tag3", and "Tag4". I was expecting all to have the title "Tag1" since I had marked them all tag1. I'm obviously a little confused on how tags should work. See image.
I'm using v2.04. Thanks
Ok, first I found a bug in the menu generation, so if you click on a playlist activity it's bringing up tracks, so I'm working on that.
To your questions
1) Master volume doesn't change existing tracks that are playing. It is a simple way to set the default volume for ALL playlists and tracks. If you want to adjust volume of the track while it is playing use the increase or decrease. You can do that at the playlist level and it will adjust the track that is playing or you can go down to the tracks and adjust it there. You can do the same for Tags. Increase/Decrease the volume and/or click on Tag 1 (or Tag 2, Tag 3, Tag 4) and view the tracks you've assigned to the Tag.
2) Whether looking at playlist tracks (click on playlist name and it shows assigned tracks) or ALL tracks (clicks on Tracks on main menu), you start clicking 1, 2, 3 or 4. Go back to main menu and click on Tags. You'll see Tag 1 through Tag 4. Click on one of the names (Tag 1 for example) and you'll see the tracks you just assigned. If you click the check mark for that track again, it will unassigned the track from that Tag.
3) Tag 1 through Tag 4 are grouping of tracks. For every track you have click 1 for, they will be in the Tag 1. Tag 1 allows you to set the mode (in order, random, together, shuffled, single track) so you can fire off the tracks in that Tag right there or click on the Tag 1 name and you'll see the tracks associated with it and you can manage individual tracks within that tag.
There's two levels within this: Playlists/Tags which enable you to start a play list, choose a mode (keep clicking on Mode until you get the one you want) and manage your music there OR you can view tracks assigned to the playlist, tracks assigned to the Tag or ALL tracks and manage your music at the track level.
Hover your mouse over everything. There's a lot of functionality on these panels.
No worries. I personally like random as a playlist mode. For battle music, I'll set my Battle playlist to random and fire it off. Easy. When battle is done, I'll fade out at the playlist. Easy again.
For weather, I might click on the weather playlist to view the weather related tracks and then start launching one or more of them at the same time. Another option is to set the Weather playlist mode to Together and fire it off. If will play everything at once for some serious weather.
Also keep in mind that at the track level, the mode is single (plays once and stops) or loop (keeps playing). So just like Jukebox, I might set a few tracks at loop, but then go up to the playlist level and play them together. So some will stop (like thunder) and other may continue on (like rain). There's many ways to play with this.
And soon I'll get the commands up on Wiki if you love macros. Everything is macro friendly
v2.05 is deployed
- fixed bug where doing something at the playlist level took you incorrectly to the playlist tracks
- fixed bug where delayed was showing the word button instead of the value 0
https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
Have you imported Jukebox? If so, please recreate this error and copy and paste the log. To do that, keep a page open showing the API. The log is below it. Please PM the log to me. This could be the unicode issue that The Aaron mentioned.
2.06 Deployed - https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
- Fixed a bug where launching the track assigned to the playlist stopped the track but not the playlist
- Condensed Tag Toggles onto same lines Audio Controls
- Updating Help Wiki
Hmmm I built this for 1920/1080 resolution. I'm going to guess yours is less. What's your resolution and I'll need to work with that.
Should be able to do it regardless of resolution. The line height and width of characters doesn't change when your resolution does. It just takes up more of the screen. But regardless of your screenresolution, the chat pane will always be X pixels wide.
Actually, looks like they are getting knocked down a bit. Are you perhaps using two different divs for the play controls and the tags and floating the tags to the right?
Victor B. said:
Hmmm I built this for 1920/1080 resolution. I'm going to guess yours is less. What's your resolution and I'll need to work with that.
1920x1080px is what I'm using. Seems the content of the div is being forced to wrap due to the width of it's content. I made a quick temp fix by adding font-size:80% to the div containing the pictos audio control images.
2.07 Deployed - https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
Fixes
- Changed the format of the Tag Toggles per Vince (thanks!)
- Fixed a bug where if you moved all the tracks out of a playlist in Jukebox, but left the playlist there and then imported into Roll20AM so that playlist was empty om Roll20AM, it would cause java failures.
- Fixed a bug where if you removed an empty playlist from Roll20AM, there would be a java failure
- Add a variable at top of script to Display Tracks. Currently set to false. This will add a "Now Playing: <track title>" to everyone in chat. Keep it off it you don't want it. If you do want it, it's at top of script and set to true. My groups like seriously hard rock during battles.
2.08 deployed - https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0
I messed up Scott's interoperability between roll20AM and other scripts. Scott has shown me the light (thanks Scott!). This is fixed now, so !CRL or anything else should work fine with roll20AM.
NOTE: for anyone calling roll20AM from templates or per other scripts, add nomenu to your command. By default, roll20AM sends menus to the chat window to reflect changes in a track (it stopped or started) or some type of action done against a playlist or track. nomenu suppresses menus out of roll20AM
Example
!roll20AM --audio,play,nomenu|Fireball Spell
The Audio Master Help Wiki has been updated. I'm ready to deploy this. There's a process involved and an approval. Sometime tomorrow, the API will become 2.0.
Again, you'll need to change your commands. Go to help wiki to figure out how or contact me.
I'm having some trouble here. I've put in "!roll20AM --audio,play|City" but nothing is working. It's not playing my track named "City". I've also tried "!roll20AM --audio,stop|" but it's not stopping any of the currently playing tracks. I've got the latest version installed, and when I try the older commands like "!roll20AM --stop" it gives me an error that says that command isn't valid.
Edit: Nevermind, I'm dumb. I didn't realize I had to "import" my tracks first.
Malachi, I made the same mistake, and still occasionally forget. You need to import first, and re-import if you add any tracks to the Jukebox.
Okay, had to update my macros which led me to have this question. Is there any way to take a command line like this:
!roll20AM --audio,play|Broadside
And make it so that if the line is entered while that particular track is playing it will stop ONLY that track and play it again from the beginning?
yes, go into config menu !roll2)AM --config. From within the menu, click on tracks to view all tracks, find the track you want and set the mode to loop. Then run !roll20am audio,play|track and it will keep playing that track continuously until you stop it.
In lieu of using the menus,you can issue this
!roll20AM --edit,mode,loop|track
roll20am went through a major upgrade. The commands have changed. Go to here to view the new commands. https://wiki.roll20.net/Script:Roll20_Audio_Master
What you'll need to do is get into config menu !roll20AM --config. Click remove all (to clear out roll20AM) and click import jukebox (to import everything back into Roll20AM). Then you'll need to modify your commands accordingly
Alternatively you can go to github and get the prior version and you won't need to make any changes.
EDIT: I was responding to a post that disappeared