Skip to content

Commit

Permalink
better max patch
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed Sep 17, 2021
1 parent 6c87024 commit 83ec207
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 36 deletions.
57 changes: 26 additions & 31 deletions alles.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"appversion" : {
"major" : 8,
"minor" : 1,
"revision" : 3,
"revision" : 11,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box",
"rect" : [ 156.0, 269.0, 676.0, 540.0 ],
"rect" : [ 1075.0, 270.0, 676.0, 540.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand All @@ -37,6 +37,7 @@
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"id" : "obj-20",
Expand All @@ -45,8 +46,7 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 348.5, 315.0, 167.0, 47.0 ],
"presentation_linecount" : 2,
"text" : "w6, which means, use the karplus-strong oscillators. easy to change and play with!"
"text" : "w5, which means, use the karplus-strong oscillators. easy to change and play with!"
}

}
Expand All @@ -58,7 +58,6 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 23.0, 467.0, 265.0, 47.0 ],
"presentation_linecount" : 6,
"text" : "This patch plays a midi file to all booted synths, playing each note sequentially to the next synth in a row. Instant surround sound!"
}

Expand All @@ -71,7 +70,6 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 378.5, 273.0, 137.0, 33.0 ],
"presentation_linecount" : 2,
"text" : "cpuclock is the host time base"
}

Expand All @@ -84,7 +82,6 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 23.0, 226.0, 137.0, 74.0 ],
"presentation_linecount" : 4,
"text" : "% 6 means play each note on 6 synths in a row.. if you have less than 6 it will wrap around"
}

Expand All @@ -96,8 +93,7 @@
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 378.5, 70.0, 153.0, 33.0 ],
"presentation_linecount" : 2,
"patching_rect" : [ 378.5, 70.0, 155.0, 33.0 ],
"text" : "Replace this with whatever midi file you want to play"
}

Expand All @@ -109,8 +105,7 @@
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 198.5, 30.0, 150.0, 33.0 ],
"presentation_linecount" : 2,
"patching_rect" : [ 198.5, 30.0, 153.0, 33.0 ],
"text" : "Start 1024 plays a midi file at normal speed"
}

Expand Down Expand Up @@ -263,8 +258,8 @@
"numinlets" : 4,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 156.333333333333314, 311.0, 149.0, 22.0 ],
"text" : "sprintf c%dn%dw6a%ft%d"
"patching_rect" : [ 156.333333333333314, 311.0, 189.0, 22.0 ],
"text" : "sprintf c%dn%dw5l%ft%db0.997Z"
}

}
Expand Down Expand Up @@ -335,13 +330,27 @@
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 202.0, 114.0, 269.0, 22.0 ],
"text" : "seq /Users/bwhitman/Downloads/deb_menu.midi"
"patching_rect" : [ 198.5, 109.0, 111.0, 22.0 ],
"text" : "seq deb_menu.mid"
}

}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-10", 0 ],
"source" : [ "obj-12", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-14", 0 ],
"source" : [ "obj-13", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-23", 0 ],
"source" : [ "obj-18", 0 ]
Expand Down Expand Up @@ -437,13 +446,6 @@
"source" : [ "obj-41", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-18", 0 ],
"source" : [ "obj-44", 0 ]
}

}
, {
"patchline" : {
Expand All @@ -461,15 +463,8 @@
}
, {
"patchline" : {
"destination" : [ "obj-10", 0 ],
"source" : [ "obj-12", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-14", 0 ],
"source" : [ "obj-13", 0 ]
"destination" : [ "obj-18", 0 ],
"source" : [ "obj-44", 0 ]
}

}
Expand Down
9 changes: 4 additions & 5 deletions amy_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ def generate_alles_pcm_header(pcm_sample_rate=22050):
from sf2utils.sf2parse import Sf2File
import resampy
import numpy as np
# These are the indexes that we liked and fit into the flash on Alles ESP32. You can download the sf2 files here:
# https://github.com/vigliensoni/soundfonts/blob/master/hs_tr808/HS-TR-808-Drums.sf2
# https://ftp.osuosl.org/pub/musescore/soundfont/MuseScore_General/MuseScore_General.sf2
fns = ( ("/home/bwhitman/sf2/HS-TR-808-Drums.sf2", False), ('/home/bwhitman/sf2/MuseScore_General.sf2', True))
#good = [0, 3, 8, 11, 14, 16, 17, 18, 20, 23, 25, 26, 29, 30, 31, 32, 37, 39, 40, 42, 47, 49, 50, 52, 58, 63, 69, 74, 76, 77, 80, 82, 83, 85, 86, 95, 96, 99, 100, 101, 107, 108, 109, 112, 116, 117, 118, 120, 127, \
# 130, 134, 136, 145, 149, 155, 161, 165, 166, 170, 171, 175, 177, 178, 183, 192, 197, 198, 200, 204, 222]
good = [0, 3, 8, 11, 14, 16, 17, 18, 20, 23, 25, 26, 29, 30, 31, 32, 37, 39, 40, 42, 47, 49, 50, 52, 58, 63, 69, 74, 76, 80, 83, 85, 86, 95, 96, 99, 100, 101, 107, 108, 109, 112, 116, 117, 118, 120, 127, \
130, 134, 136, 145, 149, 155, 161, 165, 166, 170, 171, 175, 177, 178, 183, 192, 197, 198, 200, 204]
#good = [0, 3, 8, 11, 14, 16, 17, 18, 20, 23, 25, 26, 29, 30, 32, 37, 39, 40, 42, 49, 52, 58, 63, 69, 74, 76, 83, 85, 86, 95, 96, 99, 100, 101, 107, 108, 116, 117, 118, 120, 127, \
# 130, 134, 136, 145, 149, 155, 161, 165, 166, 170, 171, 177, 178, 183, 192, 197, 198, 200, 204]
p = open("main/amy/pcm.h", "w")
p.write("// Automatically generated by alles.generate_pcm_header()\n")
p.write("// Automatically generated by amy_headers.generate_pcm_header()\n")
p.write("#ifndef __PCM_H\n#define __PCM_H\n")
offsets = []
offset = 0
Expand Down
Binary file added deb_menu.mid
Binary file not shown.

0 comments on commit 83ec207

Please sign in to comment.