Name That Tune (Using Random Part of a Song)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Name That Tune (Using Random Part of a Song)

Post by magcynic » Wed Sep 20, 2017 5:46 pm

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?

Posts: 10933
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

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

Post by Peke » Fri Sep 22, 2017 8:17 pm

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
      While SDB.Player.IsStartingPlayback
      SDB.Player.Playbacktime = round(SDB.Player.CurrentSong.SongLength / 2)
    End If
    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
    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,
MM Core Developer and Admin of free MediaMonkey extensions Hosting
How to add Images to forum

Post Reply