Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(1)  |  Derive(0)  |  Import(2)
Returns the the number of bytes an integer will be when
converted to varlength

        def varLen(value):
    """
    Returns the the number of bytes an integer will be when
    converted to varlength
    """
    if value <= 127:
        return 1
    elif value <= 16383:
        return 2
    elif value <= 2097151:
        return 3
    else:
        return 4
        


src/c/a/canta-HEAD/canta/midi/RawInstreamFile.py   canta(Download)
 
# custom import
from DataTypeConverters import readBew, readVar, varLen
 
 
        var = readVar(self.nextSlice(MAX_VARLEN, 0))
        # only move cursor the actual bytes in varlen
        self.moveCursor(varLen(var))
        return var
 

src/c/a/canta-HEAD/canta/midi/EventDispatcher.py   canta(Download)
 
# custom
from DataTypeConverters import readBew, readVar, varLen, toBytes
 
# uhh I don't really like this, but there are so many constants to