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!

1538494330
Victor B.
Pro
Sheet Author
API Scripter
Yes, that's correct.  Javascript is asynchronous.  Commands gets launched at the same time.  So even though your original commands were in a specific order, they were all launched at the same time.  One set of commands were stepping on another set.  The only way in a asynchronous model to manage linear commands is to use delay.  
I am having an issue with the script + the official Starfinder sheet. I use the macro script in the "attacher" part for my sniper rifle so that it will play a sound when the attack is done. The line I use is "!roll20AM --audio,play,nomenu|Sniper". This line works just fine when I send it straight to chat, but does not work at all (nothing happens, not even an error) when put into an attack macro. I've updated everything since the change so not sure what is the hang up on this part. :C
1538968517
Victor B.
Pro
Sheet Author
API Scripter
Did you import everything from Jukebox into Roll20AM?  
1538970418

Edited 1538970515
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Anna, is that command on the first line of the attacher, or the second (third, fourth, etc)? The first line of the attacher gets appended to the roll template itself and can be used to customize the roll output. API commands (or separate chat messages you want sent) go on a new line. So your attacher textarea should look like this (as if the entire code formatted area was the textarea): ##### Attacher Header is here ##### !roll20AM --audio,play,nomenu|Sniper EDIT: code block wasn't coming across correctly
Anna, I had a similar issue with the starfinder sheet and macros in the attacher field.  For me, sometimes they would activate, and sometimes not.  It was especially noticeable when I was testing the formulas as a player.  Sometimes then they would not play, but as soon as I reloaded the page, all the fx would play simultaneously.   I also had problems where the sound would play, and then I would test a different attack and both fx would play, and on, and on, until I had a whole firefight from one attack.   I solved that by putting a delayed stop command on the fx.  give it about 3-5 seconds, depending on the duration of your fx.  That solved it for me, and I haven't had any trouble with it since then.  Thanks to Victor for working on this so much.  My players really like the sound cues from their attacks.   example of one of my attack formulas: !roll20AM  --audio,nomenu,play|sonicblast !roll20AM  --audio,nomenu,delay:2,stop|sonicblast I was also going to say something about first line vs second of attacher field, but I see Scott beat me to it.  As the sheet author, I suppose he is entitled to that.  ;)
Hi, I've been trying to find out what syntax to use to randomly play a track from a list of tracks. Note I don't mean a playlist. Is it possible to list the selection of track names from which to randomly select, within the command line? Basically I want to get away from relying on playlists for this. For example, I want to make a macro for a monster attack that randomly selects from several SFX tracks. Variety is the spice of life. Any help would be appreciated.
1539472816

Edited 1539472830
Victor B.
Pro
Sheet Author
API Scripter
Can't from within Roll20AM.  It's playlists or individual tracks.  
1539473168
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
If you name them all the same and simply add a number after each one (e.g. minotaur1, minotaur2,...) then you can randomly select them by using dice rolls: !roll20AM  --audio,nomenu,play|Minotaur[[1dX]] Where x is how many different tracks you want to cycle through.
1539476963
Victor B.
Pro
Sheet Author
API Scripter
That's a great idea
Scott C. said: If you name them all the same and simply add a number after each one (e.g. minotaur1, minotaur2,...) then you can randomly select them by using dice rolls: !roll20AM  --audio,nomenu,play|Minotaur[[1dX]] Where x is how many different tracks you want to cycle through. Genius. You sir, are a hero. + 10,000 XP :)
Oddly, whenever I use this script, I now get all menus in duplicate.
I feel like I'm doing something wrong, despite following the documentation, because I cannot get this script to do anything its meant to. None of the tracks play....and even the general 'All Stop' doesn't function.
Obi said: I feel like I'm doing something wrong, despite following the documentation, because I cannot get this script to do anything its meant to. None of the tracks play....and even the general 'All Stop' doesn't function. Can you post your macros and your track titles?
1540162835
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Obi said: I feel like I'm doing something wrong, despite following the documentation, because I cannot get this script to do anything its meant to. None of the tracks play....and even the general 'All Stop' doesn't function. Just making sure: you are importing all tracks (using the script) before trying any commands?
1540196003

