tildebyte / ChucK-plugin-for-ST3

A Sublime Text 3 plugin for ChucK (http://chuck.cs.princeton.edu).
19 stars 2 forks source link

chuck --probe command : just the midi information #43

Closed zeffii closed 10 years ago

zeffii commented 10 years ago
import subprocess
from subprocess import PIPE

k = subprocess.Popen(["chuck", "--probe"], stdout=PIPE, stderr=PIPE)
out, err = k.communicate()

midi_info = False
for line in err.decode().split("[chuck]:"):

    # set this once, print the rest when this line is encountered
    if "via RtMidi" in line:
        midi_info = True

    if midi_info:
        print(line)

I might stick this in a menu that will appear if an in instance of MiniIn is on the line, and include it in the chuck_util_functions because it contains similar line parsing functions.

zeffii commented 10 years ago

done.