Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Roll20 Audio Master -- Hear the dice, Hear the action!

Thanks! Is there any way to set that as a default option on playing tracks? I couldn't find it in the configuration.
1531854624
Victor B.
Pro
Sheet Author
API Scripter
Not yet.  
1531928668

Edited 1531928696
So I had this on a previous campaign for about a year, but when I load it into my current campaign I cannot get anything to play as a macro. I'm wanting a pretty simple use case: click a general macro reading:  !roll20AM --play|XP Which would play the song XP once as it was set in jukebox to not repeat. I've set things up pretty much the same on a new campaign, and I guess the coding has been updated to: !roll20AM --audio,play|XP But nothing plays. What am I doing wrong here?
1531931612

Edited 1531931624
Victor B.
Pro
Sheet Author
API Scripter
Did you import jukebox into roll20AM?  Also, you'll want !roll20AM --audio,play,nomenu|XP in order to prevent the default menu displays from happening.  
The option doesn't appear to be working in the config. I click it and it breaks my api. It looks like this and AuraHealth have some conflicts, so that's probably the root of the issue.
Going to stick with Aurahealth as it provides a bit more of what I need for this campaign, thank you for responding to promptly! I really appreciate it!
1531933102
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Victor, since the import step takes no real time to do, should it be triggered upon spinup of the sandbox (if possible)? That won't help as people add to the Jukebox during a session, but it will ensure that a first-time run of the script commands won't fail. My guess is that adding a track to the Jukebox is not an action that the API can be aware of?
1531935459
Victor B.
Pro
Sheet Author
API Scripter
If you wish @encartrus, please invite me to game and promote me to GM so I can take a look why it's breaking.  Are you running 2.10?  It fixed a nasty issue with duplicate tracks.   @keithcurtis, I'm not triggering an auto-import thought I could.  It's made to be incremental so I will only add new tracks if existing are already found.  I'll consider that for next release.  
1532027021
Victor B.
Pro
Sheet Author
API Scripter
2.11 Deployed.&nbsp; Pick it up here or wait until next Tuesday for Github.&nbsp;&nbsp; <a href="https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0" rel="nofollow">https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0</a> Fixes another nasty bug (thanks encartrus) where launching tracks directly against jukebox was triggering roll20AM upon track completion and roll20AM was getting very very confused.&nbsp;&nbsp;
1532027111
Victor B.
Pro
Sheet Author
API Scripter
@kiethcurtis, yes, there are triggers on adding and deleting tracks against Jukebox.&nbsp; The issue I found is that these triggers were getting invoked when they shouldn't have, so I disabled them.&nbsp; I'll revisit that functionality.&nbsp;&nbsp;
Thanks for figuring this out, Victor!
Is there anyway to list tracks for players? The only way I can see the list is through the config menu which is GM only.
1532182411
Victor B.
Pro
Sheet Author
API Scripter
Not currently.&nbsp; The entire output is set to whisper to the GM.&nbsp; I could add a display feature, but then EVERYTHING would be displayed to players.&nbsp; Then I guess you could shut it off.&nbsp; Would that work?&nbsp;&nbsp;
1532183479

Edited 1532186497
That's great. Even if I could somehow give players access to the config menus and then later take it away if need be. I want to give one player in my group access to the music. Update: on the output config of the script, i just changed the " /w gm" to "/w 'character name'" and also gave myself control of his character. This way it seems to send the config menus to both of us.&nbsp;
1532190438

