parameters: (scale)
return_statement: return shifts
docstring: Translate a list of 12 note/swaras names into pitch corrections.
docstring_summary: Translate a list of 12 note/swaras names into pitch corrections.
docstring_tokens: Translate a list of 12 note / swaras names into pitch corrections .
function: def Compute(scale):
    """Translate a list of 12 note/swaras names into pitch corrections."""
    values = [shruti_dictionary.get(x) for x in scale.split(' ')]
    equal = 2 ** (numpy.arange(12.0) / 12.0)
    shifts = (numpy.log2(values / equal) * 12 * 128).astype(int)
    silences = numpy.where(shifts > 127)
    if len(silences[0]):
      shifts[silences[0]] = 32767
    return shifts
function_tokens: def Compute ( scale ) : values = [ shruti_dictionary . get ( x ) for x in scale . split ( ' ' ) ] equal = 2 ** ( numpy . arange ( 12.0 ) / 12.0 ) shifts = ( numpy . log2 ( values / equal ) * 12 * 128 ) . astype ( int ) silences = numpy . where ( shifts > 127 ) if len ( silences [ 0 ] ) : shifts [ silences [ 0 ] ] = 32767 return shifts