Skip to content

Instantly share code, notes, and snippets.

View pianomanfrazier's full-sized avatar

Pianomanfrazier pianomanfrazier

View GitHub Profile
#! python3
from interval import get_interval, INTERVAL
def get_triad(bass, figure=''):
'''takes a bass note (ie a,b,c,d ...) and a figured bass string (ie '6/4', '6')'''
n1 = bass
n2 = ''
n3 = ''
if figure == '':
@pianomanfrazier
pianomanfrazier / intervals.py
Last active May 3, 2017 20:48
Help function for lilypond. get_interval will return an interval from a given note.
#! python3
CHR_SCALE_S = ('a', 'ais', 'b', 'c', 'cis', 'd', 'dis', 'e', 'f', 'fis', 'g', 'gis')
CHR_SCALE_F = ('a', 'bes', 'b', 'c', 'des', 'd', 'ees', 'e', 'f', 'ges', 'g', 'aes')
CHR_SCALES = (CHR_SCALE_S, CHR_SCALE_F)
SCALE = ('a', 'b', 'c', 'd', 'e', 'f', 'g')
INTERVAL = {'m2':1, 'M2':2, 'm3':3, 'M3':4, 'P4':5, '4+':6, '5-':6, 'P5': 7, 'm6':8, 'M6':9, 'm7':10, 'M7':11}
def get_interval(note, interval, up=True):
'''get a note at interval from given note'''
@pianomanfrazier
pianomanfrazier / setup.py
Last active June 14, 2017 17:33
Setup virtual box VM host only adapter networking. Works for Debian 3.16 64 bit.
#!/usr/bin/env python
"""This sets up a Debian VM for host-only network adapter"""
import argparse
from subprocess import call
parser = argparse.ArgumentParser(description="setup VM for host only networking")
parser.add_argument('--ip', '-ip', required=True, help='an ip address for host only adapter')
args = vars(parser.parse_args())
@pianomanfrazier
pianomanfrazier / nupic_binding_check_error.txt
Created June 22, 2017 16:41
nupic bindings check error
(testenv) rfrazier@debian64:~/nupic$ nupic-bindings-check
Traceback (most recent call last):
File "/home/rfrazier/testenv/bin/nupic-bindings-check", line 11, in <module>
load_entry_point('nupic.bindings==0.7.2', 'console_scripts', 'nupic-bindings-check')()
File "/home/rfrazier/testenv/lib/python2.7/site-packages/nupic/bindings/check.py", line 60, in checkMain
checkImportBindingsExtensions()
File "/home/rfrazier/testenv/lib/python2.7/site-packages/nupic/bindings/check.py", line 39, in checkImportBindingsExtensions
import nupic.bindings.algorithms
File "/home/rfrazier/testenv/lib/python2.7/site-packages/nupic/bindings/algorithms.py", line 119, in <module>
from nupic.proto.Cells4_capnp import Cells4Proto
@pianomanfrazier
pianomanfrazier / nupic_py_test.txt
Created June 22, 2017 16:44
This is the output the running py.test on the NuPIC repo at tip of master
(testenv) rfrazier@debian64:~/nupic$ python scripts/run_nupic_tests.py
======================================= test session starts ========================================
platform linux2 -- Python 2.7.9, pytest-3.0.7, py-1.4.34, pluggy-0.4.0 -- /home/rfrazier/testenv/bin/python
cachedir: .cache
rootdir: /home/rfrazier/nupic, inifile:
plugins: xdist-1.16.0, cov-2.5.0
collected 294 items / 47 errors
============================================== ERRORS ==============================================
___________ ERROR collecting tests/unit/nupic/algorithms/anomaly_likelihood_jeff_test.py ___________
@pianomanfrazier
pianomanfrazier / nupic_core_compile_errors.txt
Created June 26, 2017 20:54
This is the result of `python setup.py install &> nupic_core_compile_errors.txt`
Using ld.gold as LINKER.
fatal: Not a git repository (or any of the parent directories): .git
rm: cannot remove 'conftest*': No such file or directory
grep: /tmp/tmpahiavs/scripts/ThirdParty/Build/Apr1StaticLib/libtool: No such file or directory
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
mkdir include
mkdir include/arch
mkdir include/arch/unix
rm: cannot remove 'libtoolT': No such file or directory
@pianomanfrazier
pianomanfrazier / .vimrc
Last active August 29, 2017 03:46
This is my vimrc file. You will need the pathogen plugin manager as well as UltiSnips.
execute pathogen#infect()
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsSnippetDir="~/.vim/UltiSnips"
let g:UltiSnipsSnippetDirectories=["~/.vim/UltiSnips", "UltiSnips"]
@pianomanfrazier
pianomanfrazier / template.tex
Last active September 1, 2017 07:49
This is a Latex template for Tech Writing USU ENGR-3080
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage[singlespacing]{setspace}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{enumitem}
\usepackage{fix-cm}
-- This is a set of data to use with USU CS5800 Homework 1, Relational Algebra
group: HomeWork1
Supplier = {
Name:string, City:string
'Amazon', 'Seattle'
'Google', 'Ventura'
'Disney', 'Anaheim'
@pianomanfrazier
pianomanfrazier / tikz_doodle.tex
Created September 27, 2017 01:16
Some Tikz and tikz-er2 doodles for Latex
\documentclass[12pt, letterpaper]{article}
\usepackage{fontspec}
\usepackage{tikz-er2}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}[h!]
\begin{center}
\begin{tikzpicture}[node distance=2cm]
\node[entity] (emp) {Employee};