Edited 1532190629
Victor B.
Pro
Sheet Author
API Scripter
I'm working on adding something that enables you to allow one or all players to view menus.&nbsp; GM will always see the menus.&nbsp; I'm going to integrate it so that you can use the access at the playlist/track level in addition, so you can grant privileges for a player to view all menus and then control which playlists/tracks they can use.&nbsp;&nbsp;
Today Roll20AM suddenly stopped responding. It was giving error messages for a while but after disabling/reenabling/restarting/removing/readding, the API has stopped responding. I'm not sure what's going on with it.
1532215981
Victor B.
Pro
Sheet Author
API Scripter
Soul, I'll need a bit more info.&nbsp; What's the error message?&nbsp; What version are you running?&nbsp;
Latest Version Message: &nbsp;Invalid Roll20AM Command. Valid commands are --audio, --edit, --config when I try to do !roll20AM --play
Not sure if this is related: TypeError: Cannot set property 'playing' of undefined TypeError: Cannot set property 'playing' of undefined at changeHandler (apiscript.js:7381:38) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1028:14) at updateLocalCache (/home/node/d20-api-server/api.js:1318:18) at /home/node/d20-api-server/api.js:1530:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
1532222389

Edited 1532353589
Victor B.
Pro
Sheet Author
API Scripter
You have two choices: 1) Go to github and get version 1.05 and create a new audio script, save the source (make sure to click RAW in github before copying the code) and it will work for you again, 2) Roll20AM has been upgraded to 2.11.&nbsp; Get that version here&nbsp; <a href="https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0" rel="nofollow">https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0</a>, &nbsp;but you need to change your commands to&nbsp; !roll20AM --audio,play,nomenu|&lt;track&gt;
1532222494
Victor B.
Pro
Sheet Author
API Scripter
If you choose to upgrade, you'll need to bring up the config menu !roll20AM --config.&nbsp; Then click remove all followed by clicking import jukebox.&nbsp; This will set you up.&nbsp;&nbsp;
Ah, thanks. I hadn't realized it was upgraded and was looking this up while in the middle of a session. Much appreciated for the help, Victor, B! :D
Heya, Victor. As I'm working on updating all script calls among my characters (and my NPCs, and my fellow players' PCs-- O! the curse of being the technically-minded one!) , I'm not re-finding a small (but important to me) piece of functionality in your redesign of R20AM: Specifically, I want to have a playlist of sounds, e.g. fx-eldritchblast , from which I can play a single track at random . Play mode single isn't quite what I want since it plays each track in sequence. And random 's looping-until-stopped behavior won't work as one line among many in a token action button. Is the functionality there, and I'm just missing it? If not, would you please consider adding its return to your development roadmap?
1532265381
Victor B.
Pro
Sheet Author
API Scripter
No functionality isn't there yet.&nbsp; Random play continues to play tracks randomly until the playlist is stopped or faded out,.&nbsp; A random, single is additional functionality.&nbsp; You're the second person requesting this, so I'll put this into the next release.&nbsp;&nbsp;
Awesome. Thanks!
Hello Victor,&nbsp; Thanks for your work. I had a question about a set of macros I am trying to make. Disclaimer: I am in no way good at coding. I take others ideas from around the forums and try to implement them into my game, and tweak variables until they work for me. I am having some difficulties setting up macros for playing music off of tokens.&nbsp; I have:&nbsp; ▶️ " !roll20AM --audio,play|@{selected|token_name} " This allows me to name a token after a jukebox track, and after importing it into the jukebox I can run this macro with the token selected and the song plays. An example of my usage is for the Theme at the beginning of my games. One and done. ⏹️ " !roll20AM --audio,stop|@{selected|token_name} " This allows me to do the opposite, clicking on the token and stopping the track after activating the macro. The problem child is:&nbsp; 🔁 "&nbsp;!roll20AM --audio,play,loop,|@{selected|token_name} " The intention of this one is to allow me to run combat music with a click, and to not have to worry about it until combat is over, where I hit the stop button. However, it doesn't function at all how i'd like. The "loop" action/variable seems to have no affect on whether or not it loops. I noticed that I have to manually open the config and hit the playmode button to set the track to loop for this to work properly. But then, on the flip side, when I hit the "play" macro on a song I want to play once on this occasion but also looped for others, the song will loop, even when not specified to in the macro.&nbsp; Your script is amazing, and has been very fun to use. I understand that this is a very specific and somewhat redundant thing I'm asking for, and I apologize ahead of time if this just isn't the functionality that can be offered. Like I said, I am no good at coding. As far as I know, everything I've done is write in the code, and I'm just wondering if it's on my end or Roll20's limitations.&nbsp; Thanks again, -Jared
1532311089

