Name That Tune (Using Random Part of a Song)

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Name That Tune (Using Random Part of a Song)

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

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
      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
 

Name That Tune (Using Random Part of a Song)

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?

Top