pysynth/seq.py
def _find_synth(self, note, name=None):

        """
        Finds a synth by the given note and name.

        If a name is not specified, then we simply use the first registered name.

        If no note is found in the name,
        then a new one is created from the default synth via 'deepcopy'.

        :param note: Noe of the synth to start
        :type note: Note
        :param name: Name of the synth collection to start
        :type name: str
        :return: Synth at that position
        :rtype: BaseModule
        """

        # Resolve the name:

        name = self._resolve_name(name)

        # Get the synth at the given note

        note_val = note.revert()
        synth = None

        if note_val in self._synths[name].keys():

            # Found our synth, let's grab it!

            synth = self._synths[name][note_val]

        else:

            # Not present, let's make a copy of the default synth:

            if 'd' not in self._synths[name].keys():

                # Default synth not present!

                raise Exception("Default Synth not present!")

            # Lets make a deep copy of the default:

            synth = deepcopy(self._synths[name]['d'])

            # Lets set the oscillating frequency:

            synth.freq = note.freq_conv(middle_pitch=self.middle)

            # Lets register it to the given note:

            self._synths[name][note_val] = synth

        # Synth has been found or registered!

        return synth

        Finds a synth by the given note and name.

        If a name is not specified, then we simply use the first registered name.

        If no note is found in the name,
        then a new one is created from the default synth via 'deepcopy'.

        :param note: Noe of the synth to start
        :type note: Note
        :param name: Name of the synth collection to start
        :type name: str
        :return: Synth at that position
        :rtype: BaseModule
        
Finds a synth by the given note and name.
If a name is not specified, then we simply use the first registered name.

If no note is found in the name,
then a new one is created from the default synth via 'deepcopy'.
Finds a synth by the given note and name . If a name is not specified then we simply use the first registered name . If no note is found in the name then a new one is created from the default synth via ' deepcopy ' .
def _find_synth(self, note, name=None):
        name = self._resolve_name(name)
        note_val = note.revert()
        synth = None
        if note_val in self._synths[name].keys():
            synth = self._synths[name][note_val]
        else:
            if 'd' not in self._synths[name].keys():
                raise Exception("Default Synth not present!")
            synth = deepcopy(self._synths[name]['d'])
            synth.freq = note.freq_conv(middle_pitch=self.middle)
            self._synths[name][note_val] = synth
        return synth
def _find_synth ( self , note , name = None ) : name = self . _resolve_name ( name ) note_val = note . revert ( ) synth = None if note_val in self . _synths [ name ] . keys ( ) : synth = self . _synths [ name ] [ note_val ] else : if 'd' not in self . _synths [ name ] . keys ( ) : raise Exception ( "Default Synth not present!" ) synth = deepcopy ( self . _synths [ name ] [ 'd' ] ) synth . freq = note . freq_conv ( middle_pitch = self . middle ) self . _synths [ name ] [ note_val ] = synth return synth
Finds a synth by the given note and name.
Finds a synth by the given note and name .
"""
        Finds a synth by the given note and name.

        If a name is not specified, then we simply use the first registered name.

        If no note is found in the name,
        then a new one is created from the default synth via 'deepcopy'.

        :param note: Noe of the synth to start
        :type note: Note
        :param name: Name of the synth collection to start
        :type name: str
        :return: Synth at that position
        :rtype: BaseModule
        """ # Resolve the name: # Get the synth at the given note # Found our synth, let's grab it! # Not present, let's make a copy of the default synth: # Default synth not present! # Lets make a deep copy of the default: # Lets set the oscillating frequency: # Lets register it to the given note: # Synth has been found or registered!
Synth at that position
Synth at that position
BaseModule
self
note
Noe of the synth to start
Noe of the synth to start
name
Name of the synth collection to start
Name of the synth collection to start