jatalahd / tsc

TSC in the web
66 stars 7 forks source link

Documentation on how to add new tone stacks #7

Closed jwwitherspoon closed 2 months ago

jwwitherspoon commented 10 months ago

I am a web developer who also loves DIY pedals. I would love to be able to contribute new tone stacks, or at least clone the repo and use it for my own personal EQ curve simulation. Would y'all be willing to add some documentation on how to add new tone stacks? A README is all I need. If one of y'all is willing to explain the process (even in the comments on this issue), I am willing to put it in README format and open a PR.

jatalahd commented 10 months ago

I am not sure if it is worthwhile to add documentation, or a how-to, for adding new tone stacks, because it is quite hard to set the baseline what level of knowledge is to be expected. Most of the difficulties will be in circuit analysis for sure. But if I give high-level step-by-step instructions so we see if those are enough.

  1. Draw the schematic of the tone stack and use circuit analysis methods to describe the circuit with equations (examples in circuit_analysis directory).
  2. Write equations in matrix form and use Maxima script to solve the equations (examples in maxima_files directory) using Cramer's Rule. It is possible to use both nodal or current loop analysis methods, examples of both methods can be found from the maxima files. Note that the amount of multipliers (AIm, BRe, CIm, DRe ,etc) expected from the script is equal to the amount of reactive elements (caps and inductors) in the circuit, so depending what script you have copied as baseline, check the amount of those in the file.
  3. Copy some existing .htm file and modify it to contain all the required components as input elements. Set those also as variables. Make sure that the pots are set correctly to agree with the model. Then to the end of that file, copy the multipliers obtained from running the Maxima script
  4. In the .htm, modify the name of the stack and add schematic drawing. Add the stack as a link in tsc_common.js

Hopefully these will get you started.

TheseGoTo11 commented 10 months ago

I think that's a great overview of the process. Could you post a schematic of the portion of the circuit that you'd like to simulate? It might be similar to an existing one, which would give you a great head start. And if you don't want to tackle the circuit analysis, I can probably help with that.

TheseGoTo11 commented 10 months ago

Also, when you reach the stage where you're ready to use Maxima (step 2 above), it would probably be best to start with a copy of the Neve Maxima batch file. It has a lot of helpful comments and only requires the matrix to be specified once. It also seems to be a less taxing algorithm, as previously Maxima would run out of resources and fail to solve, at least with that circuit.

jwwitherspoon commented 10 months ago

Thanks y'all! Not adding this as documentation makes total sense. As far as actually committing things to the repo, I don't think I have enough know-how on the electrical engineering side to do circuit analyses like y'all are doing. However, I can try messing with the code side of things and try and add some things there. As far as that goes, I think you've given me what I need. Thanks again!

Also, the Tube Screamer tone stack might be a good one to add 👍

TheseGoTo11 commented 10 months ago

The tube screamer circuit can be thought of as an input buffer, followed by a distortion section, a tone section, and an output buffer. There is a good explanation of it over at ElectroSmash. For tone stack calculator purposes, the buffers and the distortion section need to be left out so that the tone section is modeled on its own. I can try the circuit analysis for that. It would also require adding a new type of potentiometer taper to the javascript code.

jatalahd commented 2 months ago

Closing issue as per project discontinuation.