AsPyFoo
by tnl (tnl TA asia TOD com)
AsPyFoo is a set of
Python
scripts that lets you play songs in
Audiosurf
according to
foobar2000's
active playlist or playback.
Execute AsPyFoo, specifying the Audiosurf character you want to use.
What AsPyFoo does, in a loop
- If playback in foobar2000 is paused, it advances the playlist
(plays the next song).
If playback is stopped, it starts playback.
- If then a song file is playing and is surfable, it loads the file in Audiosurf.
- Once the track appears for surfing, it pauses foobar2000.
What this means
- You can choose songs to surf, by having a foobar2000 playlist.
- That songs can optionally remain playing during track loading,
serves as a preview.
- The playlist advances when a song ends, since foobar2000 playback
is paused while you surf.
Implications that may not sound so great
As a system, AsPyFoo is indirect, since it is effectively hidden
without its console shown. There is no indication that it is responsible
for what it does, unless it works and you as a user are aware of its
presence.
Because Audiosurf and foobar2000 aren't integrated means
it can be weird to bridge the two apps.
For example, if you play Audiosurf fullscreen at a resolution different
than your desktop resolution for the same monitor,
it can be awkward and annoying to switch back and forth between Audiosurf
and foobar2000, when you want to view or change your playlist or song.
I cannot prescribe a set usage pattern for either foobar2000 or Audiosurf,
but I can list some behaviors to adopt to make it tolerable to use.
It may be best to use AsPyFoo in your manner that avoids
or accepts the issues brought on by a lack of an integrated user interface.
- You could activate a playlist before surfing fullscreen,
switching between Audiosurf and foobar2000 as necessary.
- You could choose to play Audiosurf windowed,
for quicker access to foobar2000's window.
- You could control foobar2000 while still in Audiosurf
(using global keyboard shortcuts in foobar2000).
Setup & Usage
AsPyFoo has only been tested on Windows XP Pro 32bit.
I don't expect it to work on 64bit Windows but if it does,
this documentation should be changed.
AsPyFoo requires the following installed, firstly:
Because of how COM works, foobar2000 must be installed to a known location
on the system, I think, so this likely disqualifies a portable version of
foobar2000.
There is no graphical user interface in AsPyFoo.
There is a script to generate shortcuts in order to control AsPyFoo.
Execute Make_Shortcuts.pyw to create Windows shortcuts
in the subfolder named shortcuts, after you have placed
AsPyFoo in a desired folder.
- Execute an AsPyFoo character shortcut to surf foobar2000's current song.
- Execute any of the AsPyFoo character shortcuts again to switch characters.
- Exit is obviously not a character. Use this to exit AsPyFoo.
As such is the design, I throw the shortcuts I want into a folder that
Launchy
indexes, so that I am keystrokes away from using AsPyFoo.
Configuration
options.ini
can be edited (but don't remove it, break it, etc.; there's no error handling).
I haven't tested other Audiosurf addons but I imagine AsPyFoo would not
interfere with those that only set startup options.
Download
You can download AsPyFoo as a set of Python scripts.
The latest version
is also available in my bitbucket.
The project itself isn't developed enough to warrant an upgrade procedure, so expect
that the files (including configuration) are likely incompatible between versions.
Script files contained
audiosurf_foobar2000.pyw
- The main end-user script, which makes foobar2000 playback for surfing.
- Invokes aspyfoo.py (in a console) as needed
Make_Shortcuts.pyw
- This script makes Windows shortcuts to
audiosurf_foobar2000.pyw
aspybase.py
- Support for a script that runs in the background, and registers with Audiosurf
- Provides support for a local ASH database
(ashes.db)
- It is still rather tied to aspyfoo.py.
aspyfoo.py
- Extends AsPy to play Audiosurf sequentially mirroring the active
playlist in foobar2000 — I haven't tried alternative
foobar2000 GUI components to the default, so I'm not sure if they work.
- Updates ashes.db for every song loaded
- In actuality, the reason why the scripts aren't combined is because
I cannot easily get COM calls to work in the AsPy WndProc...
I am learning threading somewhat...
ashifyfoo.py
- Unsupported, half-working, mass song loader
- Generate ASH files for all songs surfable
(and tagged with artist and title) in your foobar2000 Media Library.
- Attempts to load songs for those not loaded before, according to
ashes.db
- Unfortunately I can seemingly interact with only one Audiosurf instance.
- Audiosurf should be in running in windowed mode (small size recommended).
- Lower Audiosurf's process priority, perhaps.
- Audiosurf sometimes crashes on certain files (likely corrupt or poorly encoded),
so this script might not work so well in practice.
I end up just temporarily archiving problematic media files.
- This may require that you (re)navigate to the character screen to get
the script working.
runwithoutfocus.pyw
- Script that just issues "ascommand runwithoutfocus" to Audiosurf.
Meant to be used with ashifyfoo.py,
for some reason. Ghetto factor up.
ashstats.py
- Primative means for getting basic information about
ashes.db