English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 03 September 2015, 01:19   #1
tenuke
Derp
 
Join Date: Oct 2014
Location: -
Posts: 14
mod&sid -player with support for enormous playlist?

Hey

I got like 50k songs in SID-format and 10k+ tracker songs.

Hippoplayer would play these but does not seem to support large playlist

Any idea what player or some other solution I could use to get this all songs suffled?
If some cli-based non-gui player can do it, its fine for me.

Wouldnt need playlists either if the player can just pick the songs randomly from some given directory tree.
tenuke is offline  
Old 03 September 2015, 12:28   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,047
I`m using Hippo with about 5400 modules in one playlist (~220 kbyte). Maybe you can test where is the limit for a playlist? Normaly there shouldn`t be a limit (except memory limit) because the playlist is just an text file containing module path. Also verify the playlist file (load it with a text viewer/editor). Would be nice to know if a limit exists.
daxb is offline  
Old 03 September 2015, 12:30   #3
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,047
Quote:
Originally Posted by tenuke View Post
Wouldnt need playlists either if the player can just pick the songs randomly from some given directory tree.
Hippo has an ARexx port so it should be possible without playlists.
daxb is offline  
Old 03 September 2015, 20:03   #4
tenuke
Derp
 
Join Date: Oct 2014
Location: -
Posts: 14
Thanks for reply

it now looks like hippoplayer would have some limit around 15-16k files on playlist.
I tried adding directories in alphabetical order from A to Z into the playlist, and it did add files up to some part of G -directory..

Unfortunately I have no idea about how to do Arexx and then how to use it with hippo.

Would it be feasible for you to give some pretty much ready-to-run kind of solution for this?
So I think what would be needed now then is some Arexx script picking songs randomly from given directory tree(subdirectories under one 'main' directory). And then feeding them in this random order for hippo to play.

Ill promise to pay it forward if you can guide me thru this
tenuke is offline  
Old 05 September 2015, 01:32   #5
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,047
I tested it with Hippo v2.45 using its ADD button. I chose various system files. If the list reaches 16383 entries (without directories) and you want to add one more a requester says: "My stomach feels content.". So, 16383 ($3FFF) files seems the max. (you cannot add more).

Possible solutions:

Use other Modplayer.

Find someone who wants to fix this in Hippo. I don`t know if the source code is available.

Instead of one playlist file use several that fit the limit. E.g. load them using Hippos function keys.

Build your own playlist file using Hippo (join the parts) or any other tool that is able to list files with full path. List can do it like this:
Code:
List modfiles:a/ FILES LFORMAT="%P%N" ALL >>Ram:playlist
It will add all files in modfiles:a/ and subdirs to file Ramlaylist

A simple ARexx script looks like this:
Code:
/* HippoPlayer - Play a random file from given playlist
 *
 * Requires: rexxsupport.library rexxtricks.library
 *
 * Usage: "rx PlayRandom.rexx <playlist>"
*/

hippo = 'Tools:Sfx/Player/HippoPlayer/HiP'    /* Full path to HippoPlayer */
timeout = 600    /* If HippoPlayer can`t get the Module duration in seconds
                    this value will be used as Module duration as time out. */

PARSE ARG playlist
SIGNAL ON BREAK_C
OPTIONS RESULTS
CALL PRAGMA('W', 'N')
CALL AddLibs()

IF ~EXISTS(hippo) THEN DO
 SAY hippo 'do not exists!'
 EXIT
END
IF ~EXISTS(playlist) THEN DO
 SAY playlist 'do not exists!'
 EXIT
END
IF ~SHOW('P', 'HIPPOPLAYER') THEN DO
 myRC = StartProg(hippo, 'HIPPOPLAYER')  /* ARG1 = Program, ARG2 = Port of Program. Returns TRUE by success or FALSE if not */
 IF myRC = 'FALSE' THEN DO
  SAY hippo 'failed to start!'
  EXIT
 END