Edited 1540196097
Since I tried to modifiy the menu to hide tracks and menus from players, macros didnt work anymore. I do have this error line : {"who":"error","type":"error","content":"Unable to find a player or character with name: ?{Who"} I still can start sounds from the tracks menus, but I cant use any macro anymore. I cant either change the option "viewed by" in the menu (before I messed up it was marked as "all" if I remember correctly, I clicked to change for "GM", and then everything fall out). Heres the screen of the menu : P.S. I was running 2.12, I tried to downgrade to older version and to 2.13, I reloaded scripts, I deleted and reimported tracks, nothing is working.
1540258766
Victor B.
Pro
Sheet Author
API Scripter
@kane, invite me to your game and let me see what's going on.  You have something funky going on with your player names.  
1540258830
Victor B.
Pro
Sheet Author
API Scripter
@obi, invite me to you game.  Usually, the import jukebox step is missed.  However, you need to verify your tracks are playing using the MENU first.  If that's working, then you have a problem in your macro commands.  
1540258852
Victor B.
Pro
Sheet Author
API Scripter
And yes, duplicate config menus are displaying.  I haven't fixed that yet.  
I have a playlist which I deleted a sound from and added a different sound to.  Since doing this, I am unable to get the playlist to play using roll20AM macros.  I was told to visit this thread to learn how to "re index' but I cannot find a post on how to do this. !roll20AM --audio,stop,nomenu| !roll20AM --audio,play,nomenu|Wind !roll20AM --audio,play,nomenu|Horror TypeError: Cannot read property 'set' of undefined TypeError: Cannot read property 'set' of undefined at stopTrack (apiscript.js:1280:16) at _.each (apiscript.js:1034:17) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:191:9) at stopAll (apiscript.js:1029:11) at Timeout._onTimeout (apiscript.js:564:25) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5)
1542301074
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
To bring up the master menu, use this command. It might be helpful to make a macro of it. !roll20AM --config The menu that appears after that contains the commands you need. Click "Remove All", and then "Import Jukebox". Don't worry, Remove All doesn't actually touch your jukebox files, it just clears Roll20AM's index. The first post of this thread needs to have a redirect to the new syntax. Victor, as the new sheriff of the script, do you have a suggested Master Post for people coming to the thread? I'll ask Scott to put a link at the top of post 1.
That's what i feared it meant. When I do this, all of the playlist revert to Loop play mode.  Is there a way to mass update playlists without having to click each one multiple time to get them to random?
1542307756
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That's probably a question for Victor. My usage of Roll20AM is very specific; I don't have much need for playlists.
1542340175
Victor B.
Pro
Sheet Author
API Scripter
As long as you didn't completely revamp your playlists, just added songs, etc., doing an import without a remove will work.  Try it.  
I'm really very new to all of this but I'm hoping someone can help me. I'm in charge of doing the audio for our campaign so I'm the co-GM. I have plenty of playlists set up (Battle, City, Dungeon, etc.) That I play when appropriate. I'm trying to add sound effects to the players' Macro attacks. I was able to do it with a simple line like /roll 1d6 + @{Kunik|Bite Damage} !roll20AM --audio,play|Bite So when I roll a bite attack, the SFX named "Bite" plays when I make my roll. The issue is that whenever I use the macro it will stop the current playlist track and then start another random one from the same playlist. I was hoping to have my ambient playlists on all the time and then be able to layer these SFX on top of the playlist music. Thank you in advance for any help. Hopefully my post makes sense.
Same error as Matt M: For reference, the error message generated was:  TypeError: Cannot read property 'set' of undefined TypeError: Cannot read property 'set' of undefined at playTrack (apiscript.js:10309:16) at playNextTrack (apiscript.js:10292:9) at playListShuffle (apiscript.js:10212:9) at listHandler (apiscript.js:9797:17) at _.each (apiscript.js:9599:25) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) at Timeout._onTimeout (apiscript.js:9598:23) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5) Restartint the api and then "delete all playlist" gave me the same kind of error, it worked when I deleted them manually and imported.
i had the same problem, fixed it by playing the ambient music through the roll20AM script itself and not the Jukebox. also i use a this instead. dunno if it makes a difference !roll20AM --audio,play|Fireball --config,menu=tracks music m. said: I'm really very new to all of this but I'm hoping someone can help me. I'm in charge of doing the audio for our campaign so I'm the co-GM. I have plenty of playlists set up (Battle, City, Dungeon, etc.) That I play when appropriate. I'm trying to add sound effects to the players' Macro attacks. I was able to do it with a simple line like /roll 1d6 + @{Kunik|Bite Damage} !roll20AM --audio,play|Bite So when I roll a bite attack, the SFX named "Bite" plays when I make my roll. The issue is that whenever I use the macro it will stop the current playlist track and then start another random one from the same playlist. I was hoping to have my ambient playlists on all the time and then be able to layer these SFX on top of the playlist music. Thank you in advance for any help. Hopefully my post makes sense.
Hello, I'm new to API scripts and I'm curious, is there a command to play through an entire playlist in order just once?
1547432212
Victor B.
Pro
Sheet Author
API Scripter
No there isn't.  
1547433422
Victor B.
Pro
Sheet Author
API Scripter
Folks, I'm ready to create Version 3 of Roll20AM.  There's quite a few suggestions in the last few pages.  If you want anything specific, or some functionality doesn't work well, please post here.  
Hey there, so I am trying to get this API to work so I can use it in my games but when I use .... !roll20AM --audio,play,nomenu|Skirmish nothing happens, no music no nothing. But when I bring up the config and check the playlist the song is there and I can play if I click the play button but that command above does nothing... help. One other question, once I get that macro working I will be able to figure out how to stop it as well but when I stop, is there a way to have map music that was stopped automatically restart when I end the "Skirmish" song?
1547560612
Victor B.
Pro
Sheet Author
API Scripter
1) So the song plays via menus but isn't playing via command.  The command looks fine to me.  You might want to post your macro in this thread.  There are many who can quickly identify your issue.   2) You want a temporary override of what was playing?  So another song steps in and plays until stopped and then the original song/playlist starts up again?    
1547561829
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I wonder if it's related to this problem ?
1547562722
Victor B.
Pro
Sheet Author
API Scripter
@keith, I can see why you are a forum champion :) #Vaeadil - Roll20AM has no control over songs loaded by pages.  That's entirely separate and outside of what Roll20AM can manage. I can poll jukebox directly to see whats playing and stop something, but that's a slippery slope because people may be launching songs outside of Roll20AM such as SFX, etc., and I don't want to interfere with that.  
@keithcurtis - Two different issues, as that one has been figured out and still can't get the Audio Master to play anything at all for me. @VictorB - Post my macro? Isn't "!roll20AM --audio,play,nomenu|Skirmish" my macro?
1547647370
Victor B.
Pro
Sheet Author
API Scripter
Send me PM with an invite to game.  You'll need to temp promote me to GM and I'll figure out what the issue it.  
1549409424

