pysynth/seq.py
def run_commands(self):

        """
        Runs the given SeqCommand instances.

        This is where the magic happens with SeqCommands.
        We handle and invoke each track at the same time, 
        to ensure that they remain synchronized.

        We use a lookahead method for scheduling synth components.
        We lookahead a given amount of time, schedule the events
        that occur within that time, and then sleep until the next cycle.

        This is a blocking method,
        meaning that we will block until we reach the end of the SeqCommand,
        or this sequencer is stopped. 
        """

        start = get_time()

        for com in self._coms:

            # Set the offset for each SeqCommand

            com.offset = start
        
        while self.running and self._coms:

            # Get our time value:

            time_now = get_time() + self.lookahead

            # Iterate over the commands:

            for com in self._coms:

                # Have the command invoke the synths that are ready:

                if com.run(time_now):

                    # Did our work, lets continue:

                    continue

                # SeqCommand is done, lets remove it

                self._coms.remove(com)

            # Wait until next cycle:

            time.sleep(self.interval)

        # Check if we should block:

        if self.running:

            # We are done, block until the notes are done playing:

            for name in self._on:

                for note in self._on[name]:

                    # Find the synth for the on note and block:

                    self._find_synth(Note.from_num(note), name=name).join()

        Runs the given SeqCommand instances.

        This is where the magic happens with SeqCommands.
        We handle and invoke each track at the same time, 
        to ensure that they remain synchronized.

        We use a lookahead method for scheduling synth components.
        We lookahead a given amount of time, schedule the events
        that occur within that time, and then sleep until the next cycle.

        This is a blocking method,
        meaning that we will block until we reach the end of the SeqCommand,
        or this sequencer is stopped. 
        
Runs the given SeqCommand instances.
This is where the magic happens with SeqCommands.
We handle and invoke each track at the same time,
to ensure that they remain synchronized.

We use a lookahead method for scheduling synth components.
We lookahead a given amount of time, schedule the events
that occur within that time, and then sleep until the next cycle.

This is a blocking method,
meaning that we will block until we reach the end of the SeqCommand,
or this sequencer is stopped.
Runs the given SeqCommand instances . This is where the magic happens with SeqCommands . We handle and invoke each track at the same time to ensure that they remain synchronized . We use a lookahead method for scheduling synth components . We lookahead a given amount of time schedule the events that occur within that time and then sleep until the next cycle . This is a blocking method meaning that we will block until we reach the end of the SeqCommand or this sequencer is stopped .
def run_commands(self):
        start = get_time()
        for com in self._coms:
            com.offset = start
        while self.running and self._coms:
            time_now = get_time() + self.lookahead
            for com in self._coms:
                if com.run(time_now):
                    continue
                self._coms.remove(com)
            time.sleep(self.interval)
        if self.running:
            for name in self._on:
                for note in self._on[name]:
                    self._find_synth(Note.from_num(note), name=name).join()
def run_commands ( self ) : start = get_time ( ) for com in self . _coms : com . offset = start while self . running and self . _coms : time_now = get_time ( ) + self . lookahead for com in self . _coms : if com . run ( time_now ) : continue self . _coms . remove ( com ) time . sleep ( self . interval ) if self . running : for name in self . _on : for note in self . _on [ name ] : self . _find_synth ( Note . from_num ( note ) , name = name ) . join ( )
Runs the given SeqCommand instances.
Runs the given SeqCommand instances .
"""
        Runs the given SeqCommand instances.

        This is where the magic happens with SeqCommands.
        We handle and invoke each track at the same time, 
        to ensure that they remain synchronized.

        We use a lookahead method for scheduling synth components.
        We lookahead a given amount of time, schedule the events
        that occur within that time, and then sleep until the next cycle.

        This is a blocking method,
        meaning that we will block until we reach the end of the SeqCommand,
        or this sequencer is stopped. 
        """ # Set the offset for each SeqCommand # Get our time value: # Iterate over the commands: # Have the command invoke the synths that are ready: # Did our work, lets continue: # SeqCommand is done, lets remove it # Wait until next cycle: # Check if we should block: # We are done, block until the notes are done playing: # Find the synth for the on note and block:
self