change an arbitrary synth setting, type-smart
764027
def setting(self, opt, val):
        """"""
        opt = opt.encode()
        if isinstance(val, basestring):
            fluid_settings_setstr(self.settings, opt, val)
        elif isinstance(val, int):
            fluid_settings_setint(self.settings, opt, val)
        elif isinstance(val, float):
            fluid_settings_setnum(self.settings, opt, val)
279719
def set(self, **kwargs):
        '''
        
        '''
        for lower_key, value in kwargs.items():
            if lower_key.lower() != lower_key:
                raise ValueError('Requires lowercase: %s' % lower_key)
            key = lower_key.upper()
            try:
                getattr(self, key)
            except (AttributeError, ConfigurationError):
                raise AttributeError('Cannot override %s' % key)
            self.overridden_settings[key] = value
563568
def _set_synthesizer(self):
        
        self.log(u"Setting synthesizer...")
        self.synthesizer = Synthesizer(rconf=self.rconf, logger=self.logger)
        self.log(u"Setting synthesizer... done")
17505
def set_entry(key, value):
    
    if type(key) != str:
        raise KeyError('key must be str')
    _config[key] = value
1268782
def SetType(self, vtype):
        '''
        
        '''
        self.val_type = vtype
        options = {
            "128th": 128,
            "64th": 64,
            "32nd": 32,
            "16th": 16,
            "eighth": 8,
            "quarter": 4,
            "half": 2,
            "whole": 1,
            "h": 8,
            "long": "\\longa",
            "breve": "\\breve"}
        if vtype in options:
            self.duration = options[self.val_type]
401066
def change_note_duration(self, at, to):
        """"""
        if valid_beat_duration(to):
            diff = 0
            for x in self.bar:
                if diff != 0:
                    x[0][0] -= diff
                if x[0] == at:
                    cur = x[0][1]
                    x[0][1] = to
                    diff = 1 / cur - 1 / to
953883
def set_default(self, default):  # type: (typing.Any) -> None
        
        if default is not None and len(default) > 1 and default[0] == '"' and default[-1] == '"':
            default = default[1:-1]
        self.defaultValue = default
98959
protected function overrideAudio() {
		/**
		 * @param string $output  Audio shortcode HTML output.
		 * @param array  $atts    Array of Audio shortcode attributes.
		 * @param string $audio   Audio file.
		 */
		add_filter(
			'wp_audio_shortcode', function ( $output, $atts, $audio ) {
				$src_attributes = array_merge( [ 'src' ], wp_get_audio_extensions() );
				foreach ( $src_attributes as $attribute ) {
					if ( ! empty( $atts[ $attribute ] ) ) {
						$src = $atts[ $attribute ];
						break;
					}
				}
				if ( empty( $src ) ) {
					$src = $audio;
				}
				$type = wp_check_filetype( $src, wp_get_mime_types() )['type'];
				$output = "<audio class='wp-audio-shortcode' controls='controls'><source type='{$type}' src='{$src}' /><a href='{$src}'>{$src}</a></audio>";
				return $output;
			}, 10, 3
		);
	}
344212
function(type, args, obj) {
            var val = Lang.merge(DEFAULT_CONFIG.STRINGS.value, args[0]);
            this.cfg.setProperty(DEFAULT_CONFIG.STRINGS.key, val, true);
        }
1019349
def set_key(self, key, modifiers: typing.List[Key]=None):
        """"""
        if modifiers is None:
            modifiers = []  # type: typing.List[Key]
        if key in self.KEY_MAP:
            key = self.KEY_MAP[key]
        self._setKeyLabel(key)
        self.key = key
        self.controlButton.setChecked(Key.CONTROL in modifiers)
        self.altButton.setChecked(Key.ALT in modifiers)
        self.shiftButton.setChecked(Key.SHIFT in modifiers)
        self.superButton.setChecked(Key.SUPER in modifiers)
        self.hyperButton.setChecked(Key.HYPER in modifiers)
        self.metaButton.setChecked(Key.META in modifiers)
        self.recording_finished.emit(True)
634840
def set_reverb(self, roomsize=-1.0, damping=-1.0, width=-1.0, level=-1.0):
        
        set=0
        if roomsize>=0:
            set+=0b0001
        if damping>=0:
            set+=0b0010
        if width>=0:
            set+=0b0100
        if level>=0:
            set+=0b1000
        return fluid_synth_set_reverb_full(self.synth, set, roomsize, damping, width, level)
954092
def set_system_conf(self, key=None, value=None, d=None):
        
        if isinstance(d, dict):
            self._system.update(d)
        elif isinstance(key, str) and isinstance(value, str):
            self._system[key] = value
        else:
            raise TypeError("key, value must be strings")
660433
function changeSample() {
    document.getElementById('play').disabled = true;
    document.getElementById('stop').disabled = true;
    soundUrl = document.getElementById("sample_no").value;
    if (typeof sound != 'undefined' && sound.isPlaying) {
        sound.stop(0);
        sound.isPlaying = false;
    }
    loader_sound = new ambisonics.HOAloader(context, maxOrder, soundUrl, assignSoundBufferOnLoad);
    loader_sound.load();
}
386779
def DEFINE_constant_string(self, name, default, help):
    """"""
    self.AddOption(
        type_info.String(name=name, default=default or "", description=help),
        constant=True)
14954
function() {
    this.jsonInit({
      "message0": Blockly.Msg.SOUND_SETEFFECTO,
      "args0": [
        {
          "type": "field_dropdown",
          "name": "EFFECT",
          "options": [
            [Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'],
            [Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN']
          ]
        },
        {
          "type": "input_value",
          "name": "VALUE"
        }
      ],
      "category": Blockly.Categories.sound,
      "extensions": ["colours_sounds", "shape_statement"]
    });
  }
623321
def _setDefaults(configObj={}):
    

    paramDict={"build":True,
              "single":True,
              "stepsize":10,
              "in_units":"cps",
              "wt_scl":1.,
              "pixfrac":1.,
              "kernel":"square",
              "fillval":999.,
              "maskval": None,
              "rot":0.,
              "scale":1.,
              "xsh":0.,
              "ysh":0.,
              "blotnx":2048,
              "blotny":2048,
              "outnx":4096,
              "outny":4096,
              "data":None,
              "driz_separate":True,
              "driz_combine":False}

    if(len(configObj) !=0):
        for key in configObj.keys():
            paramDict[key]=configObj[key]

    return paramDict
242193
def _GenConfig(self, cfg):
    """"""
    # Some setting names may have a + or - suffix. These indicate that the
    # settings modify the default values.
    merged = self.default.copy()
    for setting, vals in iteritems(cfg):
      option, operator = (setting.split(None, 1) + [None])[:2]
      vals = set(vals)
      default = set(self.default.get(option, []))
      # If there is an operator, updated values accordingly.
      if operator == "+":
        vals = default.union(vals)
      elif operator == "-":
        vals = default.difference(vals)
      merged[option] = list(vals)
    return rdf_protodict.AttributedDict(**merged)