20 nov 2019 | John Harrington
-
clone this repository
-
install
pipenv
pip3 install pipenv
-
enter and set up environment
cd sndalgo
pipenv install
-
enter the environment shell
pipenv shell
-
write code!
vim fuck.py
so, this repo has not been set up to be a package that can be installed thru pip
, but
it can be emulated with this... at least NOT on windows ;)
which means this is for mac and linux (either through .profile or not) only
so what i would do is first:
-
figure out the clone path. for me its
~/projects/sndalgo
. -
add that to your
PYTHONPATH
with this command:echo "export PYTHONPATH=$PYTHONPATH:~/projects/sndalgo" >> ~/.bash_profile
-
then add the scripts folder for that clone path (
$HOME/projects/sndalgo/scripts
for me) to yourPATH
:echo "export PATH=$PATH:$HOME/projects/sndalgo/scripts" >> ~/.bash_profile
as you can see,
~
and$HOME
are equivalent here. and i didgit clone <this repo>
in my ~/projects folder to create~/projects/sndalgo
.
there are a few scripts available:
sieve
pnote
modulus
and when using them together with pipes, i recommend (because it works) to use the -s ' '
flag at the beginning, which outputs them as space-delimited integers.
try using sieve
in your terminal after closing and reopening it (so the .bash_profile
refreshes, OR by using source ~/.bash_profile
in an active terminal).
specifically, try sieve --help
first to see the shit.
Z_RANGE
is the arguments for python's range()
function separated by spaces.
SIEVE_STR
is essentially a double quoted string that contains residuals, combined with logic operators. i.e. -- "-3@2 & 4 | -3@1 & 4@2 | 3 & 4@2"
. notice the --
before, with a space, which will denote that the -
symbols in the double-quoted string are not arguments to the CLI program.
pnote
outputs a number as it's human-readable key/octave/cents form...
i.e.
pnote -s ' ' 0 1 2
will result in
C-1 C#/Db-1 D-1
or an easy one is
pnote -s ' ' 69 82
A4 A5
modulus takes, again, another space delimited string of integers and outputs them at modulus 12
(with option -m MODULUS
to change that)
modulus -s ' ' 13 14 15 16
to
1 2 3 4
or
modulus -m 7 -s ' ' 13 14 15 16
to
6 0 1 2
our xenakis sieve package. this will be extremely integrated into this system.
- xenakis sieves extend a form of set theory that is constructable
and manipulable with logical operations (i.e.
AND
,OR
). - sieves have a dual ability to operate as both CV and signal parameters, depending on how they are used.
- applications like step sequencers, theory guides, and sidechainers are all summated within a single body of knowledge.
- algorithmic composition.
- synthesis, analysis, and architecture of composition with scales, chords, progressions, order, and any other hand in building sonic phenomena.
- modular design, dimensionless, unitless.
from sndalgo.xenakis import Sieve
major_scale = Sieve('-3@2&4|-3@1&4@1|3@2&4@2|-3@0&4@3')
notes = major_scale.set(range(0,25))
ots = Sieve('1@7') & '3@1' & (7, 3, False)
print(major_scale, major_scale.simple, notes)
planning
this can convert pitches to frequencies, integers to pitches; anything that needs conversion, normalization, etc. should be found here.
- conversion between different units with frequency-domain
- analyzing, creating, and applying scales
- transforming numbers into time-domain values
planning
this should have both real-time and hard-bodied MIDI utilities.
- forming
.mid
files from inputs - reading
.mid
files and exposing an API for them - analyzing MIDI
- streaming (duplex) MIDI (hopefully) without dependencies
alright. it seems like we want to have a dynamically allocated input of values in a sequence for nearly all of our functions.
this sequence can be a sieve's resolution or translated midi, etc. etc.
there is the sample rate
, the separator
, frequency
, block size
, harmonics
...
modulus
notes
z range
sieve
output format
so we have a quick few things to relate properly, and study for compilability and interoperability.
a good aim is to create a simple eco system of files and types to be commandable with one click
command script (although with multiple features etc. etc.)
we need utilities like:
- the multiple formats for sieves should be implemented
- files AND stdin streams for pipes
- bash and python scriptable and with a common api
- reverse, shrink, expand, etc. for sequencing
- operations
- filetypes that are standardized
- more cowbell
over time, this will be a huge tool for synthesis and processing of sound. hopefully.
try some things out:
scripts/modulus -m 2 `./sieve '{3@0} & -3 | 2 | 3@2 & 5@3' -S 0 100 | tr '\n' ' ' 2>/dev/null` | tr '\n' ' ' && echo