Edited 1532317525
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There's a syntax error in your looping macro which might be causing your problem. You have an extra comma after the loop command word. Try: &nbsp;!roll20AM --audio,play,loop|@{selected|token_name} Victor's answer is better. As in, correct.
1532311707
Victor B.
Pro
Sheet Author
API Scripter
Loop, single have been taken out of the audio commands and moved to edit, so you edit it once (either via command or via menu) and you don't need to worry about it again.&nbsp;Set the TRACK to loop (it defaults to single) and when you launch the track it will continuously loop until you stop it or fade it out.&nbsp;&nbsp; I'm honestly not clear on what you're asking.&nbsp; There are times you want the same track to run once and others you want to run in loop mode?&nbsp; &nbsp;&nbsp; You can modify track (or playlist) behavior by placing an edit command before the audio.&nbsp;&nbsp; !roll20AM --edit,mode,single(or loop)|@{selected|token_name} --audio,play|@{selected|token_name} If you are launching a track via macro, add nomenu to it so the menu display is suppressed.&nbsp; It will display another menu when track stops to show the track as being stopped.&nbsp; !roll20AM --audio,play, nomenu |@{selected|token_name}
Hi everybody, After one of the tecent changes I have a problem with achieving my goal.&nbsp; I would like to have ability to use macro to play some fx sound i.e. shotgun blast while playing background musi.. Both sounds should be played laterally/simultanously. It was feasible previously, so I hope that it is possible after recent realease but I cannot find solution. Regards Sylwester
1532349801

Edited 1532353342
Victor B.
Pro
Sheet Author
API Scripter
Mulltiple sounds play simultaneously.&nbsp; Launch the background music !roll20AM --audio,play|&lt;background music&gt;, launch the fx !roll20AM --audio,play|&lt;fx&gt;, ORr launch both at same time&nbsp; !roll20AM --audio,play,nomenu|&lt;background music&gt;,&lt;fx&gt; OR launch the fx and a playlist of background music&nbsp; !roll20AM --audio,play,nomenu|&lt;fx&gt;,&lt;playlist
1532353041

Edited 1532353333
Victor B.
Pro
Sheet Author
API Scripter
There's two new pieces being worked on Access to Roll20AM and Random Single Mode Menus may be viewed by: GM (Only), All (all players), Individual Player (drop list list of players to choose from). Access: None (no player access to tracks or playlists), Full (full access to tracks or playlists), Limited (GM has to go through tracks and playlists and click the padlock icon in order to enable access)
1532353507
Victor B.
Pro
Sheet Author
API Scripter
Random Playlist Mode Random Loop !roll20AM --edit,mode,random,loop|&lt;playlist&gt; or comma separated lists of playlists, plays tracks randomly (may play same track twice) until playlist is stopped Random Single !roll20AM --edit,mode,random,single|&lt;playlist&gt; or comma separated lists of playlists, plays a single track randomly and then stops
1532357889

Edited 1532357898
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nice changes. I like the Player Permissions. Now a campaign can have its own DJ!
Victor B. said: Mulltiple sounds play simultaneously.&nbsp; Launch the background music !roll20AM --audio,play|&lt;background music&gt;, launch the fx !roll20AM --audio,play|&lt;fx&gt;, ORr launch both at same time&nbsp; !roll20AM --audio,play,nomenu|&lt;background music&gt;,&lt;fx&gt; OR launch the fx and a playlist of background music&nbsp; !roll20AM --audio,play,nomenu|&lt;fx&gt;,&lt;playlist Dear Victor, I use following syntax "/w gm !roll20AM --audio,play|Thunder" and nothing happens. Before recent changes it was working. Is any ediional step required? The track was added to the Jukebox manually.
1532379008
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
the "/w gm" is not needed. By default, lines beginning with "!" (API scripts, mostly) do not echo to chat.
keithcurtis said: the "/w gm" is not needed. By default, lines beginning with "!" (API scripts, mostly) do not echo to chat. Thanks, didn't know that although removing that part doesn't solve the problem.
1532384842
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I see that you "added to the jukebox manually". You'll need to run config, click remove all, then re-import the jukebox. This is necessary upon adding or deleting tracks from the jukebox.
I have been following this script thread for quite some time but I have not gotten around to trying it yet. It looks like an amazing script! I'm wondering if what I'd like to do can be accomplished; I'd like to be able to pause a background music playlist (looping) while I play a battle track or playlist (looping) and then resume after stopping the battle music. It (pausing) doesn't appear to be a function of the script - it certainly isn't a function of Roll20's jukebox. Is there a workaround someone could recommend?
1532385259

