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!

Have commands recently changed again?  My macros no longer work.  Example: !roll20AM --audio,play,nomenu|Adventure
1536775759
Victor B.
Pro
Sheet Author
API Scripter
Nope they haven't changed at all.  Can you post the error?  
No error generates in the API view, just the commands don't work.  I can get into the menu inside the chat and play a song that way but the macros I have set up like the one above don't actually play when I use them.  
1536776556
Victor B.
Pro
Sheet Author
API Scripter
So it's working but your macros aren't???? This is correct syntax  !roll20AM --audio,play,nomenu|Adventure.  I've not seen that before.  Try copying the commands out of the macro into chat.  See is that works.  Then you may have an issue with Roll20 and your macros.  
Yeah i just copy/pasted it into the chat and it does not play the playlist.  I've restarted the API sandbox a few times now.
Had the same thing happen delete the playlist and reimport. Solved the problem for me.
That did the trick!  Thanks!
Has anyone been successful in triggering Roll20AM when a page loads?  You can set a default through the map but I want to be able to trigger several playlists (music and ambient noise) at once.
1536811721
vÍnce
Pro
Sheet Author
Matt M said: Has anyone been successful in triggering Roll20AM when a page loads?  You can set a default through the map but I want to be able to trigger several playlists (music and ambient noise) at once. That would be a nice option.
1536850053

Edited 1536850251
Victor B.
Pro
Sheet Author
API Scripter
Page loads are outside of Roll20AM.  They launch from Jukebox directly and I don't interfere with Jukebox launched tracks because they could be initiated from multiple locations, include Character Templates, sfx, etc.  It's a nice idea, but I'd suggest creating a macro that launches the playlists.  Remember, a comma separated list of tracks of playlist, so you can launch multiple with a single macro command.   !roll20AM --audio,play,nomenu|<playlist1>,<playlist2>,<playlist3> Also, latest version of Roll20AM has a config option to shut off menus.  Turn that on and you don't need the nomenu command anymore.  
Yeah I definitely set up macros and it works like a charm.  It would just be cool if it could load on maps.  Another nice thing would be to load the battle playlist when you roll initiative.  Thanks for the tips on the scripts!
1536851304
Victor B.
Pro
Sheet Author
API Scripter
You can *probably* do a launch on init.  The Aaron might be the right person to point you that direction.  The play on load is totally Roll20.  Not much I can do with that unless The Aaron is able to work his magic again.  
1536853173
The Aaron
Pro
API Scripter
There might be some things that you can't deal with for playing music for pages.  I believe with player page loads, it only plays for that specific player, whereas I don't think there's a way in the API to duplicate that single player play behavior. If you wanted to pursue this, there would be two things to look at: 1) You can watch a change in on('change:player:_online', ...)  (note, you must have the _ in event names).  When that happens, defer a function to check what page they are on and start playing music.  2) You can watch a change in on('change:campaign:playerpageid',...), on('change:campaign:playerspecificpages',...), and on('change:player:_lastpage',...).  When that happens, you could check the page they are on and start playing some music.
1536861882

