INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Computed Fields and History  (Read 3666 times)

Tanoshimi

  • Junior Woodchuck
  • **
  • Posts: 57
Computed Fields and History
« on: June 24, 2007, 07:09:54 pm »

Based upon the insistance of a friend, I've written two plugins for personal use that I might open to the floor.  I'm trying to gauge responsiveness to either of these:

Computed Fields - Like Calculated Fields, but it handles Math.  You type in a simple formula such as "[Popularity]=[Number Plays]-[Skip Count]" and every time the song plays the plugin updates the library field with then new value.  There's also a button which allows you to immediately Compute Fields for every item in a given Scheme, Smartlist, or Playlist.

History - I didn't think the [Number Plays] and [Skip Count] fields were good enough, so I created a plugin that creates a library field call [History].  Everytime a song plays, it stores the date, time, and the percentage played.  You'll be able to go back and see that (Barry Manilow) - Mandy.mp3 played 76.87% of the way through at 2:43pm on 5/12/07. 

I'm currently working on adding charting capabilities to the History Plugin so you can visually see how many times a song has played, when it was, and how much of the song played.  This is a great way to determine if a song is liked, because if it's only played 51% of the way through each time, it'd be counted as Played versus Skipped in MC, but this plugin can track it.  I'm also working on connecting the two plugins so you can use the values in the [History] field in a Computed Field (length of time between plays, average time of day played, average length of time the song played for, min/max a song's been played, etc).

Anyone interested in these plugins feel free to contact me directly, or post here.
-Tano
Logged

mlefebvre

  • Galactic Citizen
  • ****
  • Posts: 452
  • nothing more to say...
Re: Computed Fields and History
« Reply #1 on: June 25, 2007, 06:53:06 am »

Oh boy! This sounds marvelous! Especially the charting capabilities! I can see this potentially used for all sorts of things!

I'm really interested!

Michel.
Logged

c1c9k72

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 332
  • So many worlds, so much to do, so little done...
Re: Computed Fields and History
« Reply #2 on: June 25, 2007, 10:16:28 am »

I would definitely be interested in both of these plug-ins.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Computed Fields and History
« Reply #3 on: June 25, 2007, 01:20:06 pm »

I would quite like the opportunity to play with these too. Sounds quite interesting, as well as being quite clever. Is there any performance hit while moving around in MC with the plugins running?

robydago

  • Citizen of the Universe
  • *****
  • Posts: 518
Re: Computed Fields and History
« Reply #4 on: June 25, 2007, 02:05:31 pm »

I'm interested!
Logged

Tanoshimi

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Computed Fields and History
« Reply #5 on: June 25, 2007, 06:11:56 pm »

Thanks for the interest.  As for performance hits, I have both of them running seperately (did I mention I'm thinking about combining them?) and you have a small lag the first time you go into a plugin.  After you've been in it once, there's no lag going back into it, and I haven't noticed any issues going between songs, schemes, or views.  I'll probably post them here soon, so I can get some beta testing (it's only run on two machines so far). 

Before I do, maybe someone has suggestions for other items?  Both of these function based upon the "do this everytime the song changes" theory, so if there are other things you'd like to do before/after the track changes, let me know.  I love the challenge.
-Tano
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Computed Fields and History
« Reply #6 on: June 26, 2007, 01:17:14 am »

would/could the plugin(s) be able to produce a list of most played tracks over a given period of time? The past month, or six months, or year for example?

[number plays] is ok-ish, but it tracks the playcount from the library's conception, so a 'most played' list is based on 'all time' and so the older the library, the less useful/interesting this becomes.

-marko.

Tanoshimi

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Computed Fields and History
« Reply #7 on: June 26, 2007, 06:55:44 am »

That is an excellent idea Marko.  I'll add that before I throw it up.  While I would prefer for MC12 to handle the smartlists, I know they can't handle this data.  I'll include a quick smartlist editor that will generate a playlist from most frequently played songs for a given period.  Great idea!  Anyone else?
Logged

robydago

  • Citizen of the Universe
  • *****
  • Posts: 518
Re: Computed Fields and History
« Reply #8 on: June 26, 2007, 08:06:25 am »

Tanoshimi,
is there any way to use your plugin to have something like this?:
- two custom Rate1 and Rate2 fields where two different users manually put their rating of songs
- one custom AvarageRate filed computed by your plugin

the computed field should calculate the avarage between the two Rate1 and Rate2 fields *every time* a user update (as far as I know MC doesn't trigger any generic event "on field change", that's why I doubt it's possible)

Thanks,
Roby
Logged

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Computed Fields and History
« Reply #9 on: June 26, 2007, 11:00:29 am »

Tano, this sounds great!  I would like to see a very simple+easy to implement feature using this data: A play sheet (smartlist), with sequence numbers and timestamps that could handle instancing the same song multiple times.  For example:  Let's say that over the last three hours, I have played "Inna Godda Da Vida" 4 times, among all the other songs.  I would expect to see 4 different, sequentially correct entries for "Inna Godda Da Vita", etc etc etc.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Computed Fields and History
« Reply #10 on: June 26, 2007, 11:03:55 am »

Tano, this sounds great!  I would like to see a very simple+easy to implement feature using this data: A play sheet (smartlist), with sequence numbers and timestamps that could handle instancing the same song multiple times.  For example:  Let's say that over the last three hours, I have played "Inna Godda Da Vida" 4 times, among all the other songs.  I would expect to see 4 different, sequentially correct entries for "Inna Godda Da Vita", etc etc etc.
I hope this is dry humor taken to it's ultimate illogical conclusion.
Logged

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Computed Fields and History
« Reply #11 on: June 26, 2007, 11:20:58 am »

I'm looking for a smartlist that will generate a list of recently played songs as they were played, including duplicates and partials. 

If it helps you visualize this, where I have said "Inna Godda Da Vita", you can substitute with "Muskrat Love" or "Afternoon Delight".  Hope this helps.
Logged

mlefebvre

  • Galactic Citizen
  • ****
  • Posts: 452
  • nothing more to say...
Re: Computed Fields and History
« Reply #12 on: June 26, 2007, 11:26:10 am »

 ;D Is it it even possible to play Inna Godda Da Vita four times within 3 hours?  ;D
Logged

Tanoshimi

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Computed Fields and History
« Reply #13 on: June 26, 2007, 12:33:52 pm »

Roby - As it stands, for simplicity's sake, functions (like AVG and SUM) are not included in the ComputedFields plugin; however, you can create the formula to do an average, especially if only two fields are involved.  Something like [AverageRate]=([Rate1]+[Rate2])/2.  That's pretty much what this was designed for.  There's no way to monitor when a Field changes (well, I actually do have a way, but it's not preferred.

jgreen - There is a History Field stored in the library that will contain all that information.  Does it create a running "log" of what's been played?  No.  Could it?  I suppose.  Or I could just add logging to the plugin so that a seperate file is kept showing the last X songs.

ALL - In the process of doing this, I also had another idea that can be put into effect.  It would be called WatchedFields and it would basically take a certain action (or fire an event) when the designated field has been changed.  It would work on any field, but would not monitor them all, only the ones you choose to watch.  Any interest in this?
-Tano
Logged

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Computed Fields and History
« Reply #14 on: June 26, 2007, 03:10:24 pm »

Thanks, Tano.

The idea, of course, is that a user could select the last hour's tracks, complete with dupes, and copy them into playing now.
Logged

robydago

  • Citizen of the Universe
  • *****
  • Posts: 518
Re: Computed Fields and History
« Reply #15 on: June 26, 2007, 03:18:34 pm »

tanoshimi,
of course my question was not about an embedded AVG formula 'cause in that scenario it's very simple to do it with basic math operators; what I'm "worried" about is what will trigger the calculation, since no event is fired when a user manually update a field.
Your idea of WhatchedFields could be an interesting workaround, but can it be done without impacting performance?
Logged

Tanoshimi

  • Junior Woodchuck
  • **
  • Posts: 57
Re: Computed Fields and History
« Reply #16 on: June 27, 2007, 09:12:30 am »

Roby - No, there would be some performance hit.  The plugin would run in the background with a timer and at even intervals it would check to see if the existing value of the fields you've decided to watch is different than the last value.  If it is, then some kind of calculaton/event will take place.  That being said, if you only watch a few variables, it won't bother you and you won't even notice it.  If you watch 20-30 fields, then you might notice a performance hit (depending, of course, on the speed of your machine and the size of the library). 

I've found that might not even be necessary, since you generally (not always) only need a value when it's playing, and that's when the information gets updated.  If you're trying to make a Smartlist based upon a ComputedField, it will be as accurate as the last time the song played.  Any changes since then will not be reflected until the song is played again.  Still, it might be useful to watch those fields.
-Tano
Logged

Bluesman

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 71
Re: Computed Fields and History
« Reply #17 on: July 07, 2007, 09:50:10 pm »

Just noticed this thread. Don't know if this would be possible in your plugin or not. But basically I want to be able to play music from one smartlist but then every so many tracks insert a track from another smartlist. ie 5 music tracks and then a short sponsor announcement taken from the other smartlist. (for use in community radio)
I made a similar comment on this thread-

http://yabb.jriver.com/interact/index.php?action=post;topic=41252.0;num_replies=16

"I'm not sure how to do this but-
What I want to do is set up an auto radio station playlist which would
1. Basically play from one genre.
2.....but would also insert a set number of promo & station id's from another genre

The promos would have to be limited to a certain number per hour (say 12)
I would want the playlist to run indefinitely in a random order.

Is this possible?

Any help appreciated. I tried to do this once before but didn't work very well. Apologies if I've missed something similar in the forum."

Sorry if this is inapropriate for this thread, then please ignore.
Geoff
Logged
Is there any other music besides Blues?
Pages: [1]   Go Up