Edited 1532386184
Victor B.
Pro
Sheet Author
API Scripter
Doug,&nbsp; I'm afraid pause isn't a possibility.&nbsp; There's no "progress" within Jukebox.&nbsp; There's no way to know out of Jukebox where you are at within the Track.&nbsp; If this was possible (such as Jukebox showing that the track has played to the 48.05% mark) pause would be possible, unfortunately it isn't.&nbsp;&nbsp; The only thing I could recommend is that you set the Background Playlist to Loop. Fade out the Background Playlist (it knows which tracks have played and which haven't).&nbsp; Fade in your battle music at the same time.&nbsp; Then do the opposite upon completion of the battle and the background playlist will start up with the next track in the list.&nbsp;&nbsp;
1532385319
Victor B.
Pro
Sheet Author
API Scripter
Sylwester, easiest way to resolve this is that you invite me to your game and then promote me to GM so I can look at what's going on.&nbsp;&nbsp;
Victor B. said: Doug,&nbsp; I'm afraid pause isn't a possibility.&nbsp; There's no "progress" within Jukebox.&nbsp; There's no way to know out of Jukebox where you are at within the Track.&nbsp; If this was possible (such as Jukebox showing that the track has played to the 48.05% mark) pause would be possible, unfortunately it isn't.&nbsp;&nbsp; The only thing I could recommend is that you set the Background Playlist to Loop. Fade out the Background Playlist (it knows which tracks have played and which haven't).&nbsp; Fade in your battle music at the same time.&nbsp; Then do the opposite upon completion of the battle and the background playlist will start up with the next track in the list.&nbsp;&nbsp; Actually, that would be awesome. I don't need to pause within the track to play the battle music, coming back to the next track in the background playlist is all I need. (I have long background playlists and usually the later tracks never get played 'cuz I have to start over). Thank you!
1532388949