Edited 1536861899
Victor B.
Pro
Sheet Author
API Scripter
So the on change on a page is doable which means I can get the page that's invoked.  The remaining issue is that people want multiple playlists to kick off and the page load process specifies only 1 track or playlist.  So I'd need a front end to create a relationship between the page and the playlists.  I'll will consider this one for next release.  
I get this error when trying to run the following !roll20AM --audio,play,loop|Peaceful Seems to only be occurring on playlists set to shuffle.
Secondly I seem to be having issues getting a playlist to loop continuously at the same time. Each track only plays once and then stop. This is the command I am using !roll20AM --audio,play,loop,together|Thunder According to the handout, which still needs update to reflect the command changes (nowhere does it say that you need to use -- audio, play for example) •  loop -  The indicated tracks will loop. When playlists are specified, only applies when the together option is indicated and then all tracks in the list will loop. So what am I doing wrong?
1536876739
Victor B.
Pro
Sheet Author
API Scripter
I'm testing shuffle mode to see if I can recreate.   As far as MODE goes, you choose one of them, so you want !roll20AM --audio,play,together|thunder which will launch all your thunder tracks at once.  If you want all the tracks to continuously play, then open up your Thunder playlist and set each TRACK to continuous loop.  Then when you launch the playlist, it will launch all of your thunder tracks at once and each track will continuously loop until you fade out your playlist or stop it.  
1536876924
Victor B.
Pro
Sheet Author
API Scripter
As far as your error is concerned, I'm not sure what is going on but you choose ONE mode.  So --audio,play,loop will play the tracks in sequential order from beginning to end.  --audio,play,shuffle will use an algorithm to sort your playlist and then play your tracks according to that sort order.  So one or the other.  
1536877048
Victor B.
Pro
Sheet Author
API Scripter
Finally, can you point me at the documentation you are looking at that discusses LOOP.&nbsp; That documentation is wrong.&nbsp; Here's a&nbsp; link to the correct documentation.&nbsp;&nbsp; <a href="https://wiki.roll20.net/Script:Roll20_Audio_Master" rel="nofollow">https://wiki.roll20.net/Script:Roll20_Audio_Master</a>
Victor B. said: Finally, can you point me at the documentation you are looking at that discusses LOOP.&nbsp; That documentation is wrong.&nbsp; Here's a&nbsp; link to the correct documentation.&nbsp;&nbsp; <a href="https://wiki.roll20.net/Script:Roll20_Audio_Master" rel="nofollow">https://wiki.roll20.net/Script:Roll20_Audio_Master</a> The documentation I was looking at was the description in the one-click directory (also in the script.json file under description). As well as the handout that is generated when the script is first installed (Currently contained within the generateHelp method of the script line 1797 on github .
Victor B. &nbsp;said: I'm testing shuffle mode to see if I can recreate.&nbsp;&nbsp; As far as MODE goes, you choose one of them, so you want !roll20AM --audio,play,together|thunder which will launch all your thunder tracks at once.&nbsp; If you want all the tracks to continuously play, then open up your Thunder playlist and set each TRACK to continuous loop.&nbsp; Then when you launch the playlist, it will launch all of your thunder tracks at once and each track will continuously loop until you fade out your playlist or stop it.&nbsp;&nbsp; I was finally able to get it the loop together to work, thanks! I will point out that I had to set the individual tracks in the jukebox to loop rather than through the Roll20AM menu. The tracks in the Thunder playlist menu, all showed loop, but the problem was still occurring.
Good evening, I have a problem. The command:! Roll20AM - audio, stop | does not work. I do not know why. Config works and all my tracks are imported. And I want to make a macro to allow me to gradually disappear the current track and gently launch the next. I must do that: !roll20AM --audio, stop | --audio, play | Checkout - IRVING FORCE - Crime Scanner or ? !roll20AM --audio, fade, out | --audio, play | Checkout - IRVING FORCE - Crime Scanner Is there a command to designate the current track? Thank you in advance for your answers.
You have too many spaces in your macro's they should not be separated like that. Think you want something closer to this. !roll20AM --audio,stop| --audio,play|Checkout - IRVING FORCE - Crime Scanner
the second command is ok, but the "stop" dosen't work. It dosen't work alone too.
1537848100
Victor B.
Pro
Sheet Author
API Scripter
No spaces.&nbsp;&nbsp; !roll20AM --audio,stop|
Ziterman S. said: Good evening, I have a problem. The command:! Roll20AM - audio, stop | does not work. I do not know why. Config works and all my tracks are imported. And I want to make a macro to allow me to gradually disappear the current track and gently launch the next. I must do that: !roll20AM --audio, stop | --audio, play | Checkout - IRVING FORCE - Crime Scanner or ? !roll20AM --audio, fade, out | --audio, play | Checkout - IRVING FORCE - Crime Scanner Is there a command to designate the current track? Thank you in advance for your answers. I'm looking for the exact same thing - fading out the previous track. From what I gather: !roll20AM --audio,fade,out| does not work to fade out all currently playing tracks? Must I specify a track?
1537854831

