This commit is contained in:
Jack Andersen 2016-05-30 10:25:46 -10:00
commit 13a55764a0
5 changed files with 49 additions and 11 deletions

View File

@ -62,7 +62,7 @@ set(HEADERS
unset(EXTRAS) unset(EXTRAS)
if(TARGET boo) if(TARGET boo)
include_directories(${BOO_INCLUDE_DIR} ${BOO_INCLUDE_DIR}/../lib ${BOO_INCLUDE_DIR}/../soxr/src 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) list(APPEND EXTRAS lib/BooBackend.cpp include/amuse/BooBackend.hpp)
endif() endif()

View File

@ -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 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. 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 │ ; ░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
<left/right>: cycle MIDI setup / channel, <up/down>: volume, <space>: PANIC
<tab>: sustain pedal, <window-Y>: pitch wheel, <window-X>: mod wheel
<Z/X>: octave, <C/V>: velocity, <B/N>: channel, <,/.>: program, <Q>: 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 #### Library
The Amuse API exposes full interactivity between a client application The Amuse API exposes full interactivity between a client application
@ -78,9 +112,3 @@ int main(int argc, char* argv[])
return 0; 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.

View File

@ -568,13 +568,20 @@ struct AppCallback : boo::IApplicationCallback
if (m_argc < 2) if (m_argc < 2)
Log.report(logvisor::Fatal, "needs group path argument"); 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) if (cType == amuse::ContainerRegistry::Type::Invalid)
Log.report(logvisor::Fatal, "invalid/no data at path argument"); Log.report(logvisor::Fatal, "invalid/no data at path argument");
Log.report(logvisor::Info, "Found '%s' Audio Group data", amuse::ContainerRegistry::TypeToName(cType)); Log.report(logvisor::Info, "Found '%s' Audio Group data", amuse::ContainerRegistry::TypeToName(cType));
std::vector<std::pair<std::string, amuse::IntrusiveAudioGroupData>> data = std::vector<std::pair<std::string, amuse::IntrusiveAudioGroupData>> data =
amuse::ContainerRegistry::LoadContainer(m_argv[1]); amuse::ContainerRegistry::LoadContainer(utf8Path);
if (data.empty()) if (data.empty())
Log.report(logvisor::Fatal, "invalid/no data at path argument"); Log.report(logvisor::Fatal, "invalid/no data at path argument");

View File

@ -4,9 +4,12 @@
#include <algorithm> #include <algorithm>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <strings.h>
#include <stdint.h> #include <stdint.h>
#ifndef _MSC_VER
#include <strings.h>
#endif
namespace amuse namespace amuse
{ {

View File

@ -53,7 +53,7 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(const unsigned char* data,
const AudioGroupSampleDirectory::ADPCMParms* adpcm = const AudioGroupSampleDirectory::ADPCMParms* adpcm =
reinterpret_cast<const AudioGroupSampleDirectory::ADPCMParms*>(data + reinterpret_cast<const AudioGroupSampleDirectory::ADPCMParms*>(data +
store.first.m_adpcmParmOffset); store.first.m_adpcmParmOffset);
store.second = *adpcm; store.second.dsp = adpcm->dsp;
store.second.swapBigDSP(); store.second.swapBigDSP();
} }