END
/*
SAY 'Loading playlist' playlist 'please wait...'
IF ~READLINES(playlist, , , '%4096c', file) THEN DO /* rexxtricks - reads all lines into stem var. It`s slow so we don`t use it. */
 SAY 'READLINES() failed on' playlist
 EXIT
END
*/
CALL OpenFile('list', playlist, 'R')   /* Open file (<logical name>, <filespec>, [<option>]) */
playlistsize = SEEK('list', 0, 'E')    /* Get filesize in bytes */
ADDRESS 'HIPPOPLAYER'
CALL PlayRandom()

EXIT


PlayRandom: PROCEDURE EXPOSE timeout playlistsize /* file. is needed when using READLINES() */
pos = SEEK('list',TRUNC(playlistsize * RANDU(TIME('S'))), 'B') /* Get random position */
DO i = 1
 file = READLN('list')
 IF EXISTS(file) & file ~= '' THEN LEAVE
 newpos = SEEK('list', pos - i, 'B')   /* Go backwards in playlist until we get a file that exists. */
 IF (pos - i) < 0 THEN pos = playlistsize /* If begin of file is reached set new pos to end of file. */
END
PLAY file
GET DURA ; sec = RESULT
IF sec = 0 THEN sec = timeout
SAY 'Time out ('sec' sec):' file
CALL KeyLoop()
/* When using READLINES() then this block would be needed.
randomnumber = RAND(1, file.0)
IF EXISTS(file.randomnumber) & file.randomnumber ~= '' THEN DO
 PLAY file.randomnumber
 GET DURA ; sec = RESULT
 IF sec = 0 THEN sec = timeout
 SAY 'Play for' sec 'seconds:' file.randomnumber
 CALL KeyLoop()
END
ELSE CALL PlayRandom()
*/
RETURN

KeyLoop:
CALL TIME('R')       /* Start timer */
key = GETKEY(sec)
IF ~SHOW('P', 'HIPPOPLAYER') THEN DO
 SAY 'Can`t work without HippoPlayer so I quit.'
 EXIT
END
SELECT
 WHEN key = 9 | key = -1 | key = 'l' THEN DO  /* Play next song. */
  CALL PlayRandom()
 END
 WHEN key = 3 | key = '.' THEN DO /* Jump forwards in song. */
  FFWD
  CALL KeyLoop()
 END
 WHEN key = 1 | key = ',' THEN DO /* Jump backwards in song. */
  REW
  CALL KeyLoop()
 END
 WHEN key = 5 | key = ' ' THEN DO /* Pause/Play song. */
  GET PLAY
  IF RESULT = 1 THEN DO
   STOP
   elapsed = TIME('E')
   IF elapsed // 1 >= 0.50 THEN sec = sec - (elapsed + 1) /* Substract elapsed time from sec. */
   ELSE sec = sec - elapsed
   sec = TRUNC(sec)
  END
  ELSE CONT
  CALL KeyLoop()
 END 
 WHEN key = 'ESC' THEN DO   /* QUIT HippoPlayer and Script. */
  QUIT
  EXIT
 END
 OTHERWISE CALL KeyLoop()
END
RETURN

/* Start Program if not already started */
StartProg: PROCEDURE
prog = ARG(1)
port = ARG(2)
IF ~SHOW('PORTS', port) THEN DO
 ADDRESS COMMAND
 'Run >NIL: "' || prog || '"'
 DO 2 WHILE ~SHOW('PORTS', port)  /* checks 2 times for port */
  'waitforport' port    /* waitforport waits up to 10 seconds */
 END
 IF RC = 5 THEN DO     /* IF starting prog fails then return FALSE */
  'RequestChoice ERROR! "Unable to load:*N'prog'" "Ok" >NIL:'
  RETURN 'FALSE'
 END
END
RETURN 'TRUE'

OpenFile: PROCEDURE
logicalName = ARG(1)   /* ARG 1 is a logical name that will be used by other functions */
filespec = ARG(2)    /* ARG 2 is a device or full path of a file to open */
option = ARG(3)     /* ARG 3 can be (R)ead, (W)rite or (A)ppend */
IF ~OPEN(logicalName, filespec, option) THEN DO
 SAY "Can't open" filespec "(" || option || ")"
 CALL CLOSE(logicalName)
 EXIT
