pysynth/seq.py
def add_synth(self, synth, name=None, notes=None):

        """
        Adds the given synth(Or synth collection) to the sequencer.

        You can specify the notes to add, which should be in a list in 'notes'.
        If no notes are specified, then this synth will be made the default synth for this name.
        If the sequencer attempts to start a note that is not configured,
        then a copy of the default synth will be made, started, and registered to that note.

        For speed reasons, it is recommended to either register all notes individually,
        or run 'pre-load' after specifying a certain note range.
        If you don't do these operations, then the first time a note is played, a copy will have to be made
        of the default synth, which can cause latency and slowdowns.

        If notes are specified, then the synth will be registered to each name with those notes.

        Synths are organized by names, which can really be anything.
        Each name has a sub-section where it is registered to notes.
        You can treat these names as different kinds of instruments.
        Any wrappers(Such as MIDI or MML) will auto-configure these names for you.

        :param synth: Synth instance to add
        :type: iter
        :param name: name of the synth to add
        :type name: str, int
        :param notes: Musical notes to register the synth under
        :type notes: None, list
        """

        if name is None:

            # Lets set the default name:

            name = self.default_name

        # Determine if the name is in our collection:

        if name not in self._synths:

            # Add the name to the collection:

            self._synths[name] = {}
            self._on[name] = []

        if notes is not None:

            # We must register the synths under specified notes

            for note in notes:

                # Add the synth as the note:

                temp_synth = deepcopy(synth)

                # Set the oscillating frequency:

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

                self._synths[name][note.revert()] = temp_synth

        else:

            # just make the synth the default for that name:

            self._synths[name]['d'] = synth

        Adds the given synth(Or synth collection) to the sequencer.

        You can specify the notes to add, which should be in a list in 'notes'.
        If no notes are specified, then this synth will be made the default synth for this name.
        If the sequencer attempts to start a note that is not configured,
        then a copy of the default synth will be made, started, and registered to that note.

        For speed reasons, it is recommended to either register all notes individually,
        or run 'pre-load' after specifying a certain note range.
        If you don't do these operations, then the first time a note is played, a copy will have to be made
        of the default synth, which can cause latency and slowdowns.

        If notes are specified, then the synth will be registered to each name with those notes.

        Synths are organized by names, which can really be anything.
        Each name has a sub-section where it is registered to notes.
        You can treat these names as different kinds of instruments.
        Any wrappers(Such as MIDI or MML) will auto-configure these names for you.

        :param synth: Synth instance to add
        :type: iter
        :param name: name of the synth to add
        :type name: str, int
        :param notes: Musical notes to register the synth under
        :type notes: None, list
        
Adds the given synth(Or synth collection) to the sequencer.
You can specify the notes to add, which should be in a list in 'notes'.
If no notes are specified, then this synth will be made the default synth for this name.
If the sequencer attempts to start a note that is not configured,
then a copy of the default synth will be made, started, and registered to that note.

For speed reasons, it is recommended to either register all notes individually,
or run 'pre-load' after specifying a certain note range.
If you don't do these operations, then the first time a note is played, a copy will have to be made
of the default synth, which can cause latency and slowdowns.

If notes are specified, then the synth will be registered to each name with those notes.

Synths are organized by names, which can really be anything.
Each name has a sub-section where it is registered to notes.
You can treat these names as different kinds of instruments.
Any wrappers(Such as MIDI or MML) will auto-configure these names for you.


Adds the given synth ( Or synth collection ) to the sequencer . You can specify the notes to add which should be in a list in ' notes ' . If no notes are specified then this synth will be made the default synth for this name . If the sequencer attempts to start a note that is not configured then a copy of the default synth will be made started and registered to that note . For speed reasons it is recommended to either register all notes individually or run ' pre - load ' after specifying a certain note range . If you don ' t do these operations then the first time a note is played a copy will have to be made of the default synth which can cause latency and slowdowns . If notes are specified then the synth will be registered to each name with those notes . Synths are organized by names which can really be anything . Each name has a sub - section where it is registered to notes . You can treat these names as different kinds of instruments . Any wrappers ( Such as MIDI or MML ) will auto - configure these names for you .
def add_synth(self, synth, name=None, notes=None):
        if name is None:
            name = self.default_name
        if name not in self._synths:
            self._synths[name] = {}
            self._on[name] = []
        if notes is not None:
            for note in notes:
                temp_synth = deepcopy(synth)
                temp_synth.freq = note.freq_conv(middle_pitch=self.middle)
                self._synths[name][note.revert()] = temp_synth
        else:
            self._synths[name]['d'] = synth
def add_synth ( self , synth , name = None , notes = None ) : if name is None : name = self . default_name if name not in self . _synths : self . _synths [ name ] = { } self . _on [ name ] = [ ] if notes is not None : for note in notes : temp_synth = deepcopy ( synth ) temp_synth . freq = note . freq_conv ( middle_pitch = self . middle ) self . _synths [ name ] [ note . revert ( ) ] = temp_synth else : self . _synths [ name ] [ 'd' ] = synth
Adds the given synth(Or synth collection) to the sequencer.
Adds the given synth ( Or synth collection ) to the sequencer .
"""
        Adds the given synth(Or synth collection) to the sequencer.

        You can specify the notes to add, which should be in a list in 'notes'.
        If no notes are specified, then this synth will be made the default synth for this name.
        If the sequencer attempts to start a note that is not configured,
        then a copy of the default synth will be made, started, and registered to that note.

        For speed reasons, it is recommended to either register all notes individually,
        or run 'pre-load' after specifying a certain note range.
        If you don't do these operations, then the first time a note is played, a copy will have to be made
        of the default synth, which can cause latency and slowdowns.

        If notes are specified, then the synth will be registered to each name with those notes.

        Synths are organized by names, which can really be anything.
        Each name has a sub-section where it is registered to notes.
        You can treat these names as different kinds of instruments.
        Any wrappers(Such as MIDI or MML) will auto-configure these names for you.

        :param synth: Synth instance to add
        :type: iter
        :param name: name of the synth to add
        :type name: str, int
        :param notes: Musical notes to register the synth under
        :type notes: None, list
        """ # Lets set the default name: # Determine if the name is in our collection: # Add the name to the collection: # We must register the synths under specified notes # Add the synth as the note: # Set the oscillating frequency: # just make the synth the default for that name:
self
synth
name
notes