This is an implementation of a group humanizer for the Sonic Pi program. The programming language is Ruby and the original paper is here: http://www.nld.ds.mpg.de/~holgerh/articles/Hennig\_2014\_PNAS.pdf
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
require 'formula' | |
class Qscintilla284 < Formula | |
homepage 'http://www.riverbankcomputing.co.uk/software/qscintilla/intro' | |
url "https://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.8.4/QScintilla-gpl-2.8.4.tar.gz" | |
sha1 "7e15c261a7c1842f3a75e4878a880ab667224494" | |
#depends_on "pyqt5" | |
def install |
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
# ratios from http://algoart.com/help/artwonk4/MicroTone/microtone.htm | |
JUST = [1, #c | |
16.0/15.0, #cs | |
9.0/8.0, #d | |
6.0/5.0, #ds | |
5.0/4.0, #e | |
4.0/3.0, #f | |
45.0/32.0, #fs | |
3.0/2.0, #g |
In OCR, everything seems to be using tesseract which is a huge, complex library with lots of dependencies.
Here's an alternative toolchain that shows potential and is much quicker to use
brew install pdfimages
brew install gocr
brew install ocrad
pdfimages path_to_pdf.pdf /tmp/out
docker pull tleyden5iwx/stroke-width-transform
# DetectText usage: DetectText imagefile resultImage darkText
# Where darkText=1 is dark text on a light background
docker run -i -t -v `pwd`:/work tleyden5iwx/stroke-width-transform DetectText /work/Projects/FlashHacks/29out.jpg /work/Projects/FlashHacks/29out-dt.jpg 1
https://registry.hub.docker.com/u/tleyden5iwx/stroke-width-transform/ From the OpenOCR project https://github.com/tleyden/open-ocr
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
# work out taxicab metric | |
def octave_transform(chord) | |
chord.map {|x| 60 + (x%12) }.sort | |
end | |
def t_matrix(chord_a, chord_b) | |
z = octave_transform(chord_a).zip(octave_transform(chord_b)) | |
z.map {|a,b| b - a } | |
end |
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
# There are lots of different ways to code this | |
# This is just one variation that uses one live_loop | |
use_synth :fm | |
use_synth_defaults release: 0.2 | |
live_loop :phase, auto_cue: false do | |
# start the second loop as if 10k notes had elapsed | |
# c = 10000 if c == 0 | |
# because the pattern is groups of 3, offsets which are |
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
# Try changing the numbers and clicking Run | |
@polyrhythm = [2,3] | |
live_loop :foo do | |
density(@polyrhythm.sort.first) { play :g; sleep 1 } | |
end | |
live_loop :bar, autocue: false do | |
sync :foo | |
density(@polyrhythm.sort.last) { play :c; sleep 1 } |