Gizmos and Parameters
getGizmoNames
cGizmos = getGizmoNames(bApiOnly)
Returns a cell array of all gizmos in the running experiment. This can be used with getParameterNames and get and set parameter methods to change parameters during runtime.
Example
Retrieve the gizmo names in current experiment.
gizmo_names = syn.getGizmoNames();
if numel(gizmo_names) < 1
error('no gizmos found')
end
% return only the gizmos that have API parameters
gizmo_names = syn.getGizmoNames(1);
gizmo_names = syn.getGizmoNames()
if len(gizmo_names) < 1:
raise Exception('no gizmos found')
# return only the gizmos that have API parameters
gizmo_names = syn.getGizmoNames(1)
getGizmoParent
sGizmoParent = getGizmoParent(sGizmoName)
Return the name of the parent processor for a particular gizmo. Useful if you have multiple processors and want to know the sampling rate a particular gizmo is running at.
Example
Get the gizmo's sampling rate by querying the parent processor.
parent = syn.getGizmoParent('aStim1');
rates = syn.getSamplingRates();
gizmoRate = rates.(parent);
parent = syn.getGizmoParent('aStim1')
rates = syn.getSamplingRates()
gizmoRate = rates[parent]
getGizmoInfo
tGizmoInfo = getGizmoInfo(sGizmoName)
Returns a struct containing the gizmo type, category, description, and icon (string of base64-encoded text representing the icon).
Example
Find a specific type of gizmo in the current experiment
% get all gizmos
gizmos = syn.getGizmoNames();
% loop over gizmos, looking for 'AudioStim' gizmo
for gizmo = 1:numel(gizmos)
info = syn.getGizmoInfo(gizmos{gizmo});
if strcmp(info.type, 'AudioStim')
disp('found AudioStim gizmo')
end
end
# get all gizmos
gizmos = syn.getGizmoNames()
# loop over gizmos, looking for 'AudioStim' gizmo
for gizmo in gizmos:
info = syn.getGizmoInfo(gizmo)
if strcmp(info.type, 'AudioStim'):
print('found AudioStim gizmo')
getParameterNames
cParameters = getParameterNames(sGizmo)
Returns a cell array of parameter names for the specified gizmo. This can be used with getGizmoNames and get/set parameter methods to change parameters at runtime.
Example
Retrieve all parameter names of all gizmos
gizmo_names = syn.getGizmoNames()
for i = 1:numel(gizmo_names)
gizmo = gizmo_names{i}
params = syn.getParameterNames(gizmo);
end
gizmo_names = syn.getGizmoNames()
for gizmo in gizmo_names:
params = syn.getParameterNames(gizmo)
getParameterInfo
tParameterInfo = getParameterInfo(sGizmo, sParameter)
Returns a structure containing parameter information.
Note
The same information is displayed in a table in the Synapse designtime interface when you click the API button on the gizmo options tab.
Example
Retrieve all parameter info for all gizmos.
% get all gizmo names
gizmo_names = syn.getGizmoNames();
% loop through the names
for i = 1:numel(gizmo_names)
gizmo = gizmo_names{i}
% get all parameters for this gizmo
params = syn.getParameterNames(gizmo)
% loop through the parameters, get their info
for i = 1:numel(params)
param = params{i};
info = syn.getParameterInfo(gizmo, param);
end
end
# get all gizmo names
gizmo_names = syn.getGizmoNames()
# loop through the names
for gizmo in gizmo_names:
# get all parameters for this gizmo
params = syn.getParameterNames(gizmo)
# loop through the parameters, get their info
for param in params:
info = syn.getParameterInfo(gizmo, param)
getParameterSize
dValue = getParameterSize(sGizmo, sParameter)
Returns the size of the specified parameter from the specified gizmo. This can be used with getGizmoNames and getParameterNames.
Example
Retrieve all parameter sizes for all gizmos.
% get all gizmo names
gizmo_names = syn.getGizmoNames();
% loop through the names
for i = 1:numel(gizmo_names)
gizmo = gizmo_names{i}
% get all parameters for this gizmo
params = syn.getParameterNames(gizmo)
% loop through the parameters, get their sizes
for i = 1:numel(params)
param = params{i};
param_size = syn.getParameterSize(gizmo);
end
end
# get all gizmo names
gizmo_names = syn.getGizmoNames()
# loop through the names
for gizmo in gizmo_names:
# get all parameters for this gizmo
params = syn.getParameterNames(gizmo)
# loop through the parameters, get their sizes
for param in params:
param_size = syn.getParameterSize(gizmo, param)
getParameterValue
dValue = getParameterValue(sGizmo, sParameter)
Returns the value of the specified parameter from the specified gizmo. This can be used with getGizmoNames and getParameterNames.
Example
Retrieve a General Purpose Filter gizmo's high pass frequency setting.
filter_highpass = syn.getParameterValue('Filt1', 'HighPassFreq')
filter_highpass = syn.getParameterValue('Filt1', 'HighPassFreq')
setParameterValue
bSuccess = setParameterValue(sGizmo, sParameter, dValue)
Returns the value of the specified parameter from the specified gizmo. This can be used with getGizmoNames and getParameterNames.
Example
Retrieve a General Purpose Filter high pass frequency, then increments it by 1.
val = syn.getParameterValue('Filt1', 'HighPassFreq')
syn.setParameterValue('Filt1', 'HighPassFreq', val + 1)
val = syn.getParameterValue('Filt1', 'HighPassFreq')
val = syn.getParameterValue('Filt1', 'HighPassFreq')
syn.setParameterValue('Filt1', 'HighPassFreq', val + 1)
val = syn.getParameterValue('Filt1', 'HighPassFreq')
getParameterValues
fValues = getParameterValues(sGizmo, sParameter, count=-1, offset=0)
Returns the values of the specified parameter array.
Example
Retrieve the map array from a Channel Mapper gizmo.
currMap = syn.getParameterValues('Map1', 'ChanMap')
currMap = syn.getParameterValues('Map1', 'ChanMap')
setParameterValues
bSuccess = setParameterValue(sGizmo, sParameter, values, offset=0)
Returns the values of the specified parameter array.
Example
Set the map array of a Channel Mapper gizmo.
currMap = syn.getParameterValues('Map1', 'ChanMap')
defaultMap = 1:numel(currMap);
syn.setParameterValues('Map1', 'ChanMap', defaultMap);
currMap = syn.getParameterValues('Map1', 'ChanMap')
defaultMap = 1:len(currMap)
syn.setParameterValues('Map1', 'ChanMap', defaultMap)