INTERACT FORUM

Please login or register.

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

Author Topic: Mash-Up Smartlist Help  (Read 3528 times)

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Mash-Up Smartlist Help
« on: January 08, 2014, 01:11:36 pm »

I'd like to create a Smartlist that plays random 30-second clips of random songs.  Is it possible to get it to only play clips of a song?

For example:
Random Song 1 - 1:31-2:01
Random Song 2 - 0:05-0:35
Random Song 3 - 2:28-2:58
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Mash-Up Smartlist Help
« Reply #1 on: January 08, 2014, 04:06:16 pm »

The Particles feature is for exactly this (assuming you want to set the in/out points yourself).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Mash-Up Smartlist Help
« Reply #2 on: January 08, 2014, 04:09:55 pm »

If you want it just to "preview" tracks, you can enable Preview Play mode:  Player > Preview Mode.

However, this only allows you to select from the beginning and from 30 seconds in as options, and you have to pick one, it doesn't "shuffle modes" on the fly.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Mash-Up Smartlist Help
« Reply #3 on: January 08, 2014, 04:15:39 pm »

Along those lines...

Some kind of "auto-mashup" mode (probably enabled via that Preview Mode menu) would be sick.  In other words, it would take whatever Playing Now list you add, and make little temporary "auto-particles", shuffling around the position and length a bit in each track.  It could maybe, even (if it was very clever), analyze the "intensity" of the different pieces of the track to try to make it more seamless (alternating between slow-BPM/quiet parts for a while, and then going into high-BPM/loud parts, and back again).

Might be hysterical and very fun at parties, fed with the right playlist.

We should poke Matt about it when he's feeling better.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #4 on: January 08, 2014, 04:18:38 pm »

Thanks Glynor.  I thought about using Particles, but then I would need to create pfiles for every song.  I was hoping it would be more random and automatic.

The Preview Mode from 30-seconds in is probably closer to what I'm looking for.  Never even knew that option existed--thank you.  Would be nice if I could set it to play from different spots other than just 30-seconds in, but it's a good start for now.

Your auto-mashup mode idea for parties is exactly what I'm trying to create. 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #5 on: January 08, 2014, 04:24:12 pm »

We could quickly script up a tool to set the Playback Range for a sequence of files.  It could set the duration and start/stop times to fit within the tracks duration.  Then you'd just play random tracks and it would just work.
Logged
The opinions I express represent my own folly.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Mash-Up Smartlist Help
« Reply #6 on: January 08, 2014, 04:24:58 pm »

Yeah.  It isn't a bad idea at all.  But it would be tedious and time consuming to do it currently.  If you want to select them manually like a real mashup artist, though, the tool is there to divvy up the files.

I'm not sure how creating the particles via COM would work, so I'm not sure if a third-party plugin could do it justice.  It might be the type of thing that would tickle Matt's fancy though.  You never know.   ;) ;D
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Mash-Up Smartlist Help
« Reply #7 on: January 08, 2014, 04:28:24 pm »

We could quickly script up a tool to set the Playback Range for a sequence of files.  It could set the duration and start/stop times to fit within the tracks duration.  Then you'd just play random tracks and it would just work.

That's what I was thinking.

You can set them on the fly, and they'll apply to a current Playing Now?

You'd have to make a very clever plugin to do it with the audio analysis feature I was dreaming about.  You could do it though.  When enabled, it would just have to set the "shuffled playback ranges" and then generate "fingerprints' for each item remaining in the playback list, and then order them appropriately.  It wouldn't be instantaneous, but it could be the type of thing where you click "go" from within the plugin, it thinks for a bit, and then fills Playing Now and starts playing.  Kinda like the Play Doctor.

That's of course, a much bigger thing.

For the simple scripted method, would those Playback Ranges be remembered for next playback (in other words, do you need to wait and clear them after playback)?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #8 on: January 08, 2014, 04:28:54 pm »

