Plugins-soundtable
From Bcontrol
From the help file (In Matlab, >> help Plugins/@soundtable/SoundTableSection )
% [x, y] = SoundTableSection(obj, action, [arg1], [arg2]) % This plugin makes a Sound Table window that manages any number of f1/f2 % stimulus sounds. The sounds specified in this table are sent to % SoundManagerSection as 'Soundx', where 'x' is the row where this sound % appears in the table. % % PARAMETERS: % ----------- % % obj Default object argument. % % action One of: % % 'init' Initializes the plugin. Sets up internal variables % and the GUI window. % % 'n_stimulus_cycle' if a value <1 is entered for n_stimulus_cycle, % reset it to 1. % % 'StimTimeStart' disables/enables FromAnswerPoke and % n_stimulus_cycles as appropriate % % 'display_table' formats the sounds stored in stims to be % displayed in the table % % 'sttable' when a row is clicked in the table, copy the % values in that row into the NumeditParams for the % corresonding fields. This makes it easier to modify the % sounds and then update them. % % 'side' enforces the value entered in side to be either % 'r' or 'l'. % % 'pprob' enforces the value entered in pprob to be [0 1]. % % 'set' a useful action that takes 3 extra arguments: % the sound pair to be modified, the field to be modified, % and the new value. For example, if we want to set the % f1_dur of sound pair 4 to 0.7: % SoundTableSection(obj, 'set', 4, 'f1_dur', 0.7); % % 'get' a complementary action to set that takes 1-2 % extra arguments. To get the number of sounds currently % defined or a matrix of all sides, use 'nstims' and % 'all_sides'. To get a field from a specific sound pair, % for example, the pprob of sound 2: % SoundTableSection(obj, 'get', 2, 'pprob'); % % 'add_pair' adds a new row to the table using the values % currently in the editparams. Makes the appropriate row in % stims and constructs the sound. % % 'delete_pair' deletes the row currently selected in the table. % % 'update_pair' replaces the row currently selected in the % table with the values entered in the editparams. % % 'next_trial_sound' returns the row of one pair chosen randomly % according to the pprobs. Passing an extra variable 'l' or % 'r' forces a sound for that side to be picked. % % 'make_sounds' constructs all sounds specified in stims and % sends them to SoundManagerSection. Sounds are named % 'Soundx', where x is the row this sound pair appears in the % table. If passed an additional optional parameter, then % only this particular row is rebuilt and set in SoundManagerSection. % % 'check_norm' checks that a valid set of sounds have been % specified, and if not, print a error message at the field % at the right bottom corner of the window. Criterion for % all systems go: 1) pprobs sum to 1, and 2) at least one % left and one right sound are defined. If these are both % met, go_flg is set to 1 and the message box turns green; % otherwise, go_flg is 0 and the message box turns red. % % 'get_go_flg' returns the value of go_flg. % % 'normalize' normalizes pprobs so they sum to 1. % % 'play_sound' plays the currently selected sound in the table. % % 'stop_sound' stops the currently selected sound in the table. % % 'get_n_sound_pairs' returns the number of rows in stims. This can % also be accomplished with the 'get' action. % BWB, Jan. 2008