Logo Search packages:      
Sourcecode: jokosher version File versions  Download package

def EventViewer::EventViewer::getFadeCurve (   self,
  duration,
  fades,
  totalLevels 
)

The fade curve is a list of multipliers; the list is the
   length of the levels list, and to make the actual levels list,
   you take the ordinary levels list and multiply each level by
   its corresponding entry in the fadecurve.
   Pass the duration of the sample, the list of audio fade points, 
   and the number of levels

Definition at line 637 of file EventViewer.py.

00637                                                           :
            """The fade curve is a list of multipliers; the list is the
               length of the levels list, and to make the actual levels list,
               you take the ordinary levels list and multiply each level by
               its corresponding entry in the fadecurve.
               Pass the duration of the sample, the list of audio fade points, 
               and the number of levels
            """
            
            # no fades registered
            if not fades:
                  return [1.0] * totalLevels
            
            oneSecondInLevels = int(totalLevels / duration)
            # get the first volume value; the whole clip must start at that
            fadecurve = []
            currentfade = (0.0,fades[0][1])
            myfades = fades + [(duration,fades[-1][1])]
            for thisfade in myfades:
                  levelsInThisSection = int((thisfade[0] - currentfade[0]) * oneSecondInLevels)
                  if thisfade[1] == currentfade[1]:
                        # not actually a fade, just two points at the same volume
                        fadecurve += [currentfade[1]] * levelsInThisSection
                  else:
                        step = (thisfade[1] - currentfade[1]) / levelsInThisSection
                        adder = list(Utils.floatRange(currentfade[1], thisfade[1], step))
                        fadecurve += adder
                  currentfade = thisfade
            return fadecurve
            
      #_____________________________________________________________________

      def pixxFromSec(self, sec):


Generated by  Doxygen 1.6.0   Back to index