Onu
From FusionWiki
| Onu | |
|---|---|
| General Information | |
| Author: | Josh Whelchel |
| Release Date: | 2007 |
| Status: | Released |
| Last updated: | Unknown |
| Version: | 1.16 |
| Build: | ? |
| Developer-only: | No |
| Website: | Not available |
| Download: | http://www.syntesis.org/onu/ |
| Runtime Versions | |
| HWA: | Yes |
| Flash: | No |
| Java: | No |
| Java Mobile: | No |
| Vitalize!: | No |
| Unicode: | ? |
Onu is an extension for Multimedia Fusion 2 written by Josh Whelchel.
The Onu object is designed to be the central control object for a suite of audio streaming tools. The Onu suite consists of the following:
- Onu Central Object
- Onu Engineers
- Onu OGG Engineer - Plays OGG Vorbis files
- Onu MOD Engineer - Plays IT/XM/S3M/MOD and WSF formats (Replaces ModFusion!)
- Onu Visualizations
- Onu Volume - A simple volume meter visualization
- Onu Oscilloscope - A simple oscilliscope visualization
- Onu FFT Bars - A simple FFT bar visualization
Contents |
Actions
Connections
Automatic
- Connect Deck for File: Connects a deck to a file that you choose through a file selector or expression. This action will use the file extension provided by the filename to choose which engineer it will connect to. If you've renamed the file extension of the file to playback to something other than its default file extension, you should check that your custom file extension is in the list provided by the properties of the engineer, or use the "Connect Deck for File (custom extension)" action.
There are 64 decks available for use, numbered from 0 to 63. Each deck is capable of playing a stream from an Onu Engineer.
Parameters: Deck ID, Playback File
- Connect Deck for File (custom Extension): Connects a deck to a file that you choose through a file selector or expression. This action will use the file extension provided by the extension you provide. The file extension provided should not include the period before the extension.
Parameters: Deck ID, Playback File, File Extension (no .) (eg "mod")
Visualizers
- Connect Visualizer to Deck (Add Visualizer Cable P1 to Deck P2): Connects a Visualizer cable to a deck. This is an advanced feature. To connect visualizers you should use the "Connect Visualizer to Deck" provided on the visualization extension.
Parameters: Visualizer Cable (Get Visualizer Cable), Deck ID
Decks
- Connect Deck Cable to Deck (Connect Deck P1 with Engineer Cable P2): Connects an engineer cable to a deck. This action is an advanced feature intended for extension development of Onu Engineers.
Parameters: Deck ID, Deck Engineer Cable (Cable Pointer)
- Disconnect Deck (Disconnect Deck P1): Disconnects an engineer from a deck.
Parameters: Deck ID
Winamp
- Connect Winamp Deck to Plugin (Connect Winamp Deck to plugin P1): Connects the winamp deck to a winamp input plugin (in_xxx.dll, etc.). Please note that the plugins included with Winamp 5.xx (namely in_mp3.dll and others) use a Nullsoft runtime DLL that should be included with your software.
Onu handles Winamp input support by allocating a special deck (not out of the maximum 64 decks) that can only play winamp plugins. You play this deck and otherwise handle it by getting its ID from the expression "Get Winamp Deck." Due to restrictions in the winamp architecture, only one winamp plugin (and therefore file) can be played at once. This means no crossfading is available at this time for winamp decks.
Parameters: Winamp Plugin
- Disconnect Winamp Deck: Disconnects the winamp deck from the currently installed plugin.
Deck Playback
- Play Deck: Begins playback on a deck. The deck must first be connected to an engineer using "Connect Deck to a File" or other connection mechanism. If the deck is already playing, nothing happens, or if the deck is paused, the deck will be resumed. If you play a deck that is fading out, the fade out will be abruptly ended. Use the "Is Deck Playing" condition to circumvent this functionality.
Parameters: Deck ID
- Play Deck n Times: Plays a deck a given number of times. A value of -1 will cause the deck to loop infinitely. If this is connected to a module, a value of 1 causes the deck to play once, but any other value will cause it to play infinitely.
Parameters: Deck ID, Number of Times to Play (-1 for infinite)
- Stop Deck: Stops playback on a deck that has been connected and has begun playing. If the deck is paused, it will be stopped without any further playback. Executing this action twice has the functionality of abruptly ending the deck.
Parameters: Deck ID
- Pause Deck: Pauses a deck that is currently connected and playing.
Parameters: Deck ID
- Resume Deck: Resumes playback on a deck that has been connected and paused.
Parameters: Deck ID
- Stop All Decks: Stops all currently playing decks using the fadeouts they are provided to. Call this twice to abruptly end all decks.
- Seek to Position: Seeks to the supplied position in deck, provided that seek functionality is available. This also automatically flushes the output buffer (but that shouldn't affect you in any way).
Parameters: Deck ID, Time to seek to (in ms)
- Flush Output: This causes the deck's output to flush. This has the same functionality as seeking to CurrentTimeMS(). This is useful when you change something about the playback setup of a currently playing deck.
An example would be when you mute a channel in a module. The change would require waiting up to the length of the sample buffer to hear. To avoid such behavior it's often useful to flush the output buffer or lower the sample buffer length.
Parameters: Deck ID
- Set Winamp Playback File: Sets the winamp playback file to the file you specify. You MUST use this action before playing the deck.
Parameters: Winamp Playback File
With Fades
- Play Deck: Begins playback on a deck that has been connected to an Onu Engineer with a fade-in time in milliseconds that you provide. If you play a deck that is fading out, the fade out will be abruptly ended. Circumvent this functionality by using the "Is Deck Playing" condition.
Parameters: Deck ID, Fade Time in milliseconds
- Play Deck n Times: Plays a deck a given number of times, strating with an inital fadein time provided. A value of -1 will cause the deck to loop infinitely. If this is connected to a module, a value of 1 causes the deck to play once, but any other value will cause it to play infinitely.
Parameters: Deck ID, Number of Times to Play (-1 for infinite), Fade Time in milliseconds
- Stop Deck: Stops a deck with a fade-out time that you specify in milliseconds. Calling this twice will cause the deck to end abruptly.
- Pause Deck: Pauses a deck with a fade-out time in milliseconds that you provide. If the deck isn't playing or is already paused, this action is ignored.
- Resume Deck: Resumes a currently paused deck by fading it in over the given number of milliseconds.
Decks
- Set Fade In Time: Sets the fade-in on a deck for the following "Play Deck" actions. "Play Deck with Fadein" will override this value per use, unless "Play Deck with Fadein of 0ms" is used, in which this value will be used.
Parameters: Deck ID, Fade Time in milliseconds
- Set Fade Out Time: Sets the fade out time in milliseconds for the given deck. This value is used when "Stop Deck" is used, and is used if the deck reaches the a position that is equal to the (TotalTime(Deck)*Loops) - FadeTime. The "Stop Deck with Fadeout" will override this value per use.
Parameters: Deck ID, Fade Time in milliseconds
- Set Volume Sets the volume on a deck. This value ranges from 1000 for full volume to 0 for silence.
Parameters: Deck ID, Volume (Value from 0=SILENT to 1000=FULL)
- Set Pan This function pans the volume of a deck from one channel to another. This functionality is available for both mono and stereo inputs. Panning is the effect of "balancing" a sound in either the left or right speaker.
-1000 is full left panning, -500 is 50% left, 0 is centered, 500 is 50% right, and 1000 is 100% right.
Parameters: Deck ID, Pan (Value from -1000=LEFT to 1000=RIGHT (0=CENTER))
- Reserve Deck Sets the reserve flag on a deck to the value given. A reserved deck will not be caught by GetFirstFreeDeck.
Parameters: Deck ID, Reserve Flag (0 if free, 1 if reserved)
Advanced
- Set Playback Frequency: This is an advanced feature that will break most visualization functions, and is meant to be a background effect for playback or sounds.
Parameters: Deck ID, Frequency in Hz (not above 100,000hz)
- Reset Playback Frequency: This action resets the playback frequency of a deck to its original value. This will not restore visualization functionality after the deck is played unless you follow it with a "flush output" or "seek" action.
Parameters: Deck ID
- Set Buffer Length (for next Play): Changes the buffer length of a deck for the next play. (This won't affect a currently playing deck, even if you flush the buffer).
Parameters: Deck ID, Buffer Length in MS (100 <= x <= 10,000)
Other
- Display Error: Displays any error in the error queue.
Onu handles errors by using a FIFO (First in, First out) method, where each error will be pumped in the order they occured.
- Clear Error: Clears all errors from the error queue.
Conditions
- Is Deck Connected?: Determines if a deck is connected to an Onu Engineer.
- Is Winamp Deck Connected?: Determines if the Winamp deck is currently connected to a winamp plugin.
- Is Deck Playing?: Determines if a deck is playing. This includes fadeins and fadeouts of all kinds.
- Is Deck Paused?: Determines if a deck is paused. This will not determine if a deck is fading out to a pause.
- Is Deck Stopping / Fading Out?: Determines if the specified deck is fading out
- On Error: Determines if there is an error in the queue. (Note: This will repeat if you don't clear the queue, get the error, or display the error.)
Expressions
Playback
- Get Current Play Time of Deck in ms: Gets the current position of the output buffer in milliseconds. This tells you how long a deck has been playing. To find the current position of the playing file, you should use CurrentTimeMS(DeckID) mod TotalTimeMS(DeckID).
- Get Total Time of Deck in ms: Returns the total time of ONE LOOP of a deck in milliseconds.
- Get Current File Time of Deck in ms: Returns the position of the file that has been written to the buffer. This updates at the rate of the sample buffer, and will always be greater than CurrentTimeMS().
- Get Deck Volume: Returns the volume of the deck set by "Set Deck Volume."
- Get Deck Panning: Returns the panning of the deck set with "Set Panning."
Advanced
- Get Playback Frequency: Gets the custom playback frequency set with "Set Frequency." A value of -1 will be returned if a custom frequency has not been set.
- Get Original Sample Rate: Gets the original samplerate of a playback deck. You should not use this to reset the custom frequency (you should use "Reset Frequency" for that, so that visualizers are restored).
- Get Original Bitdepth: Returns the bitdepth (8 or 16) of the deck.
- Get Original Number of Channels: Gets the number of playback channels in a deck. (1 for mono, 2 for stereo).
Decks
- Get First Free Deck: Returns the ID of the first available deck that is not playing or connected. This will not get the value of a deck that is reserved.
- Get Winamp Deck ID: Gets the ID of the winamp deck, to be used as the Deck ID when any features regarding the Winamp Deck are used.
- Get Deck Fade In Time (ms): Gets the fade in time of a deck set with the "Set Fadein Time" action.
- Get Deck Fade Out Time (ms): Gets the time set by the "Set Fadeout Time" action.
- Is Deck Reserved: Determines if the deck is marked as reserved or not.
Vis. Data
- Get Waveform Data: Returns a value between -128.0 and 127.0 that represents the shape of the playing waveform at the position of the waveform index. Use this in a fast loop to draw an oscilloscope.
- Get Spectrum Data: Returns a value between 0.0 and 1.0 that represents the loudness of a sample the given spectrum index. Use this in a fast loop to draw a spectrum analyzer. The channel parameter specifies which channel to use.
- Get FFT Data: Returns a value between 0.0 and 1.0 representing the loudness of the Fast Fourier Transformed data at the FFT index.
- Get Loudest Spectrum Index: Returns the index of the loudest spectrum value, so long as that value exceeds the minimum spectrum value divided by 1000. For example, use 500 to require a minimum value of .5. This value only searches the indicies between the Spectrum Low Index and Spectrum High Index (inclusive). If these two values are equal, it will search the entire range, allowing you to use values of 0 for the last values. This expression searches both channels.
Connections
- Get Onu Cable: Returns the Onu cable address.
Other
- Get Error: Gets the next error in the error queue. This expression will remove the error from the queue.
Usage
After installing Onu, you can find examples for how to use it in the Examples\Onu folder in your main Multimedia Fusion 2 directory.
