5 ms·
Sorry if this is a stupid question (I don't know anything about LTSpice) but would it be possible to actually feed a guitar signal through this simulation and r
by j4mie 11y ago
Sorry if this is a stupid question (I don't know anything about LTSpice) but would it be possible to actually feed a guitar signal through this simulation and run it out into an amp, in real time?
- cdawzrd 11y agoNo, LTSpice simulations are not real-time. However, there have been attempts to make that happen[1]! [1] http://www.livespice.org/ http://www.livespice.org/
- earlz 11y agoHave you personally been able to get anything to actually work in livespice? I've observed that it's UI is so broken that it's practically unusable
- dsharlet 11y agoCan you say what's broken about it? Is there something that prevents you from following the tutorial to build the low pass filter? A lot of people have problems with audio IO (the ecosystem of audio devices, drivers, OSes, etc. unfortunately is a minefield) but I haven't heard many complaints about the UI.
- earlz 11y agoI'd have to open it up again and try to do something with it to remember.. I think it was like I'd drag something onto it, but then I couldn't delete it, and a few other unintuitive things.. and yea, I never could get the audio IO to actually work
- dsharlet 11y agoDelete should just be the delete key... I think there was also an item on the edit menu to delete the selection. I tried to make it behave as standard as possible (the usual windows shortcut keys for cut/copy/paste/delete/etc.). There's an annoying issue in the GUI framework I used where the right part of the UI has to be in focus for these things to work. Maybe that was the issue.
- jandrewrogers 11y agoNo, these kinds of tools are not designed for real-time signal processing. It is possible to build real-time signal processing software that accurately models physical circuit behaviors, you just need to optimize for computational throughput and latency to make it practical. For audio processing in particular, accurately simulating physical circuit designs is resurrecting a lot of classic hardware in virtual form. CPUs have enough computational power now to implement very convincing circuit emulations in real-time.
- BMarkmann 11y agoBy "convincing", what sort of delay would you be looking at on reasonably powerful hardware? Enough to fool the ear into thinking it really was real-time? As a side question, are the sorts of modeling / math that would be done in a scenario like this amenable to offloading to a GPU (if the transformations would potentially be better handled by something like http://www.bealto.com/gpu-fft.html http://www.bealto.com/gpu-fft.html, for instance)? Is that a dumb question? :-)
- klodolph 11y agoNo, that's not a dumb question. I suspect that a successful port of a circuit simulator to the GPU would yield impressive performance gains. However, it would be far, far from easy. Disclaimer: I am a developer on a commercial circuit simulator. As for delay, 10ms is fairly reasonable.
- dsharlet 11y agoUnfortunately, the math required for circuit simulation does not lend itself to parallel implementations, whether it be on a GPU or otherwise. I built LiveSPICE (linked elsewhere in the thread), so I fought a lot with this problem :) A small disclaimer on the following, I only attempted simulation of audio amp/effect pedal circuits, which are generally small. There might be ways to effectively parallelize (much) larger circuits. Another disclaimer, I worked on this 1+ years ago, so some of it is fuzzy. The basic issue is that circuit simulation is fundamentally a serial operation. The circuit state at time step n is a function of the circuit state at time step n-1. The relationship between timesteps is basically a non-linear system of equations, where the number of variables is the number of nodes in the circuit. For a typical guitar effect pedal, this might be ~50 variables. There's basically no opportunity for parallelism here. You can't parallelize across the non-linear systems, because you don't know what to solve at timestep n until you've solved for timestep n-1. Within each step, a 50 variable system of equations is probably too small to parallelize, even on the CPU. Note that the technique used here is generally Newton's method, which also is difficult to parallelize for the same reason. The bottom line is that as far as I know, circuit simulation (at least for audio) is entirely limited by single thread performance. As a side note, the fun part of LiveSPICE is that even a 50 variable non-linear system is far too big to solve at real time sample rates (48 kHz, plus oversampling to avoid aliasing artifacts). The trick is to observe that only a fraction of these variables are non-linear, most of them are related to the other variables linearly. LiveSPICE solves for these linear relationships once during initialization of the simulation, and eliminates them prior to solving the non-linear system. This turns a typical ~50 variable system into a ~5 variable non-linear system (plus a 45 linear relationships). This is a massive reduction in computation required (Newton's method involves repeatedly solving a linear system, which is O(n^3) for simple methods).
- cushychicken 11y agoNot a dumb question at all! I don't know about that, but I did find out by submitting this to reddit that you can use a WAV file as a time domain stimulus for LTSpice.
- korethr 11y agoNeat! I had hoped such might be the case, but wasn't sure -- it's been a while since I played with LT spice. I'll have to take some recordings of my guitars to use in simulations the next time the pedal hacking bug bites.
- atomheart 11y agoNot sure how much your question is focused on LTSpice, but there are tons of applications and VST plugins that can simulate amplifiers and effect pedals in real time with "good enough" (some artists use them to record their albums) quality, e.g. Amplitube, Guitar Rig, Peavey Revalver, LePou, etc.