I wouldn't bother with Particles.  connersw wants 30 second playback of random tracks.  My pscriptor.pl tool just needs a scriptlet to examine the track duration, and randomly set the playback range to fit within.   All you have to do is select the files, and run the script, and start playback of the random track smartlist.  To go back to normal mode, just clear Playback Range.

I like your idea Glynor.  It would be sick indeed.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #9 on: January 13, 2014, 06:11:11 pm »

I've created a RandomPlaybackRange scriptlet for pscriptor if you want it.  It works like this:

   - Add Duration to the view if it doesn't already exist

   - Select the files for which you want random range play back
   - Run the script
   - Start playback

Each time run, the script assigns a random playback range of a given duration to each file, and this is used when you playback a file.  Just clear Playback Range to revert to normal playback.

The scriptlet will be included with the pscriptor package henceforth.
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #10 on: January 14, 2014, 09:29:10 am »

Thanks MrC.  I'd love to try it.  I didn't see it in the pscriptor_1.03.zip file, so I'm guessing it hasn't been updated yet?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #11 on: January 14, 2014, 01:22:54 pm »

I've updated the code to version 1.04:

    http://yabb.jriver.com/interact/index.php?topic=85990

The command line you'll use is:

  perl pscriptor.pl  -c pscriptor-config.txt  -f "Playback Range" -E RandomPlaybackRange

Be sure that the Playback Range and Duration fields are in the view.  The instructions in the thread above, the README.txt and in the Scriptlets\RandomPlaybackRange.pm should give you what you need, but feel free to ask questions specific to this module here.
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #12 on: January 15, 2014, 09:42:51 am »

Nice -- it works. 

I'll have to play with it a bit more when I have more time (took me a bit to get everything installed and to read up on it). 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #13 on: January 15, 2014, 12:51:32 pm »

Thanks for the feedback.

If you want to change the playback duration, currently you have to modify the value of $playback_length in the script:

    my $playback_length = 30;       # use 30 seconds as the random track playback length

I'd like to implement passing options to scriptlets, but the scriptlet could also be modified to read, if it existed, a the value from a field from the view, so you could set the length there.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #14 on: January 15, 2014, 01:43:32 pm »

Here's an update to the scriptlet which corrects an off-by-one error in the playback range.  It also now supports reading from an expression column named "Playback Duration", which you can set to the number of seconds you want used as the duration.  The script defaults to 30 (which you can change inside the script: see $def_playback_duration), or you can just add an expression column in the file list with the value you want.
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #15 on: January 15, 2014, 02:57:36 pm »

Very cool MrC.  I noticed it was giving me 29-seconds before, and then 1:59 when I changed the scriplet to 120.  It does play for a second, or fraction of a second, though at 0:00 so I thought the old way was "accurate."  The correction reads more like what the user would expect, and I prefer it. 

The 30-second default works if the Playback Duration Field does not exist.  If it exists and is empty though, the command line gives an error message requesting a numeric value, but still creates a zero offset Playback Range.  Would it be possible to edit the scriplet so that it looks not just for the Field, but also that it has a value > 0? 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #16 on: January 15, 2014, 04:04:56 pm »

Here's an update that will use the default value when your column is empty or 0.  You're too good.
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #17 on: January 16, 2014, 09:06:06 am »

Perfect -- you're the man.
Logged

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #18 on: May 06, 2014, 09:39:56 am »

MrC:  I've been using this for the last few months.  Thank you again, very much.  I was wondering if it would be possible to get a "post Mash-Up" script that I could run that would clear the Playback Duration and Playback Range Fields? 

Also, I have run this on some Video (watching Cartoons like this makes my boys howl), but it runs into problems with the Bookmark Field.  If the Bookmark is already set past or within the Playback Range, it does not play the clip or cuts it short.  As a result, if I have a Playlist on a loop, it only quickly flashes each Video the second time around since the Bookmark is now at the end of the Playback Range.  Is there any way to clear the Bookmark Field?  The only alternative I've found is to Mark as not Played which can corrupt some of my views.  Or else to remember to toggle off/on the Resume playback using bookmarks setting. 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #19 on: May 06, 2014, 01:29:48 pm »