Edited 1537854864
Victor B.
Pro
Sheet Author
API Scripter
Fade out doesn't work exactly like stop.&nbsp; Stop is special.&nbsp; It will stop all.&nbsp; Fade out requires playlist (or comma delimited playlists) to be specified.&nbsp; Or a track or comma delimited tracks.&nbsp;&nbsp;
Victor B. said: No spaces.&nbsp;&nbsp; !roll20AM --audio,stop| Thanks, but i dosen't work, i don't know why. I've try to uninstall, reinstall the script. Remove all tracks, reimport all tracks. ETC.
1537883228
Victor B.
Pro
Sheet Author
API Scripter
Invite me to your game.&nbsp; Promote me as GM and I'll figure out what's happening
Hello there, After using attacks macros (with sounds), the Audiomaster menu spawn in chatbox. Anyone can help me to fix this ? Tks !
1538051728

Edited 1538051741
Victor B.
Pro
Sheet Author
API Scripter
-audio,play, nomenu |&lt;track&gt;
Hello, I was wondering if a query inside a playing macro would work? A little like this: !roll20AM --audio,play|?{Which playlist?|Battle |Peaceful }
1538164830
Victor B.
Pro
Sheet Author
API Scripter
That should work.&nbsp;&nbsp;
If I understand correctly, "fade out" need a playlist or a track indicated and cannot be used for a general command, q1) so to have a master fade out macro for any playlist or track that is playing, the macro should include all the playlists like: !roll20AM --audio,fade,out|playlist1,playlist2,playlist3 Is this right ? q2) If I do a fade out on a playlist, does it affect all the tracks in the playlist or is the playlist handled like a single entity ?
1538168777
Victor B.
Pro
Sheet Author
API Scripter
Yes, that's correct. The playlist name must match perfectly, including spaces that may be in it.&nbsp; All tracks playing in the playlist are faded out.&nbsp; If you want individual tracks, then you can add them into the above command.&nbsp;&nbsp;
Just saw a error in the&nbsp; <a href="https://wiki.roll20.net/Script:Roll20_Audio_Master" rel="nofollow">https://wiki.roll20.net/Script:Roll20_Audio_Master</a> &nbsp;, the fade time command is describe as fade,time=&lt;number of seconds&gt; &nbsp;- sets the fade time for the playlist or track. If playlist or track is not provided sets the fade time for ALL playlists and tracks. Fade time is used to fade in or fade out a playlist or track. But works as !roll20AM --edit,fade,time, level = &lt;number of seconds&gt;
1538170306
Victor B.
Pro
Sheet Author
API Scripter
I'd use the menus to set your fade time for playlists and tracks.&nbsp; Up to you, but it's easier.&nbsp; I'll get the wiki updated.&nbsp; &nbsp;&nbsp;
Yeah the menu is good, i'm just looking for timesavers for setting up all of that in another campaign. It seems when I want to fade out a track by applying a fade out to the playlist like that !roll20AM --audio,fade,out|playlist1 I get&nbsp; (From Roll20AM): &nbsp;In order to fade a list, it must be playing Is there a way to fade out a track by calling the playlist that contains it or must i call the fade out on all the numerous tracks i have ?
1538171750
Victor B.
Pro
Sheet Author
API Scripter
If you've launched tracks within the playlist and not the playlist itself, you need to fade out the tracks.&nbsp; This would be a good addition to add to Roll20AM, that you launch some tracks from the playlist and then call the playlist to fade out all of the tracks that are currently playing.&nbsp;&nbsp;
1538172656

Edited 1538175915
Yes, it would be a good addition, you could add it for tags too since they seem to work like the playlists for the fade. The shuffle mode play the same track in first everytime, is this normal? If so, what change the shuffle order ?
1538176357
Victor B.
Pro
Sheet Author
API Scripter
Ooo, you may have found a bug.&nbsp; I think when I go to launch a shuffled playlist, I wipe out the original and reset, but I may have missed that.&nbsp; It's uses an algorithm to determine the order.&nbsp;&nbsp;
1538402474