Edited 1532388973
Victor B.
Pro
Sheet Author
API Scripter
Two other options for your playlists: Random (which if you have a lot of tracks in the playlist means you'll never know what you get but you can get the same track twice) or Shuffled (shuffles in a random order and then plays from beginning to end based on that shuffled order).&nbsp; Nice when you don't want the same songs playing all the time but don't have enough tracks for random play.&nbsp;&nbsp;
1532441224
Victor B.
Pro
Sheet Author
API Scripter
@Sylwester, I might know the cause of your issue.&nbsp;&nbsp; When I display the tracks in the menus, I cut out everything after the 'by' in order to save space.&nbsp; So Combat Drums by Byrn is displayed as Combat Drums within Roll20AM.&nbsp;&nbsp; Make sure you put the full name of the track into audio,play!&lt;track name&gt;
Victor B. said: Sylwester, easiest way to resolve this is that you invite me to your game and then promote me to GM so I can look at what's going on.&nbsp;&nbsp; Hi Victor, I've just send you and invitation to my game. Victor B. &nbsp;said: @Sylwester, I might know the cause of your issue.&nbsp;&nbsp; When I display the tracks in the menus, I cut out everything after the 'by' in order to save space.&nbsp; So Combat Drums by Byrn is displayed as Combat Drums within Roll20AM.&nbsp;&nbsp; Make sure you put the full name of the track into audio,play!&lt;track name&gt;&nbsp; I thnk that could be reason - I also shorten the track names in Jukebox. If it won't help I will check also solution given by&nbsp; keithcurtis .
So, I found something that causes a script error... If you change the name of a playlist in the Jukebox, it has no effect on roll20AM, so the playlist(s) still show(s) up.&nbsp; If you then attempt to delete the playlist in the API, it returns an invalid value (null pointer?) and crashes the sandbox. Is there a way without "Remove All" and "Import Jukebox" to get rid of the null list?&nbsp; There are quite a few tracks I'd have to reconfigure to be playable by players and other things I might not even remember them all? Also, when you set a Playlist to be usable by players, does it make everything in that playlist usable or do the tracks need that flag set individually? For example, if you have a weapon play a --audio,play,nomenu|&lt;SwordsPlaylist&gt; of sounds from the character sheet does it know that the tracks within that Playlist are to be accessed by the sheet when the player clicks on that attack, or does each track then subsequently need to be set?
1532572398
Victor B.
Pro
Sheet Author
API Scripter
1) Once the playlist is imported into Roll20AM it's entirely separate from the Jukebox playlist.&nbsp; So deleting the playlist out of Roll20AM should have absolutely nothing to do with the playlist name in Jukebox.&nbsp; I'll see if I can recreate that problem 2) There shouldn't be a null list in Roll20AM unless there is a problem with the delete playlist functionality.&nbsp; However, setting things at the playlist level updates all tracks in that playlist.&nbsp; So unlock the playlist and all the tracks in that playlist get unlocked.&nbsp; That's a quick way to manage player access without having to click on each track.&nbsp;&nbsp;
Victor B. said: 1) Once the playlist is imported into Roll20AM it's entirely separate from the Jukebox playlist.&nbsp; So deleting the playlist out of Roll20AM should have absolutely nothing to do with the playlist name in Jukebox.&nbsp; I'll see if I can recreate that problem Steps to recreate: &nbsp; &nbsp; Create New Playlist in Jukebox &nbsp; &nbsp; Move all tracks from one playlist to New also in Jukebox &nbsp; &nbsp; Delete playlist from *Jukebox &nbsp; &nbsp; List Playlists in Roll20AM in the chat window &nbsp; &nbsp; Old Playlist still exists, so delete it - not so fast sparky! &nbsp; &nbsp; Crash sandbox, profit? XD &nbsp; &nbsp;&nbsp; 2) There shouldn't be a null list in Roll20AM unless there is a problem with the delete playlist functionality.&nbsp; However, setting things at the playlist level updates all tracks in that playlist.&nbsp; So unlock the playlist and all the tracks in that playlist get unlocked.&nbsp; That's a quick way to manage player access without having to click on each track.&nbsp; I tried that but it didn't do much of anything as far as accessing the individual tracks.&nbsp; I still had to go in and individually Unlock each track, if I wanted the players to be able to play them from using an action that utilized the calls I embedded on the "freeform" of their character sheet(s). Also, FYI, I updated the script using the RAW earlier today, if that makes a difference? **EDIT** Removing All and Import Jukebox worked to resolve the issue with the broken Playlist but I did have to re-unlock tracks individually.
1532577881
Victor B.
Pro
Sheet Author
API Scripter
Nope nada to do with Jukebox.&nbsp; I just tried deleting one of my playlists (that completely match Jukebox) and it failed.&nbsp; So it's a bug in the playlist delete logic.&nbsp; Working fixing that right now.&nbsp;&nbsp;
1532611773

Edited 1532611838
Victor B.
Pro
Sheet Author
API Scripter
The next release is coming today or tomorrow, one final piece to test.&nbsp; This will be version 2.200 - Ability to give full or limited control over to a player - Ability to turn off menu display from the config menu so you don't have to add nomenu to macro/templates - Unlocking a playlist unlocks all tracks assigned to playlist (thanks Ascendant Madness) - Fixed a bug in the delete playlist logic (also thanks Ascendant Madness)