AutoKDJ Progress

From AutOKwiki

Jump to: navigation, search

Contents

Update: 10-03-05

We're up to Alpha 3.24 now. Progress, even while the webpage and wiki was down!

Rotation View is in. The view shows all customers, in order of rotation, and basic stats (how many they have queued, how many sung, etc.)

Ticket View is in. No more digging through text files looking to see if the FrontEnd works. Also can search for a ticket, which could allow a KDJ to just scan a used ticket to find its entry in the authenticated queue. Right click option "unexpires" the ticket, so it can be used again.

I also put in an Alternate Playlist View. Shows the native song queue, which is the mirror song queue that gets synchronized to the Winamp playlist queue. This Alternate playlist shows all kinds of statistics about a song entry, who's singing it, how many minutes they have been waiting, how many minutes until the song is sung, whether the song is locked or not. Also, right-click options to dequeue a song, dequeue all songs from a singer, remove a singer from rotation entirely. Getting the synchronization working was a bitch to do, but I think I nailed the last of the bugs, the last one being bad things happening when you drag/drop stuff into the Playlist Editor.

I also added songbook exporting. Exporting exports all MP3G-ZIPs sorted by Artist and sorted by Title into either .CSV, .TXT or .HTML files. I also added songbook "hosting", whcih allows anyone to bring up a webpage, that shows the songbook.

I also added preserving singer history. So now, you can right-click on singer name in either the Alternate Playlist or the Rotation View, and say "Show History", and it shows you what songs they have ever sung, and when they did it.

Also, at toq's request, added a new http://{server}/kcombo page, which shows both the song queue on the left side and the rotation information on the right. So, people can get a sense on who is new, and who in the song queue they may expect to sing at or near.

We also got pitch tuning and tempo scaling, using a different plugin called pacemaker. It came with an SDK allowing ADKJ to set the tuning when the song is enqueued, and then program the tuning right as the song begins. The software also adjusts all time figures based on the scaled tempo value instead of the original song length. I also added an invisible global scaling factor, which allows the KDJ to set all songs 5% faster or 5% slower. Kind-of a sneaky way to let the KDJ adjust the number of songs that are sung.

Also added a Standby feature. This changes the behavior of the program when Sold Out time comes. Users can now go on Standby, and get bumped into the Active list if/when someone cancels later, or if the KDJ just wants to keep the show running longer. When a song is queued in Standby, the KDJ gets a clear indication in the form of a pop-up ( :-P gotta do better ), the playlist shows the singer as being on Standby, and when a Standby song is about to be played, the transport is automatically stopped so the KDJ can decide whether or not to let it go on.

I also fixed a few bugs that were exposed by the front-end, and a really nasty stack corruption bug that I introduced by accident. That damn thing took me the better part of a week.

And I put in a neat new About Box. :-)

Some bad news... the title changing just doesn't work for songs in the media library. If you hook titles, you can't get the length of the song, which throws off all the calculations for figuring out sold out time and stuff. You can't hook extended title info, becuase the Media Library eats them for any song that comes from the Media Library. The only reason this scheme we got working in a3.0 ever worked on MP3-G-ZIPs is because the embedded MP3s are in a temp directory and not in the media library, so we get the extended title info hook. This makes the program less compelling for non MP3-G-ZIPs, but it is gonna take a while to figure this out.

One thing I realized we really need is the idea of Venue Presets. This is for the KDJ who uses the same laptop at multiple venues. Each venue would have its own name, webpage, venue UID, list of singers with their own singer UIDs. What we need for this is a way to switch all of that with a single action. (Load 7Bamboo venue, load OtherKaraokeClub venue, etc)

Also, showing singer history in the Winamp view may be interesting, but why would the KDJ need to see this here? Singer histories are for customers, and customers interface over HTTP, they don't manage Winamp directly. The only benefit this might have is the ability to debug problems. But who else besides a programmer would need to do that? Maybe an option somewhere.

We probably also want to add an Event Log View, showing the KDJ the data in the akdjdbg.txt file. This could be helpful in diagnosing problems with the software while at the live venue.

Also I'm beginning to wonder whether the idle playlist is necessary. Need to talk to toq about that one.

And last, but not least, all of the AKDJ front-end and server code is in a CVS server. So now we have real revision control, and a way for toqer to do daily builds.

Next Steps:

  • Support idle playlist
  • Support Venue Presets
  • Add Event Log View
  • (Maybe) Add a history view, showing all singers and what songs they sung.
  • Tweak the interface a bit, to add a few features here and there.
  • Fix bugs on demand

