Name That Tune (Using Random Part of a Song)

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

magcynic
Posts: 1
Joined: Wed Sep 20, 2017 5:43 pm

Name That Tune (Using Random Part of a Song)

Post by magcynic »

Is there a script or addon that lets me go through a list of songs that starts each song at a random point or, at the very least, a certain number of seconds/minutes into the song?
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Name That Tune (Using Random Part of a Song)

Post by Peke »

You can try this. In Notepad save it as <MEDIAMONKEYINSTALLFOLDER>\Scripts\Auto\intro.vbs And you should get meny Intro ON/OFF to play 10 of each middle of playlist track

Code: Select all

'Dim SDB
'Set SDB = CreateObject("SongsDB.SDBApplication")

Dim IntroTime
IntroTime = 10

Sub IntroTimer( Timer)
  If SDB.IniFile.BoolValue("Player Tools","Intro Playback") Then
    If SDB.Player.isPlaying = Not SDB.Player.isPaused Then
      SDB.Player.Next
      While SDB.Player.IsStartingPlayback
        SDB.ProcessMessages
      Wend
      SDB.Player.Playbacktime = round(SDB.Player.CurrentSong.SongLength / 2)
    End If
  Else
    Script.UnregisterEvents Timer
  End If
End Sub

Sub OnStartup
  Set MyPreviewButton = SDB.UI.AddMenuItem(SDB.UI.AddToolbar("Player Tools"), 0, 0) 
  SDB.Objects("MyPreviewButton") = MyPreviewButton
  MyPreviewButton.OnClickFunc = "MyPreviewButtonAction"
  MyPreviewButton.UseScript = Script.ScriptPath
  MyPreviewButton.Hint = SDB.Localize("Enable, disable Intro Playback")
  MyPreviewButton.Caption = SDB.Localize("Intro OFF")
  SDB.IniFile.BoolValue("Player Tools","Intro Playback") = False
End Sub

Sub MyPreviewButtonAction(arg)
  If SDB.IniFile.BoolValue("Player Tools","Intro Playback") Then
    SDB.IniFile.BoolValue("Player Tools","Intro Playback") = False
    Set IntTmr = SDB.Objects("IntTmr")
    SDB.Objects("MyPreviewButton").Caption = SDB.Localize("Intro OFF")
    Script.UnregisterEvents IntTmr
  Else
    SDB.IniFile.BoolValue("Player Tools","Intro Playback") = True
    Set IntTmr = SDB.CreateTimer(IntroTime*1000)
    SDB.Objects("IntTmr") = IntTmr
    SDB.Objects("MyPreviewButton").Caption = SDB.Localize("Intro ON")
    Script.RegisterEvent IntTmr, "OnTimer", "IntroTimer"
  End If
End Sub
 
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply