Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MAMI - Matrix Mixer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sdiy
MAMI - Matrix Mixer
Commits
2a589d9c
Commit
2a589d9c
authored
4 years ago
by
David Huss
Browse files
Options
Downloads
Patches
Plain Diff
Calculate for both w/ env and w/o
parent
5609986c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
calculate-parts.ipynb
+74
-11
74 additions, 11 deletions
calculate-parts.ipynb
with
74 additions
and
11 deletions
calculate-parts.ipynb
+
74
−
11
View file @
2a589d9c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"source": [
"source": [
"# Change these values to calculate the needed values\n",
"# Change these values to calculate the needed values\n",
"requirements = {\"inputs\": 8, \"outputs\":8}\n",
"requirements = {\"inputs\": 8, \"outputs\":8}\n",
"
envelopes = True
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"# Do not edit below this Point unless you know what you are doing\n",
"# Do not edit below this Point unless you know what you are doing\n",
...
@@ -61,10 +61,54 @@
...
@@ -61,10 +61,54 @@
"n_env_modules = n_output_modules\n",
"n_env_modules = n_output_modules\n",
"n_quad_modules = int((requirements[\"inputs\"] * requirements[\"outputs\"]) / (data[\"mami-output\"][\"output-channels\"] * data[\"mami-input\"][\"input-channels\"]))\n",
"n_quad_modules = int((requirements[\"inputs\"] * requirements[\"outputs\"]) / (data[\"mami-output\"][\"output-channels\"] * data[\"mami-input\"][\"input-channels\"]))\n",
"\n",
"\n",
"envelopes = False\n",
"\n",
"# Print the PCB\n",
"print(\"Needed for a {}x{} Matrix Mixer without envelopes\".format(requirements[\"inputs\"], requirements[\"outputs\"]))\n",
"print(\"{}\".format(\"=\"*50))\n",
"print(\"{0:>5}x MAMI-INPUT-Module\".format(n_input_modules))\n",
"print(\"{0:>5}x MAMI-OUTPUT-Module\".format(n_output_modules))\n",
"print(\"{0:>5}x MAMI-QUAD-Module\".format(n_quad_modules))\n",
"if envelopes:\n",
" print(\"{0:>5}x MAMI-ENV-Module\".format(n_env_modules))\n",
"print()\n",
"\n",
"# Collect all the parts\n",
"bom = {}\n",
"\n",
"def get_parts(data, n_input_modules, n_quad_modules, n_output_modules, n_env_modules):\n",
" parts = []\n",
" for part in data[\"mami-input\"][\"parts\"]*n_input_modules:\n",
" parts.append(part)\n",
" for part in data[\"mami-quad\"][\"parts\"]*n_quad_modules:\n",
" parts.append(part)\n",
" for part in data[\"mami-output\"][\"parts\"]*n_output_modules:\n",
" parts.append(part)\n",
" if envelopes:\n",
" for part in data[\"mami-env\"][\"parts\"]*n_env_modules:\n",
" parts.append(part)\n",
" return parts\n",
" \n",
"\n",
"for part in get_parts(data, n_input_modules, n_quad_modules, n_output_modules, n_env_modules):\n",
" if part[\"MPN\"] in bom:\n",
" bom[part[\"MPN\"]] += part[\"n\"]\n",
" else:\n",
" bom[part[\"MPN\"]] = part[\"n\"]\n",
"\n",
"# Print the BOM\n",
"print(\"Parts\\n{}\".format(\"=\"*50))\n",
"for key, value in bom.items():\n",
" print(\"{:>5}x {}\".format(value, key))\n",
" \n",
" \n",
"# Print second variant\n",
"print()\n",
"print(\"=\"*80)\n",
"print()\n",
"envelopes = True\n",
"\n",
"\n",
"# Print the PCB\n",
"# Print the PCB\n",
"print(\"Needed for a {}x{} Matrix Mixer\".format(requirements[\"inputs\"], requirements[\"outputs\"]))\n",
"print(\"Needed for a {}x{} Matrix Mixer
with envelopes
\".format(requirements[\"inputs\"], requirements[\"outputs\"]))\n",
"print(\"{}\".format(\"=\"*50))\n",
"print(\"{}\".format(\"=\"*50))\n",
"print(\"{0:>5}x MAMI-INPUT-Module\".format(n_input_modules))\n",
"print(\"{0:>5}x MAMI-INPUT-Module\".format(n_input_modules))\n",
"print(\"{0:>5}x MAMI-OUTPUT-Module\".format(n_output_modules))\n",
"print(\"{0:>5}x MAMI-OUTPUT-Module\".format(n_output_modules))\n",
...
@@ -106,7 +150,7 @@
...
@@ -106,7 +150,7 @@
"output_type": "stream",
"output_type": "stream",
"name": "stdout",
"name": "stdout",
"text": [
"text": [
"Needed for a 8x8 Matrix Mixer\n",
"Needed for a 8x8 Matrix Mixer
with envelopes
\n",
"==================================================\n",
"==================================================\n",
" 4x MAMI-INPUT-Module\n",
" 4x MAMI-INPUT-Module\n",
" 4x MAMI-OUTPUT-Module\n",
" 4x MAMI-OUTPUT-Module\n",
...
@@ -132,20 +176,39 @@
...
@@ -132,20 +176,39 @@
" 8x 1nF 0603\n",
" 8x 1nF 0603\n",
" 8x 1uF 5mm lead spacing (e.g. MKS2C041001F00J)\n",
" 8x 1uF 5mm lead spacing (e.g. MKS2C041001F00J)\n",
" 8x LED 3mm\n",
" 8x LED 3mm\n",
" 16x BAV199\n"
" 16x BAV199\n",
"\n",
"================================================================================\n",
"\n",
"Needed for a 8x8 Matrix Mixer without envelopes\n",
"==================================================\n",
" 4x MAMI-INPUT-Module\n",
" 4x MAMI-OUTPUT-Module\n",
" 16x MAMI-QUAD-Module\n",
"\n",
"Parts\n",
"==================================================\n",
" 16x PJ301M-12\n",
" 8x Subminiature On-Off-(On) Toggle switch\n",
" 64x P0915N-FC15BR100K\n",
" 64x Knob\n",
" 88x 100k 0805\n",
" 8x LME49720\n",
" 16x 100nF 0603 25V\n",
" 8x 100R 0805\n"
]
]
}
}
],
],
"execution_count":
7
,
"execution_count":
2
,
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"outputHidden": false,
"outputHidden": false,
"inputHidden": false,
"inputHidden": false,
"execution": {
"execution": {
"shell.execute_reply": "2020-07-
29T21:22:48.634
Z",
"shell.execute_reply": "2020-07-
30T09:44:44.456
Z",
"iopub.status.busy": "2020-07-
29T21:22:48.622
Z",
"iopub.status.busy": "2020-07-
30T09:44:44.446
Z",
"iopub.execute_input": "2020-07-
29T21:22:48.625
Z",
"iopub.execute_input": "2020-07-
30T09:44:44.448
Z",
"iopub.status.idle": "2020-07-
29T21:22:48.631
Z"
"iopub.status.idle": "2020-07-
30T09:44:44.453
Z"
}
}
}
}
},
},
...
@@ -191,7 +254,7 @@
...
@@ -191,7 +254,7 @@
},
},
"language_info": {
"language_info": {
"name": "python",
"name": "python",
"version": "3.8.
3
",
"version": "3.8.
2
",
"mimetype": "text/x-python",
"mimetype": "text/x-python",
"codemirror_mode": {
"codemirror_mode": {
"name": "ipython",
"name": "ipython",
...
@@ -207,7 +270,7 @@
...
@@ -207,7 +270,7 @@
"display_name": "Python 3"
"display_name": "Python 3"
},
},
"nteract": {
"nteract": {
"version": "0.24.
1
"
"version": "0.24.
0
"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
...
...
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
# Change these values to calculate the needed values
# Change these values to calculate the needed values
requirements
=
{
"
inputs
"
:
8
,
"
outputs
"
:
8
}
requirements
=
{
"
inputs
"
:
8
,
"
outputs
"
:
8
}
envelopes
=
True
# Do not edit below this Point unless you know what you are doing
# Do not edit below this Point unless you know what you are doing
data
=
{
data
=
{
"
mami-input
"
:
{
"
mami-input
"
:
{
"
input-channels
"
:
2
,
"
input-channels
"
:
2
,
"
parts
"
:
[
"
parts
"
:
[
{
"
MPN
"
:
"
PJ301M-12
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
PJ301M-12
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
Subminiature On-Off-(On) Toggle switch
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
Subminiature On-Off-(On) Toggle switch
"
,
"
n
"
:
2
},
]
]
},
},
"
mami-output
"
:
{
"
mami-output
"
:
{
"
output-channels
"
:
2
,
"
output-channels
"
:
2
,
"
parts
"
:
[
"
parts
"
:
[
{
"
MPN
"
:
"
LME49720
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
LME49720
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
100nF 0603 25V
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
100nF 0603 25V
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
100k 0805
"
,
"
n
"
:
6
},
{
"
MPN
"
:
"
100k 0805
"
,
"
n
"
:
6
},
{
"
MPN
"
:
"
100R 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
100R 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
PJ301M-12
"
,
"
n
"
:
2
}
{
"
MPN
"
:
"
PJ301M-12
"
,
"
n
"
:
2
}
]
]
},
},
"
mami-quad
"
:
{
"
mami-quad
"
:
{
"
input-channels
"
:
2
,
"
output-channels
"
:
2
,
"
input-channels
"
:
2
,
"
output-channels
"
:
2
,
"
parts
"
:
[
"
parts
"
:
[
{
"
MPN
"
:
"
P0915N-FC15BR100K
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
P0915N-FC15BR100K
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
Knob
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
Knob
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
100k 0805
"
,
"
n
"
:
4
}
{
"
MPN
"
:
"
100k 0805
"
,
"
n
"
:
4
}
]
]
},
},
"
mami-env
"
:
{
"
mami-env
"
:
{
"
output-channels
"
:
2
,
"
output-channels
"
:
2
,
"
parts
"
:
[
"
parts
"
:
[
{
"
MPN
"
:
"
100nF 0603 25V
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
100nF 0603 25V
"
,
"
n
"
:
4
},
{
"
MPN
"
:
"
PJ301M-12
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
PJ301M-12
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
TL074CD
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
TL074CD
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
100k 0805
"
,
"
n
"
:
8
},
{
"
MPN
"
:
"
100k 0805
"
,
"
n
"
:
8
},
{
"
MPN
"
:
"
200k 0805
"
,
"
n
"
:
6
},
{
"
MPN
"
:
"
200k 0805
"
,
"
n
"
:
6
},
{
"
MPN
"
:
"
20k 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
20k 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1k 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1k 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
470R 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
470R 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1M 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1M 0805
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1nF 0603
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1nF 0603
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1uF 5mm lead spacing (e.g. MKS2C041001F00J)
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
1uF 5mm lead spacing (e.g. MKS2C041001F00J)
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
LED 3mm
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
LED 3mm
"
,
"
n
"
:
2
},
{
"
MPN
"
:
"
BAV199
"
,
"
n
"
:
4
}
{
"
MPN
"
:
"
BAV199
"
,
"
n
"
:
4
}
]
]
}
}
}
}
# Calculate how many PCBs are needed
# Calculate how many PCBs are needed
n_input_modules
=
int
(
requirements
[
"
inputs
"
]
/
data
[
"
mami-input
"
][
"
input-channels
"
])
n_input_modules
=
int
(
requirements
[
"
inputs
"
]
/
data
[
"
mami-input
"
][
"
input-channels
"
])
n_output_modules
=
int
(
requirements
[
"
outputs
"
]
/
data
[
"
mami-output
"
][
"
output-channels
"
])
n_output_modules
=
int
(
requirements
[
"
outputs
"
]
/
data
[
"
mami-output
"
][
"
output-channels
"
])
n_env_modules
=
n_output_modules
n_env_modules
=
n_output_modules
n_quad_modules
=
int
((
requirements
[
"
inputs
"
]
*
requirements
[
"
outputs
"
])
/
(
data
[
"
mami-output
"
][
"
output-channels
"
]
*
data
[
"
mami-input
"
][
"
input-channels
"
]))
n_quad_modules
=
int
((
requirements
[
"
inputs
"
]
*
requirements
[
"
outputs
"
])
/
(
data
[
"
mami-output
"
][
"
output-channels
"
]
*
data
[
"
mami-input
"
][
"
input-channels
"
]))
envelopes
=
False
# Print the PCB
print
(
"
Needed for a {}x{} Matrix Mixer without envelopes
"
.
format
(
requirements
[
"
inputs
"
],
requirements
[
"
outputs
"
]))
print
(
"
{}
"
.
format
(
"
=
"
*
50
))
print
(
"
{0:>5}x MAMI-INPUT-Module
"
.
format
(
n_input_modules
))
print
(
"
{0:>5}x MAMI-OUTPUT-Module
"
.
format
(
n_output_modules
))
print
(
"
{0:>5}x MAMI-QUAD-Module
"
.
format
(
n_quad_modules
))
if
envelopes
:
print
(
"
{0:>5}x MAMI-ENV-Module
"
.
format
(
n_env_modules
))
print
()
# Collect all the parts
bom
=
{}
def
get_parts
(
data
,
n_input_modules
,
n_quad_modules
,
n_output_modules
,
n_env_modules
):
parts
=
[]
for
part
in
data
[
"
mami-input
"
][
"
parts
"
]
*
n_input_modules
:
parts
.
append
(
part
)
for
part
in
data
[
"
mami-quad
"
][
"
parts
"
]
*
n_quad_modules
:
parts
.
append
(
part
)
for
part
in
data
[
"
mami-output
"
][
"
parts
"
]
*
n_output_modules
:
parts
.
append
(
part
)
if
envelopes
:
for
part
in
data
[
"
mami-env
"
][
"
parts
"
]
*
n_env_modules
:
parts
.
append
(
part
)
return
parts
for
part
in
get_parts
(
data
,
n_input_modules
,
n_quad_modules
,
n_output_modules
,
n_env_modules
):
if
part
[
"
MPN
"
]
in
bom
:
bom
[
part
[
"
MPN
"
]]
+=
part
[
"
n
"
]
else
:
bom
[
part
[
"
MPN
"
]]
=
part
[
"
n
"
]
# Print the BOM
print
(
"
Parts
\n
{}
"
.
format
(
"
=
"
*
50
))
for
key
,
value
in
bom
.
items
():
print
(
"
{:>5}x {}
"
.
format
(
value
,
key
))
# Print second variant
print
()
print
(
"
=
"
*
80
)
print
()
envelopes
=
True
# Print the PCB
# Print the PCB
print
(
"
Needed for a {}x{} Matrix Mixer
"
.
format
(
requirements
[
"
inputs
"
],
requirements
[
"
outputs
"
]))
print
(
"
Needed for a {}x{} Matrix Mixer
with envelopes
"
.
format
(
requirements
[
"
inputs
"
],
requirements
[
"
outputs
"
]))
print
(
"
{}
"
.
format
(
"
=
"
*
50
))
print
(
"
{}
"
.
format
(
"
=
"
*
50
))
print
(
"
{0:>5}x MAMI-INPUT-Module
"
.
format
(
n_input_modules
))
print
(
"
{0:>5}x MAMI-INPUT-Module
"
.
format
(
n_input_modules
))
print
(
"
{0:>5}x MAMI-OUTPUT-Module
"
.
format
(
n_output_modules
))
print
(
"
{0:>5}x MAMI-OUTPUT-Module
"
.
format
(
n_output_modules
))
print
(
"
{0:>5}x MAMI-QUAD-Module
"
.
format
(
n_quad_modules
))
print
(
"
{0:>5}x MAMI-QUAD-Module
"
.
format
(
n_quad_modules
))
if
envelopes
:
if
envelopes
:
print
(
"
{0:>5}x MAMI-ENV-Module
"
.
format
(
n_env_modules
))
print
(
"
{0:>5}x MAMI-ENV-Module
"
.
format
(
n_env_modules
))
print
()
print
()
# Collect all the parts
# Collect all the parts
bom
=
{}
bom
=
{}
def
get_parts
(
data
,
n_input_modules
,
n_quad_modules
,
n_output_modules
,
n_env_modules
):
def
get_parts
(
data
,
n_input_modules
,
n_quad_modules
,
n_output_modules
,
n_env_modules
):
parts
=
[]
parts
=
[]
for
part
in
data
[
"
mami-input
"
][
"
parts
"
]
*
n_input_modules
:
for
part
in
data
[
"
mami-input
"
][
"
parts
"
]
*
n_input_modules
:
parts
.
append
(
part
)
parts
.
append
(
part
)
for
part
in
data
[
"
mami-quad
"
][
"
parts
"
]
*
n_quad_modules
:
for
part
in
data
[
"
mami-quad
"
][
"
parts
"
]
*
n_quad_modules
:
parts
.
append
(
part
)
parts
.
append
(
part
)
for
part
in
data
[
"
mami-output
"
][
"
parts
"
]
*
n_output_modules
:
for
part
in
data
[
"
mami-output
"
][
"
parts
"
]
*
n_output_modules
:
parts
.
append
(
part
)
parts
.
append
(
part
)
if
envelopes
:
if
envelopes
:
for
part
in
data
[
"
mami-env
"
][
"
parts
"
]
*
n_env_modules
:
for
part
in
data
[
"
mami-env
"
][
"
parts
"
]
*
n_env_modules
:
parts
.
append
(
part
)
parts
.
append
(
part
)
return
parts
return
parts
for
part
in
get_parts
(
data
,
n_input_modules
,
n_quad_modules
,
n_output_modules
,
n_env_modules
):
for
part
in
get_parts
(
data
,
n_input_modules
,
n_quad_modules
,
n_output_modules
,
n_env_modules
):
if
part
[
"
MPN
"
]
in
bom
:
if
part
[
"
MPN
"
]
in
bom
:
bom
[
part
[
"
MPN
"
]]
+=
part
[
"
n
"
]
bom
[
part
[
"
MPN
"
]]
+=
part
[
"
n
"
]
else
:
else
:
bom
[
part
[
"
MPN
"
]]
=
part
[
"
n
"
]
bom
[
part
[
"
MPN
"
]]
=
part
[
"
n
"
]
# Print the BOM
# Print the BOM
print
(
"
Parts
\n
{}
"
.
format
(
"
=
"
*
50
))
print
(
"
Parts
\n
{}
"
.
format
(
"
=
"
*
50
))
for
key
,
value
in
bom
.
items
():
for
key
,
value
in
bom
.
items
():
print
(
"
{:>5}x {}
"
.
format
(
value
,
key
))
print
(
"
{:>5}x {}
"
.
format
(
value
,
key
))
```
```
%% Output
%% Output
Needed for a 8x8 Matrix Mixer
Needed for a 8x8 Matrix Mixer
with envelopes
==================================================
==================================================
4x MAMI-INPUT-Module
4x MAMI-INPUT-Module
4x MAMI-OUTPUT-Module
4x MAMI-OUTPUT-Module
16x MAMI-QUAD-Module
16x MAMI-QUAD-Module
4x MAMI-ENV-Module
4x MAMI-ENV-Module
Parts
Parts
==================================================
==================================================
24x PJ301M-12
24x PJ301M-12
8x Subminiature On-Off-(On) Toggle switch
8x Subminiature On-Off-(On) Toggle switch
64x P0915N-FC15BR100K
64x P0915N-FC15BR100K
64x Knob
64x Knob
120x 100k 0805
120x 100k 0805
8x LME49720
8x LME49720
32x 100nF 0603 25V
32x 100nF 0603 25V
8x 100R 0805
8x 100R 0805
8x TL074CD
8x TL074CD
24x 200k 0805
24x 200k 0805
8x 20k 0805
8x 20k 0805
8x 1k 0805
8x 1k 0805
8x 470R 0805
8x 470R 0805
8x 1M 0805
8x 1M 0805
8x 1nF 0603
8x 1nF 0603
8x 1uF 5mm lead spacing (e.g. MKS2C041001F00J)
8x 1uF 5mm lead spacing (e.g. MKS2C041001F00J)
8x LED 3mm
8x LED 3mm
16x BAV199
16x BAV199
================================================================================
Needed for a 8x8 Matrix Mixer without envelopes
==================================================
4x MAMI-INPUT-Module
4x MAMI-OUTPUT-Module
16x MAMI-QUAD-Module
Parts
==================================================
16x PJ301M-12
8x Subminiature On-Off-(On) Toggle switch
64x P0915N-FC15BR100K
64x Knob
88x 100k 0805
8x LME49720
16x 100nF 0603 25V
8x 100R 0805
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
``
`
``
`
%%
Cell
type
:
code
id
:
tags
:
%%
Cell
type
:
code
id
:
tags
:
```
python
```
python
```
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment