Plugins-soundui

From Bcontrol

@soundui - SoundInterface[edit]

This plugin lets you call a single command:

 [x,y]=SoundInterface(obj,'add','mysound',x,y)

This will create a GUI interface to defining a variety of sound types, and will add the sound named 'mysound' to the @soundmanager Plugin. (Note that to use @soundui, you must also use @soundmanager.) You can then play this sound, use it in your state machine definitions, etc.

You can change the parameters of the sound using the GUI. Or, if you want to use the command line, you can use SoundInterface(obj, action, soundname, ...) where action is one of 'set' or 'get', and they affect things as described below:

% 'set' soundname   'Vol'|'Bal'|'Freq1'|'Freq2'|'FMfreq'| ...
%                  'FMAmp'|'Style'|'Dur1'|'Dur2'|'Tau'|'Gap'|'Loop'   value
%        
%               The 'set' action allows setting the parameters for any of
%               the sounds that have been created. The next argument
%               after 'set' must be a string, the name of the sound
%               that was created with 'add'; the next argument must also be
%               a string, as listed above; and the last argument should be
%               the value the corresponding setting will be changed to.
%               Example calls:
%                     SoundInterface(obj, 'set', 'myvar', 'Style', 'ToneFMWiggle');
%                 or
%                     SoundInterface(obj, 'set', 'myvar', 'Dur1',   0.5);
%               For comments on what the different settings are, see action='add'
%               above.
%
% 'get' soundname   'Vol'|'Bal'|'Freq1'|'Freq2'|'FMfreq'| ...
%                  'FMAmp'|'Style'|'Dur1'|'Dur2'|'Tau'|'Gap'|'Loop' 
%
%               The 'get' action returns the setting of the parameters for any of
%               the sounds that have been created. The next argument
%               after 'get' must be a string, the name of the distribution
%               that was created with 'add'; the next argument must also be
%               a string, as listed above.
%               Example call:
%                     mysndstyle = SoundInterface(obj, 'get', 'mysnd', 'Style')
%


The 'add' action creates a number of SoloUIParams starting at position x,y. You can either try to access the SoloParamHandles directly, or go through 'set' and 'get' as described above.

SoloParamHandles created:

 mysoundStyle : menu:{'Tone', 'Bups', 'ToneFMWiggle' 'ToneSweep','BupsSweep','WhiteNoise','File'}  
 mysoundSndsMenu : menu of files in Sounds_directory. (see below).
 mysoundVol, mySoundBal
 mysoundFreq1, mysoundFreq2 
 mysoundDur1, mysoundDur2
 mysoundTau, mysoundGap
  • Elements are enabled and disabled as appropriate for their Style.
  • Checks sounds manager to see if sound has actually changed before uploading new sounds. This prevents overhead from accidental callbacks from user navigation (mouse clicks, tabs).
  • Changes to any of the elements will automatically generate the new sound and make the appropriate call to the SoundManagerSection.
  • Future development will pretty up the interface, and add new sound styles, like Chords, Clicks.
  • WARNING: Volume levels should be tested on an actual rig. Future development may change so that volume is calibrated to be the same on emulators and rigs.
  • The plugin will try to get a directory for 'File' sounds from the Settings object. Otherwise it guesses that sounds are in Solo_rootdir/../CNMC/Sounds. It looks for mat files which must contain
  1. samp_rate
  2. either mono_snd or stereo_snd

Jerlich 02:40, 31 July 2007 (EDT)