amuse/index.html

123 lines
9.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Amuse: Amuse</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Amuse
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Amuse </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>Amuse</b> is a real-time MIDI and SFX sequencer, with basic effects, 3D positional audio and surround-output capabilities.</p>
<p>The project is designed for compatibility with Audio Groups and Song data found in PC/N64/GCN/GBA games using the <em>MusyX</em> audio engine; providing an alternate runtime library to use for sequencing these games' audio libraries.</p>
<h4>Library</h4>
<p>The Amuse API exposes full interactivity between a client application (game engine) and the sequencer engine. Unlike the interrupt-driven nature of the original console implementations (where the audio chip 'requests' more audio as needed), Amuse is entirely synchronous. This means the client must periodically <em>pump</em> the audio engine (typically once per video frame) to keep the OS' audio system fed.</p>
<p>The client must provide the implementation for allocating and mixing audio voices, since this may drastically differ from target to target. <code><a class="el" href="classamuse_1_1_i_backend_voice_allocator.html">amuse::IBackendVoiceAllocator</a></code> is the pure-virtual interface to implement for this. Alternatively, if <a href="https://github.com/AxioDL/boo">Boo</a> is present in the CMake project tree, Amuse will be compiled with a backend supporting multiple popular low-level audio APIs. Windows, OS X, and Linux all have excellent support this way.</p>
<p>Here's an example usage:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;amuse/amuse.hpp&gt;</span></div><div class="line"><span class="preprocessor">#include &quot;MyVoiceAllocator.hpp&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;MyAudioGroupLoader.hpp&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])</div><div class="line">{</div><div class="line"> <span class="comment">/* Up to the client to implement voice allocation and mixing */</span></div><div class="line"> std::unique_ptr&lt;amuse::IBackendVoiceAllocator&gt; voxAlloc = MakeMyVoiceAllocator();</div><div class="line"></div><div class="line"> <span class="comment">/* Application just needs one per audio output (not per channel) */</span></div><div class="line"> <a class="code" href="classamuse_1_1_engine.html">amuse::Engine</a> snd(*voxAlloc);</div><div class="line"></div><div class="line"> <span class="comment">/* An &#39;AudioGroup&#39; is an atomically-loadable unit within Amuse. </span></div><div class="line"><span class="comment"> * A client-assigned integer serves as the handle to the group once loaded</span></div><div class="line"><span class="comment"> */</span></div><div class="line"> <a class="code" href="classamuse_1_1_intrusive_audio_group_data.html">amuse::IntrusiveAudioGroupData</a> data = LoadMyAudioGroup();</div><div class="line"> snd.addAudioGroup(data);</div><div class="line"></div><div class="line"> <span class="comment">/* Starting a SoundMacro playing is accomplished like so: */</span></div><div class="line"> <span class="keywordtype">int</span> sfxId = 0x1337;</div><div class="line"> <span class="keywordtype">float</span> vol = 1.0f;</div><div class="line"> <span class="keywordtype">float</span> pan = 0.0f;</div><div class="line"> std::shared_ptr&lt;Voice&gt; voice = snd.fxStart(sfxId, vol, pan);</div><div class="line"></div><div class="line"> <span class="comment">/* Play for ~5 sec */</span></div><div class="line"> <span class="keywordtype">int</span> passedFrames = 0;</div><div class="line"> <span class="keywordflow">while</span> (passedFrames &lt; 300)</div><div class="line"> {</div><div class="line"> snd.pumpEngine();</div><div class="line"> ++passedFrames;</div><div class="line"> WaitForVSync();</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">/* Stopping a SoundMacro is accomplished by sending a</span></div><div class="line"><span class="comment"> * MIDI-style &#39;KeyOff&#39; message for the voice</span></div><div class="line"><span class="comment"> */</span></div><div class="line"> voice-&gt;keyOff();</div><div class="line"></div><div class="line"> <span class="comment">/* Play for 2 more seconds to allow the macro to gracefully fade-out */</span></div><div class="line"> passedFrames = 0;</div><div class="line"> <span class="keywordflow">while</span> (passedFrames &lt; 120)</div><div class="line"> {</div><div class="line"> snd.pumpEngine();</div><div class="line"> ++passedFrames;</div><div class="line"> WaitForVSync();</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">/* Clean up and exit */</span></div><div class="line"> <span class="keywordflow">return</span> 0;</div><div class="line">}</div></div><!-- fragment --><h4>Tool</h4>
<p>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. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Wed May 18 2016 20:05:19 for Amuse by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>