git @ Cat's Eye Technologies Dipple / master python / display_waveform
master

Tree @master (Download .tar.gz)

display_waveform @masterraw · history · blame

#!/usr/bin/env python

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

import sys

v = 'x'
while len(v) == 1:
    v = sys.stdin.read(1)
    if len(v) == 1:
        c = int((ord(v) / 256.0) * 79.0)
        print '(%03d)%s' % (ord(v), '*' * c)