Edited 1538407599
Yep, tried it with different playlists and the first one is always the same. From the menu, it's the simple shuffle command, no commands added !roll20AM --edit,mode,shuffle|Townday --config,menu=playlists I have another problem now ^^", I can't get the loop command to wokr for some reasons, here is the command: !roll20AM --audio,play,mode,loop|?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern } I can select the song and it plays normally but only one time, Something wrong with it ? Those tracks are set on single in the menu but the command should overwrite that, isn't?
Loupaile:&nbsp; I am still learning Audio Master, so I might be off here.&nbsp;&nbsp; On your Loop issue, I think that mode,loop only works under the Edit command.&nbsp; I don't know that you can set the track to loop with an Audio command.&nbsp; So I think it would have to be an initial command to edit the mode to loop, then a separate audio command to play the looped track.&nbsp; If all your tracks are already set to loop, I think the play command would work.&nbsp;&nbsp; Also, if you have the exact same query in your play command, then it seems to work for both.&nbsp; So I took your macro and adjusted it for my tracks, and then translated it back to yours, and it seemed to work on my game to set the mode to loop and then start playing the same looped track.&nbsp;&nbsp; !roll20AM --edit,mode,loop|?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern }&nbsp; --audio,play|?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern }
1538410174

Edited 1538410215
Indeed, on the wiki, the loop command isn't in the audio command. Well, I will be adding new lines then. It would be cool to have the mode options working with the audio command. For my master sound macro, here is the result: 1) Launching a fade out on any music playing, line 1 is ambiance tracks, line 2 is playlists !roll20AM --audio,fade,out|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,fade,out|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight 2) Editing ambiance tracks in loop and asking which one to play !roll20AM --edit,mode,loop|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,play|?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern } 3) Editing playslits in random and asking which one to play !roll20AM --edit,play,mode,random|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --audio,play|?{Which mood?|Bigcreepy |Bossbattle |Holy |Mysterious |Smallbattle |Tavern |Townday |Townnight } You have to adjust the fade time before with: !roll20AM --edit,fade,time, level = &lt;number of seconds&gt; The macro works fine and the fade out is cool&nbsp; BUT if you choose a playlist already playing, it adds it without removing the current one and if you choose a ambiance track already playing, it stops it. I could counter those 2 problems by replacing the 2 fade out by : !roll20AM --audio,stop| but I like the fade out :/ any sugestion ?
1538424101

Edited 1538424142
Victor B.
Pro
Sheet Author
API Scripter
Shuffle has been fixed.&nbsp; You can pick up 2.13 at&nbsp; <a href="https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0" rel="nofollow">https://gist.github.com/vicberg/6635c77f7f730529ccf83f64819297c0</a> --audio,play,mode,loop does not work.&nbsp; You set the play mode via --edit,play,mode,loop and then launch the playlist.&nbsp;&nbsp; @Loupaile, not following you on your last statement. If you choose a playlist already playing, it adds it without remove the current one?&nbsp;&nbsp;
Yes exactly, the first song doesn't stop and another one from the same playlist starts. For tracks, it just stop them. I think, for tracks, it is because the fade out is applied after the track is changed but for the playlist, I don't know. Here is the full macro: !roll20AM --audio,fade,out|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,fade,out|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --edit,mode,loop|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,play|?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern } !roll20AM --edit,play,mode,random|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --audio,play|?{Which mood?|Bigcreepy |Bossbattle |Holy |Mysterious |Smallbattle |Tavern |Townday |Townnight }
1538440932
Victor B.
Pro
Sheet Author
API Scripter
You realize that these commands are all asynchronous.&nbsp; That means they are all launch simultaneous, not in order of the macro.&nbsp; So I believe you are stepping all over the fade out commands when you issue edit and subsequent play commands.&nbsp; That's why another song is starting up.&nbsp; the audio,play is happening at the same time as the fade out against the same playlist.&nbsp; You might want to add "delay:seconds" to a few of these commands after the fade out.&nbsp; Give the fade out time to operate against all of the tracks and then launch your others.&nbsp;&nbsp;
1538482625

