diff --git a/CMakeLists.txt b/CMakeLists.txt index 38cc63a..6014de7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,7 @@ set(HEADERS unset(EXTRAS) if(TARGET boo) include_directories(${BOO_INCLUDE_DIR} ${BOO_INCLUDE_DIR}/../lib ${BOO_INCLUDE_DIR}/../soxr/src - ${LOGVISOR_INCLUDE_DIR} ${ATHENA_INCLUDE_DIR}) + ${LOGVISOR_INCLUDE_DIR} ${ATHENA_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}) list(APPEND EXTRAS lib/BooBackend.cpp include/amuse/BooBackend.hpp) endif() diff --git a/README.md b/README.md index 6f7d56c..1d4d2d8 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,40 @@ The project is designed for compatibility with Audio Groups and Song data found in PC/N64/GCN/GBA games using the *MusyX* audio engine; providing an alternate runtime library to use for sequencing these games' audio libraries. +#### Command-Line Player + +[Download](https://github.com/AxioDL/amuse/releases) + +A simple command-line program for loading and playing AudioGroups out of +game archives or raw (`.proj`,`.pool`,`.sdir`,`.samp`) files is provided. + +```sh +[jacko@ghor ~]$ amuseplay test.proj +░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +░░░ ████ ████ ┃ ████ ████ ████ ┃ ████ ████ ░░░ +░░░ ████ ████ ┃ ████ ████ ████ ┃ ████ ████ ░░░ +░░░ ▌W▐█ ▌E▐█ ┃ ▌T▐█ ▌Y▐█ ▌U▐█ ┃ ▌O▐█ ▌P▐█ ░░░ +░░░ │ │ ┃ │ │ │ ┃ │ │ ░░░ +░░░ A │ S │ D ┃ F │ G │ H │ J ┃ K │ L │ ; ░░░ +░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +: cycle MIDI setup / channel, : volume, : PANIC +: sustain pedal, : pitch wheel, : mod wheel +: octave, : velocity, : channel, <,/.>: program, : quit + 0 Setup 0, Chan 0, Prog 0, Octave: 4, Vel: 64, VOL: 80% +``` + +The command-line program requires a windowing environment and will open a +small 100x100 window alongside your terminal/cmd. This window **must** be +frontmost, since it listens to full keyboard events through it. + +If a MIDI keyboard is connected and recognized by your OS before `amuseplay` +is launched, you may directly control the sequencer using physical input. + +On OS X and Linux, `amuseplay` will advertise a virtual MIDI-IN port for +other audio applications to route their MIDI messages to. This enables +tracker, drum machine, and DAW applications to produce sampled audio +using Amuse directly. + #### Library The Amuse API exposes full interactivity between a client application @@ -78,9 +112,3 @@ int main(int argc, char* argv[]) return 0; } ``` - -#### Tool - -In addition to the library, a command-line tool for performing various pipeline -tasks is provided. Compilers for audio groups and song data, as well as basic -playback functionality is available via the tool. diff --git a/driver/main.cpp b/driver/main.cpp index e733ad4..7625e71 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -568,13 +568,20 @@ struct AppCallback : boo::IApplicationCallback if (m_argc < 2) Log.report(logvisor::Fatal, "needs group path argument"); - amuse::ContainerRegistry::Type cType = amuse::ContainerRegistry::DetectContainerType(m_argv[1]); +#if _WIN32 + char utf8Path[1024]; + WideCharToMultiByte(CP_UTF8, 0, m_argv[1], -1, utf8Path, 1024, nullptr, nullptr); +#else + const char* utf8Path = m_argv[1]; +#endif + + amuse::ContainerRegistry::Type cType = amuse::ContainerRegistry::DetectContainerType(utf8Path); if (cType == amuse::ContainerRegistry::Type::Invalid) Log.report(logvisor::Fatal, "invalid/no data at path argument"); Log.report(logvisor::Info, "Found '%s' Audio Group data", amuse::ContainerRegistry::TypeToName(cType)); std::vector> data = - amuse::ContainerRegistry::LoadContainer(m_argv[1]); + amuse::ContainerRegistry::LoadContainer(utf8Path); if (data.empty()) Log.report(logvisor::Fatal, "invalid/no data at path argument"); diff --git a/include/amuse/Common.hpp b/include/amuse/Common.hpp index 71ee10b..022c33d 100644 --- a/include/amuse/Common.hpp +++ b/include/amuse/Common.hpp @@ -4,9 +4,12 @@ #include #include #include -#include #include +#ifndef _MSC_VER +#include +#endif + namespace amuse { diff --git a/lib/AudioGroupSampleDirectory.cpp b/lib/AudioGroupSampleDirectory.cpp index e0c9d33..7f9baff 100644 --- a/lib/AudioGroupSampleDirectory.cpp +++ b/lib/AudioGroupSampleDirectory.cpp @@ -53,7 +53,7 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(const unsigned char* data, const AudioGroupSampleDirectory::ADPCMParms* adpcm = reinterpret_cast(data + store.first.m_adpcmParmOffset); - store.second = *adpcm; + store.second.dsp = adpcm->dsp; store.second.swapBigDSP(); }