Update: 07-19-05

We're up to Alpha 3 now.

I change alpha numbers whenever I make a major breakthru.

Going from 1 to 2 was getting the Remote Control operation working without HTML.

The move from 2 to 3 is about getting rid of stuff. First, getting rid of our dependence on MP3-G ZIPs, and second, getting rid of our depenence on ID3 tags.

Using the forums, I learned how to change titles on the playlist without changing the ID3 information on the original files. With that power, we no longer need to restrict custom titles with singer names and rotation info on MP3-G zip files, we can do it on any file, and without modifying the files. The winamp.com forum comes through again, man it is so great to have that resource out there in internet land!

What makes this breakthru so huge is now we can potentially support any Karaoke format there is... AVI, MPG, CD-G, WMV, DVD... anything that Winamp can play, we can enqueue, assign a rotation order, and assign a singer.

Next Steps:

  • Support idle playlist.
  • Rotation View
  • Ticket View
  • Tweak the interface a bit, to add a few features here and there.
  • Fix bugs on demand

Update: 07-18-05

Well, once again a month has passed with no entries...

The big feature that is working now is that the plugin fully supports the Front End application for customer queueing of songs, including full ticket authentication, including user and song tickets. A neat tidbit caveat I added along with user ID support was lookup of user avatars and displaying those on the left.html website (at toqer's request). The internet folks love that one! I also added a way to queue users by User ID directly from Karaoke View so the avatar bit will work without the barcode reader.

Anyway, all HTTP posts that are needed are implemented and supported, which was mostly .txt format responses to existing queries and a few custom queries handling tickets. Recent news is that l1quid is now able to get song search results, which is really cool.

Also, I got a right-click menu system working in Karaoke View, and added a bunch of stuff to that. First, a third way to enqueue songs from Karaoke View (double-click, right click, Enqueue button... I like redundant redundancy), a way to explore to a song folder (neat feature in the Local Media view that I really missed), a way to note a song as being a bad rip (at toqer's request) and... finally... a proper "Replace Song" feature.

Finally, word may have it that there may already be plugins that support the idle playlilst. I'll have to play with those to see how well they work.

I am now thinking about adding a Rotation View, so the KDJ can see specifics about individual singers. Also, we gotta figure a way to change titles without ID3 tags. That just won't work in the long run. Also, a Ticket View would be nice.

So, Next Steps ain't any shorter... just new stuff...

Next Steps:

  • Support idle playlist.
  • Rotation View
  • Ticket View
  • Change titles without ID3 tags
  • Tweak the interface a bit, to add a few features here and there.
  • Fix bugs on demand

Update: 6-22-05

The awesomeness continues... I should also point out that a great part of this awesomeness is the Winamp online forum. http://forums.winamp.com Whenever I get stuck, I just go up to the forum, and someone up there already got stuck on the same thing and already has the answer.

KDJ Overrides and enhanced support for Custom CDGs are now working.

For KDJ Overrides, AutoKDJ now tracks each gesture the user can make in manipulating the playlist, and then compensates.

With this, the simple act of dragging an entry up and down the Winamp playlist is the "KDJ Override" feature. The fact that an entry that got dragged to a new spot is simply assumed to be pre-destined by the KDJ to be in the final spot, and should not be touched.

AutoKDJ also figures out when entries are deleted or added, and then updates the list accordingly. Not only that, if an entry is deleted and the song was not sung yet, the singer does not get charged with singing the song.

With this, the act of deleting a song and then entering a new song from an existing singer with the same singer is the "Replace Song" feature. The new one will automatically go in the old place, as since the system thinks the singer never sang that song, the new song would naturally go into the spot that was just vacated.

For Custom CDGs, there is now a feature where the last song with the text "CustomCDG" in the name of the file can cause Winamp to stop the playlist. This is an option that can be turned on or off. This would definitely have prevented the issue highlighted on 13-Jun.

I will say that there are a few things that had to be done with some really squirlly techniques, as the forum will tell you. Finding the currently selected (not playing, selected) song on the playlist is a hack beyond all belief. With that, I have a bit of concern that this version may need some amount of testing before it stablizes. But, so far, it seems to work.

Next Steps:

  • Add support for ticket authentication and ticket bumps for barcode terminal
  • Add a better "replace song" feature. The current suggestion (delete song, add new song) breaks down if a user has multiple songs queued. Thinking about putting this on a right-click menu somewhere...
  • Support idle playlist.
  • Tweak the interface a bit, to add a few features here and there.
  • Fix bugs on demand

Update: 6-19-05

The Winamp SDK code is so incredibly awesome I can't express it in words and still do it justice.

What makes it awesome is how simple it is to do what may appear to be complicated. A task that I thought would take a week ended up taking a few hours.

At this point, all of the important work for supporting the AutoKDJ Song Queue Terminal Application Specification is done. Also, the spec is updated with all info that the TA author needs to get their job done.

The only two bits left undone is a way to use additional tickets to buy upgrades, and the message returned saying how long the singer who queues the song needs to wait before they sing.

I left out the latter because I don't know if it is a good idea to do this. With the way rotation works, that value could be deceiving.

The former needs more infrastructure work.

As this is a significant milestone, I am going to coin this release Alpha 2.

Next steps:

  • Get KDJ Override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Add KDJ Replace Song feature.
  • Additional support for Custom CDGs.
  • Support idle playlist.
  • Tweak the interface a bit, to add a few features here and there.
  • Fix bugs on demand

Update: 6-16-05

So ml_ex is really informative. With that and a couple hours of custom coding, I was able to make a complete Karaoke View in the Media Library. For the KDJ, it replaces the need to use HTTP completely. Search, enter singer name, enqueue, all on one page, and without any hidden right click menus.

So, yeah, that did absolutely nothing directly toward my next steps, but it did teach me a lot about writing native UI extensions, which I will need for some of the stuff below.

Next steps:

  • Get KDJ Override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Add KDJ Replace Song feature.
  • Additional support for Custom CDGs.
  • Support idle playlist.
  • Support the AutoKDJ Song Queue Terminal Application Specification
  • Tweak the interface a bit, to add a few features here and there.

Update: 6-15-05

Thanks in great part to the sample ml_ex code that comes with the Winamp SDK, I got some native UI features working now. The one I have is right click on any entry in the Media Library, select Send To, you'll see Karaoke Enqueue. That does exactly what the karaoke page does, but much faster.

Next steps:

  • Get KDJ Override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Add KDJ Replace Song feature.
  • Additional support for Custom CDGs.
  • Support idle playlist.
  • Support the AutoKDJ Song Queue Terminal Application Specification
  • Tweak the interface a bit, to add a few features here and there.

Update: 6-13-05

Eek, been a while since I updated this...

Since the above release, we've released alpha 1.05 to Winamp.com, put what we got to the test at the Boo, and moved on to alpha 1.11.

We've made a lot of changes, enhancements, and bug fixes, throughout the past 2 weeks of first hand experience using the plugin at the Boo, which opened up again in the beginning of June.

The big changes were:

  • Computing approx number of songs before closing
  • New Preferences Panel
  • The ability for the KDJ to set an arbitrary closing time
  • A way to enter EXAXT album# / track# into the karaoke page, to make life easier for the other KDJs
  • A new Karaoke mode for left.html that only shows customers what they need to know (who is singing now, who is going to sing what songs in what order, how many times each singer has already sung, and how much time before any given singer goes up)
  • The ability for the KDJ to set a "maximum wait time" for anyone to sing. Note the Karaoke Tech "Rotation Harmony" article series (Part 1, Part 2), this mitigates the conflict that arises when bunches of folks show up later than die hards who want to sing lots.
  • Crash recovery code to allow the KDJ to pick up from where they left off right before Winamp went ka-blooey (which we found out that we REALLY NEEDED... the hard way, of course...)

Most amusingly, what was NOT done was the first of the "Next Steps" from the last write-up... KDJ override / rotation sync-up with manual playlist edits. That is still really necessary to make this thing work well. Also, a few more things came up, so the Next steps has become rather extensive...

We need a KDJ replace song feature. This is for the ever infamous problem where a customer goes "ooh, I changed my mind, I want to sing THIS instead of THAT." I'm sympathetic, as I myself have done that in past Karaoke appearances...

We also need some additional support for CustomCDGs.

What happens now is that when a customer puts in a CustomCDG, the KDJ queues up a dummy song called "CustomCDG", which in reality is American Pie, the longest song in the playlist at 9 minutes. Then the KDJ switches A/V to LCD or DVD and plays the custom there. The theory there is that 9 minutes is plenty of time to load up the custom, play it, then go back to Winamp for the next song.

But, of course, if it takes the KDJ longer than 9 minutes to do all of that, or if they have multiple customs in a row, or if they are just not paying attention, Winamp just happily goes onto the next song and the next and the next... blasting through queued songs at the dismay of the poor customers who queued them, and screwing up the rotation in the process.

To fix this, I imagine a few things. First, not using American Pie, but a silent MP3 file and maybe even a simple CDG file that just shows "Custom CDG" on the screen. Second, that AutoKDJ would "know" to stop the transport when the last in a sequence of Custom CDG songs ends, so it does not run on.

We also need some native Win32 UIs for the KDJ. Using http://localhost is just too damn slow for the KDJ to be effective. Basically, I imagine a right-click "Karaoke Enqueue" option in the Media Library, which brings up a Win32 panel for entering singer name.

Also, this is a Toshi request: Automatic queueing of a user-defined "idle playlist" when nothing else is going on. The KDJ system should always play music, even if it is idle. That, of course, requires the converse feature, where it immediate dequeueing of that playlist when the first customer queues a Karaoke song.

Finally, we... uhh... kinda need to support the barcode scanner terminal, which is where this whole project thingy got started in the first place. L1quid requested special HTTP posts return data in pure "text" format, which will be easier for the Barcode machine to parse. Seems totally fair to me.

Next steps:

  • Get KDJ Override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Add KDJ Replace Song feature.
  • Native Win32 UI for KDJ.
  • Additional support for Custom CDGs.
  • Support idle playlist.
  • Support the AutoKDJ Song Queue Terminal Application Specification
  • Tweak the interface a bit, to add a few features here and there.

Update: 5-24-05

Well, we got enough stuff working now that Toq was comfortable unleashing this thing on the world. Coined Alpha 1, this release incorporates some important improvements and updates.

First, it is now multi-user friendly. That turned out to be kind-of a pain, every single link in every single page under the karaoke page now needs to have the user's name embedded within it, so the server knows who the intended user is upon the next HTTP post. I still fear that there are race conditions in the code, involving traversing lists and stuff, but that won't be too big of a deal for now, at least as long as the plugin only responds to HTTP posts, and handles them in series.

Also, a few features at toq's request... The singer's name is now accompanied by text saying how many times they have sung. This should help with customer confusion, who may feel they are being mistreated. Hopefully the system will help set them straight. It also has a marker denoted by (!$) saying that the singer may not have paid yet. Keeps the KDJ on his toes.

Finally, I got around to fixing some major bugs, like how people would get queued BEFORE the current play position (d'oh!). It also handles funny non-URL non-JavaScript non-HTML friendly characters a little better... but that's still kind of busted... And I added a time / date / version stamp to the footer, so I always know what build folks are using.

Anyway, Toq took that build, and wrote an proper NSIS installer for the thing. Cool deal, it takes care of all the tidbits, like putting DLLs in the right place and pre-installing the 0.6.0 alpha 3 of ml_www first. Then, of course, when he was done, I went and added more features. Software engineers...

Again at toq's request, the plugin now brings up the minibrowser window in Winamp itself and points to the karaoke page. The thought was that would be helpful for the other KDJs at the boo, who are still uncomfortable with PCs. Unfortunately, it works kind-of "wonky" with window resizing. Need to look further into that.

Next, I finally got around to writing code to delete the damn temp files. There isn't a single call to do that, I had to write my own recursive algorithm for that... call find next file... is it a directory? if so, go into that directory and call find next file... Works. Yay.

Also... and this is my own personal pet feature... it now marks songs that someone sung during the evening already. I just hate coming into a karaoke bar, and requesting a song, only to find that someone queued it up already... well, now that problem will now be history.

Finally, after talking a bit with toq, we decided it would be a good idea for the AutoKDJ to automatically start playing when the very first song is queued. This kind-of "kick-starts" the whole process, one less mouse drag and click.

And last, but not least, Toq seems so happy with this version that he plans on using it immediately, even without the barcode thing working. I'm glad that I hit my goal of making the plugin as useful as possible, even in this early and somewhat crippled state. He also seems to have the guy from Priddis Karaoke interested in the technology, as a vehicle for selling content.

Well, l1quid, if you're reading this (and you should be :-) ), we're ready for the front end now. Once that comes together, this thing should really shine!

Next steps:

  • Get KDJ override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Tweak the interface a bit, to add a few features here and there.
  • Get MORE people testing this thing out.

Update: 5-21-05

With toq's permission, I have a prototype on the 7 bamboo site here.

This will be constantly updated. Until such time as we have a CVS server, the only revision control will be on my hard drives. At least I have the presence of mind to do some amount of backups.

I also used this library called ID3Lib in order to update song information with the singer's name, as opposed to the original artist. If this were the only thing I wanted to do with ID3 tags, this approach would have been way overkill. But, there is more I will want to do with ID3 tags, so this library will be quite handy.

Also, Toq was kind enough to actually put this interface on the real internet and get the folks in #karaoke to help test. Also, I uderstand that Jacob is using this plugin for QA of the 7 Bamboo English Song library. At least I know this is being tested!

Next steps:

  • Get KDJ override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Tweak the interface a bit, to add a few features here and there.
  • Add file cleanup (temporary extracted files are left on the hard drive... not good...)
  • Get people testing this thing out.

Side Note: It occurred to me in playing with the plugin remotely on Toq's server that this could be the beginning of a "virtual KDJ machine." Consider... the customer pays $x an hour, goes to the web, queues songs, and sees the NSV video of the song with lyrics on the fly, and then sings along. This could be really cool!

Update: 5-20-05

OK, I got 2 major things working today.

First, the WinAMP queue is now being programmed according to Karaoke Rotation order. Thanks to Will for giving me the key to that treasure chest without making me spend hours digging through WinAMP SDK documentation.

I also got MP3-Zip extraction working. I used this Info-ZIP DLL, which is the same one toqer used in 1337karaoke, to do the MP3-Zip extraction. Turns out that as of February 2005, this is now under a BSD-like license, which allows us to freely distribute.

Put the two together, and I now have a working prototype. :-D

Caveats: If KDJ manually changes the order, it screws up the Rotation.

Next steps:

  • Get KDJ override functionality working... KDJ changes the list manually and the plugin needs to simply figures that out and compensate. This does not work right now.
  • Add support for ID3 Tag updates, so the singer shows up in the songlist, not the original artist.
  • Tweak the interface a bit, to add a few features here and there.
  • Add file cleanup (temporary extracted files are left on the hard drive... not good...)
  • Get people testing this thing out.

Update: 5-15-05

Got the song queue part working. So, every customer who enters their name or selects a name they entered before can enqueue (but not play) any song in the Media Library.

But, the queueing is NOT in Karaoke Rotation order, it is first-come-first-serve order right now. Still gotta figure out how change the order in the Winamp playlist from a plugin.

Next steps:

  • Figure out how to synchronize the Winamp song queue with the internal rotation algorithm. If you screw with the song queue directly, the rotation algorithm will get confused.
  • Figure out how to incorporate MP3-Zip files The Winamp media library does not know how to deal with them... that's why there is l337.

Side Note: It occurred to me that this exact same plugin could be used for any application involving requests from customers... DJs at weddings or parties, for example. The rules of rotation would work perfectly. The only difference is that the person who requests the songs doesn't do the singing part...

That makes me realize that everything about this whole project could be easily migrated into the party DJ market...

Update: 5-14-05

mlwww source is nicely written, and conveiently uses VC6 workspaces. But not at all documented. (The code is the documentation...)

Started making modifications. Made a new "karaoke customer" page.

The purpose of this new page is to let potential karaoke customers enter their name, search the Media Library for a song they want to sing, and pick a song to enqueue on the WinAMP playlist. This page would do nothing else. Even the enqueue part is indirect, the queueing needs to go through the Karaoke Rotation algorithm.

I don't think this is the actual page that should be shown to customers. I still like the idea of a dedicated front end that just sends the same HTTP posts that this page would. But, writing this in the form of a page now lets me do backend stuff on my own. Also serves as a good way to prototype user experience before we commit to a program.

I spent the whole freakin' day figuring out how to allow someone to enter their name. There seem to be funny rules about what kind of URLs are permitted to be posted, that I don't quite understand right now. The way I got it working for the time being is that, every HTTP post URL that enters data is in the form of a "query", even if it is not really a query. For example, the post to add a new singer is:

http://testmachine/karaoke?query?ADDUSER="anne"

This is because I could not get the damn thing to send anything custom EXCEPT a query. If I made the word 'query' anything else, it gets filtered out somewhere.

Basically, I didn't take the time to figure out how that filtering happens, I just made everything a query and wrote my own filter to figure out real queries and custom commands that look like queries. (can you say HACK?)

Next steps:

  • Get the queueing part actually working (put a real song on the winamp queue)
  • Figure out how to synchronize the Winamp song queue with the internal rotation algorithm. If you screw with the song queue directly, the rotation algorithm will get confused.
  • Figure out how to incorporate MP3-Zip files The Winamp media library does not know how to deal with them... that's why there is l337.

Update: 5-11-05

Everyone seems to like the idea of a modified version of mlwww, with specific pages for KDJ and Karaoke Singer input and appropriate control. I'll be playing around with the source code in the next few days or so, to see what I can make it do.

Personal tools