Edited 1549409481
Hello Im hoping I can get some help, although this may not be possible.&nbsp; Im using the Roll20 5E OGL sheet and trying to use this API to add sound FX to spells and such.&nbsp; However, when I add the following to the description as I understand is how to do it, it breaks the spell and the remainder including the spell slot tracking is shown via text and not executed.&nbsp; }}&nbsp; !roll20AM --audio,play,nomenu|TrackName ! For example when I use this on Cure wounds the spell casts the roll comes out looks fine, sound works too,&nbsp; then I get this block after, and no spell slot tracking.&nbsp; }} {{hldmg= <span class="userscript-inlinerollresult showtip tipsy-n-right" title=" Rolling (1*0)d8 = ()" style="background-color: rgb( 254 , 246 , 142 ) ; border: 2px solid rgb( 254 , 246 , 142 ) ; padding: 0px 3px ; font-weight: bold ; cursor: help ; font-size: 1.1em ; color: rgb( 64 , 64 , 64 ) ; font-family: &quot;helvetica neue&quot; , &quot;helvetica&quot; , &quot;arial&quot; , sans-serif">0 }} {{spelllevel=1}} {{innate=}} {{globaldamage= 0 }} {{globaldamagetype=}} ammo= charname=Adrie Amakiir Is there a way to make this work?
1549413857
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It appears that They've changed the macro order Matt. Looks like that trick won't work any longer. Which is a shame.
1550033899

Edited 1550033937
I cant seem to get whatever is currently playing to stop using a macro. I have tried this:&nbsp;!roll20AM --audio,play,swap,mode:shuffle|Welcome as well as&nbsp;!roll20am --audio,stop|Welcome|Dungeon|Combat|End but whatever song is playing, just keeps playing. I should say these are playlists
I am guessing that the upcoming loss of Fanburst is going to invalidate (most) all my roll20AM sound effects, like attack linked gun noises, spell-linked explosions, etc.&nbsp; Am I correct in assuming such?
I would assume so until the script is rewritten to work with the new audio system. Luke H. said: I am guessing that the upcoming loss of Fanburst is going to invalidate (most) all my roll20AM sound effects, like attack linked gun noises, spell-linked explosions, etc.&nbsp; Am I correct in assuming such?
1550041155
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Roll20AM script does work with the new audio system, at least in the dev server test. Of course, macros will still need to reference the name of the track, so if you upload a new track for that Sound effect, you'll need to name it the same.
To clarify though, any songs/sounds originally pulled from Fanburst will have to be replaced with new ones after Feb. 25, correct?
1550042979
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yes. The ones that are in your Jukebox are just pointers to files hosted on Fanburst. I don't know if they will disappear or if the links will just go dead, but it would be a good question to ask the dev team. There isn't an official thread yet, but there is a dev response in this one .
1550068381
Victor B.
Pro
Sheet Author
API Scripter
My guess is that links will go dead.&nbsp; You'll hit play and nothing will happen as it's essentially a hyperlink to fanburst which won't be up.&nbsp; Sometimes that currently happens with fanburst.&nbsp; You'll click a song and nothing will happen.&nbsp;&nbsp;
Is it a known issue that if you have a playlist active, and interject a Roll20AM track (like a sfx), the playlist will then skip to the next song?&nbsp; It would be ideal if the roll20am track would just play overtop of another track, like it does when a track is playing and not a playlist.
1550611918

Edited 1550611941
Victor B.
Pro
Sheet Author
API Scripter
They should overlap
They do not and never have for any GM I know.
You need to start the playlist using the script and you will not have that issue. TetNak said: Is it a known issue that if you have a playlist active, and interject a Roll20AM track (like a sfx), the playlist will then skip to the next song?&nbsp; It would be ideal if the roll20am track would just play overtop of another track, like it does when a track is playing and not a playlist.
So any playlist that starts by a slide will be effected, but if Rol20AM starts it they won't?&nbsp; Interesting.&nbsp; Thanks for the information.&nbsp;&nbsp;