END
RETURN

/* Check/Add libs */
AddLibs: PROCEDURE
libs = 'rexxsupport.library rexxtricks.library'
DO i = 1 TO WORDS(libs)
 IF ~SHOW('L', WORD(libs, i)) THEN DO
  IF ADDLIB(WORD(libs, i), 0, -30, 0) = 0 THEN DO
   ADDRESS COMMAND 'Run >NIL: C:RequestChoice "PlayRandom.rexx" "Can`t open" WORD(libs, i) "_OK"'
   EXIT
  END
 END
END
RETURN

/* Error message on CTRL+C */
BREAK_C:
SAY 'Quit PlayRandom.rexx only!'
RETURN

Last edited by daxb; 07 September 2015 at 15:13.
daxb is offline  
Old 05 September 2015, 18:42   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,047
I`ve changed the script above to let it work better. The playlist will load only on script launch. So skip to next song is as fast as HippoPlayer itself. I`ve also add some keyboard hotkeys for next song, forward, backward, pause/play and quit. Quit key is ESC, the others are the same as HippoPlayer uses but can be changed if you like. If you don`t want to start HippoPlayer manually change the variable "hippo" for the full path on top of the script. Change the timeout (default 600 seconds) if you need. It will be used for modules (e.g. xm, s3m, med) that HippoPlayer doesn`t provide duration time. HippoPlayer configuration needs to be at least "Time/duration, pos/len" (see Prefs/Display/Show) to get song duration. It is also a good idea to disable Prefs/General/Startup.
daxb is offline  
Old 05 September 2015, 22:23   #7
jPV
Registered User
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 618
I also made him an arexx script which creates song list to a file, and then loads new random song to hippoplayer when the previous has finished or skipped. Script runs on background until hippo has been quitted.

http://jpv.wmhost.com/jpv_software/arexx/Random2HiP.lha
jPV is offline  
Old 06 September 2015, 14:16   #8
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,047
@jPV:
The SEEK idea to get a random line from playlist file is nice. It prevents to read the whole playlist like I do. I`m not sure but if SEEK points to last line and you read two lines you will get an empty string as result. So you won`t ever get the last entry? If so just check for empty string and if true take the pervious read line.

@tenuke:
If you like I can adapt jPV`s random method? Then 'Loading playlist' isn`t necessary.
daxb is offline  
Old 07 September 2015, 07:22   #9
jPV
Registered User
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 618
Quote:
Originally Posted by daxb View Post
@jPV:
The SEEK idea to get a random line from playlist file is nice. It prevents to read the whole playlist like I do. I`m not sure but if SEEK points to last line and you read two lines you will get an empty string as result. So you won`t ever get the last entry? If so just check for empty string and if true take the pervious read line.
Seek usually goes to middle of line and readln() reads only partial line then, that's why I have the second readln() there to get a complete line. If it gets an empty string from the end of the file, I have DO UNTIL rivi~="" loop there to try again until there will be something. So, it handles the empty string situation too
jPV is offline  
Old 07 September 2015, 15:14   #10
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,047
Yes, I knew why you uses two READLN()`s but wasn`t sure about the "DO UNTIL rivi.." loop.

ps: small update of above script.
daxb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
6581 & 8580 SID Chips For Sale. FatterAgnus MarketPlace 4 06 November 2015 16:13
New iPhone App: MOD/SID/Music player SparkyNZ News 17 04 November 2014 09:57
FAT Player MikMod v5 (amiga mod player for Nintendo DS) spajdr Amiga scene 0 14 August 2008 21:55
NSF/SID/SPC on your MP3 player Frog News 2 28 March 2007 21:08
Play Nes & Sms sid tunes on yout C=64 Fred the Fop Retrogaming General Discussion 0 16 June 2005 09:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.08406 seconds with 15 queries