You're welcome, and I'm glad it is bringing joy to the boys.

Since you may be doing this frequently, why don't I add a new option you can pass to the script that clears the fields for you:

  ... -f "Playback Range" -E RandomPlaybackRange -a clear

You are no longer required to have the Playback Duration column anymore (you can still use it if you want) - you can instead pass the value on the command using -a:

     ... -f "Playback Range" -E RandomPlaybackRange -a 30

The -a 30 passes the value 30 to the scriptlet, which knows its your desired playback duration.

I had not considered the affects of the Bookmark field and this script.  I'll set it to 0 at the same time Playback Range is updated so the scriplet will all work as you expect.

FYI 1: You can clear the Bookmark field (or any Clear-only type field).  Select the files, edit the value, and select the empty row in the pop-up list that appears.  It is not an obvious UI and many people don't notice this feature.

FYI 2: pscriptor already gives you the ability to quickly set some value.  Setting the Bookmark field would be like this:

   perl pscriptor.pl -c pscriptor-config.txt -f "Bookmark" -e "$_=0"

Using -e (instead of -E) evaluates the command-line supplied perl code.  Setting the variable $_ is all that's needed to update the supplied -f fields.  The $_ variable contains the current value, and setting it will update the value with the new calculated value.  Above, the value is simply 0.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #20 on: May 06, 2014, 02:40:09 pm »

Another question: do you want the clear option to also clear the Bookmark?
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #21 on: May 06, 2014, 02:48:45 pm »

Yes please.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #22 on: May 06, 2014, 02:55:21 pm »

Here's the new scriptlet which you can drop into your Scriplets folder.

Clear using the syntax:

   ... -f "Playback Range" -E RandomPlaybackRange -a clear

Bookmarks are now cleared when the playback range is set.

Note: Playback Range and Bookmark are not actually cleared, but set to 0 (and this seems sufficient).  It is not currently possible to clear a value via MCWS (or MPL import).  I have a feature request in for this.
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #23 on: May 06, 2014, 08:17:51 pm »

Thanks MrC--you are awesome.  I hadn't been following the pscriptor thread, so I wasn't up to date on all the changes.  Once I downloaded the new version of pscriptor and added the MCUtils folder, I got it running no sweat.

Getting rid of the Playback Duration Field and being able to set the duration from the command line is great.

The only issue I am having is with not being able to clear a value via MCWS.  With Playback Range set to 0, the File plays back normally (no issues).  However, if I want to set a new Playback Range (ie rerun ... -f "Playback Range" -E RandomPlaybackRange -a 30), I get an error unless the Playback Range is completely clear. 

"Uncaught exception fro user code: Failed to get clipboard contents. Stopped at MCUtils/Misc.pm line 105, <$io> line 1. MCUtils:Misc::parse_clipboard<'perl pscriptor.pl. -c pscriptor-config.txt  -f "Playback Range"...'> called at pscriptor.pl line 106"
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #24 on: May 06, 2014, 08:24:29 pm »

Hi connersw,

Thanks for the nice words.  I almost suggested that you might need to update pscriptor, but then thought "Nah, I'm sure connersw is up to date."  Doh!

Anyway, there should be no issue with the 0 value.  I tested it earlier, and just now again.  The error you are seeing:

   Failed to get clipboard contents

indicates that there is no active selection.  Try re-selecting the files and re-running the command.
Logged
The opinions I express represent my own folly.

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: Mash-Up Smartlist Help
« Reply #25 on: May 07, 2014, 07:50:18 am »

Doh!  That was it.  I was using a new skin and wasn't familiar with the way the colors changed.  I was testing it by running the commands back-to-back, and even though it looked like the tracks were still selected, they were not.  Re-selecting them, it runs perfect regardless of what is in the Playback Range Field.  Thank you again. 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Mash-Up Smartlist Help
« Reply #26 on: May 07, 2014, 11:31:27 am »

I run sequences of commands frequently.  Something must have stolen the focus from the selected tracks, but it wouldn't have been pscriptor.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up