This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you want your terminal vim to open files you double click, follow the following steps (MacOS only): | |
1. Open Automator | |
2. Select Application | |
3. Copy the attached file | |
4. Save and set as default for opening files | |
Multiple files are opened in vim tabs. | |
If there is already a vim instance running, files are opened in it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
import soundcard as sc # Get it from https://github.com/bastibe/SoundCard | |
imWidth, imHeight = 1024, 512 # screen size | |
def draw_wave(screen, mono_audio, xs, title="oscilloscope", gain=5): | |
screen *= 0 # clear the screen | |
ys = imHeight/2*(1 - np.clip( gain * mono_audio[0:len(xs)], -1, 1)) # the y-values of the waveform | |
pts = np.array(list(zip(xs,ys))).astype(np.int) # pair up xs & ys | |
cv2.polylines(screen,[pts],False,(0,255,0)) # connect points w/ lines | |
cv2.imshow(title, screen) # show what we've got |