Skip to content

Instantly share code, notes, and snippets.

View euwbah's full-sized avatar
🙃
smile and wave

euwbah euwbah

🙃
smile and wave
View GitHub Profile

Format: [chord ratio], complexity, { (individual note) => probability of being 'tonic' }

Before adding otonal/utonal scaling (otonal_utonal_imbalance: 0):

Maj triad:
└─ "[4, 5, 6]: 3.857987202449161, {(1/1)=>0.38972255498549707, (3/2)=>0.32899613084094204, (5/4)=>0.2812813141735609}"

Min triad: Using LCM/Tenney height method, this will evaluate as equally as complex as the major chord.
└─ "[10, 12, 15]: 3.8911800411184334, {(1/1)=>0.34309983966512086, (3/2)=>0.33221561834177654, (6/5)=>0.32468454199310265}"
@euwbah
euwbah / main.rs
Created July 3, 2022 19:57
rip ears
use std::{fs::File, io::BufWriter};
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use hound::WavWriter;
fn main() -> anyhow::Result<()> {
println!("Hello, world!");
let host = cpal::host_from_id(cpal::HostId::Wasapi).expect("Failed to initialize wasapi host");
def visible_mountains(heights: List[int], verbose=True):
mstack = []
answer = 0
maxnum = -1
"""What is the maximum number"""
maxcount = 0
"""How many equally maximum height mountains are there"""
idxfirstmax = -1
"""index of first occurrence of max number"""
idxlastmax = -1
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import { Flight } from '../models/flight';
import { Geocoder } from './geocoder';
/*
Generated class for the AmadeusFlightService provider.
public void takeQuiz() {
for( Question qtn : questions) {
QtnOutcome outcome = qtn.displayQuestion();
while (true) {
if(outcome == QtnOutcome.CORRECT) {
AudioClip right = new AudioClip("file:///C://Users/coolm/Documents/NetBeansProjects/Question/Music/jawsofdeath.wav");
right.play(1.0);
GUIHelper.show("CORRECT");
score += 5;
break;
package loginpageforassignment;
/**
*
* @author kenzewee
*/
import javax.swing.JOptionPane;
import static javax.swing.text.html.HTML.Tag.S;
@euwbah
euwbah / ISEC MST
Created May 30, 2016 04:24
ISEC MST
#ISEC MST(L1 - L3)
##1. Goals of ISEC:
- <b>C</b>onfidentiality
- <b>I</b>ntegrity
- <b>A</b>vailablity
Steps to defend against attacks:
1. Layering --- Having multiple layers of security mechanisms

#Java From The Top Down

[TOC]

#####Preface (tl;dr)

It begins with a common educational concept. Basics first, then move on. This concept is especially prevalent in the education systems of USA, South Korea and a majority of South East Asian countries (including Singapore). Consensus has it that this is the most logical way to transfer knowledge.

However, this methodology also presents its inhibitions. It is diminished in a fundamental area of the learning process: causation. Learning from the bottom-up will look as if, from the perspective of the educator, 'bottom-up' per se. However, for the student, the quantity of misidentified and misunderstood concepts are legion.

############
# Buffer 1 #
############
use_bpm 120
firstRun = true;
startFromMeasure = 16;
currChord = nil
@euwbah
euwbah / Random Code music
Created December 18, 2014 16:30
Testing out sonic pi for fun! Seems better than ChucK and super easy to learn! XD
# Welcome to Sonic Pi v2.1.1
define :Cm9 do |time|
play [:C4, :G4, :Bb4, :D5], sustain: time - 0.25, release: 0.25, decay: 0.1
play :G5, sustain: time - 0.25, release: 0.25, decay: 0.1 if one_in(2)
end
define :Eb9 do |time|
if one_in(2)
play [:Eb4, :Bb4, :D5, :F5], sustain: time - 0.25, release: 0.25, decay: 0.1