Edited 1538483024
OK, tried multiple things and I can't get it working on the playlists. The tracks fade out then play again when the 5seconds delay is passed, works fine. The playlists fade out then play again when the 5seconds delay is passed, works fine ONLY if the commands for the playlist are done alone like: !roll20AM --audio,fade,out|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --audio,play,delay:5|?{Which mood?|Bigcreepy |Bossbattle |Holy |Mysterious |Smallbattle |Tavern |Townday |Townnight } The playlist doesn't fade out and just get an added song when used in the master macro. Maybe the edit command is skipping some stuff or the commands are lagging. Here is the macro !roll20AM --audio,fade,out|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,fade,out|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --edit,mode,loop|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,play, delay:5 |?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern } !roll20AM --edit,mode,random|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --audio,play, delay:5 |?{Which mood?|Bigcreepy |Bossbattle |Holy |Mysterious |Smallbattle |Tavern |Townday |Townnight }
1538486795

Edited 1538487220
Victor B.
Pro
Sheet Author
API Scripter
Once a play mode is set via --edit command or via menu, it's set.&nbsp; You don't need to issue new commands in the future or unless you want to change the mode mid flight.&nbsp; So loops and/or random only need to be set once.&nbsp; If you are changing these mid flight (from shuffled to loop or to random), then these edit commands should probably have the delay:5 &nbsp;so it doesn't conflict with the fade out.&nbsp;&nbsp; When a track finishes, there's a trigger that invokes Roll20AM.&nbsp; In that logic, it checks for what to do next.&nbsp; What it does next is based on how the playlist and/or track is defined.&nbsp; Fade out will loop through all playing tracks and initiate logic to progressively reduce the volume and then stop the track.&nbsp; If multiple tracks are playing, it will start fading all tracks since all of this is asynchronous.&nbsp; Then it figures out what to do next. I'd highly suggest starting with the simple, fade out, make sure that works.&nbsp; Then add an edit with a delay (if you are changing play list mode from one thing to another) followed with an audio,play with a slightly higher delay.&nbsp; See if that works.&nbsp;&nbsp;
1538492156

Edited 1538492424
Done some testing for further informations <a href="https://docs.google.com/spreadsheets/d/1ulgCa5SYHuMvStBEchT620UEvcjBoFLJe_WP7SRMTDA/edit?usp=sharing" rel="nofollow">https://docs.google.com/spreadsheets/d/1ulgCa5SYHuMvStBEchT620UEvcjBoFLJe_WP7SRMTDA/edit?usp=sharing</a> What comes through: - delay on edit command sometimes as an effect, better to keep it then - everything works as intended when playing playlist part or track part alone - combining the 2 parts makes the macro skip the latest part 3/4 of the time - if you combine the 2 parts, the only configuration that works is adding a delay higher on the first part and lower on the second part, the lowest delay need to be higer than [fade time+2 seconds] or the audio commands get skipped. Here is the final(?) macro: !roll20AM --audio,fade,out|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --edit,mode,shuffle,delay:10|Bigcreepy,Bossbattle,Holy,Mysterious,Smallbattle,Tavern,Townday,Townnight !roll20AM --audio,play,delay:10|?{Which mood?|Bigcreepy |Bossbattle |Holy |Mysterious |Smallbattle |Tavern |Townday |Townnight } !roll20AM --audio,fade,out|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --edit,mode,loop,delay:6|Dripping cave,Light rain,City day,City night,Rain and thunder,Snow storm,Small tavern,Big tavern !roll20AM --audio,play,delay:6|?{Which ambiance?|Dripping cave |Light rain |City day |City night |Rain and thunder |Snow storm |Small tavern |Big tavern }