Just upgraded from 8.x to 9.0.1 and boy! After ages of trying to debug simulation issues with the error message of “Timestep too small” that I just could not track down I’m finally able to plot the full output of a drum voice I’m working on:
I think the visual cues for what’s excluded from simulation might have helped me here but I also think something has just started working that wasn’t before. All spice models are the same as before.
Anyway, thank you so much for making KiCad better each day!
And to the question, is there an established way to output the plot of an output like this into a wave file that I could actually listen to? I’m staring at this sound wave and I deeply want to listen to it
I see that I could plot it to a csv and go that route, but figured I should ask about it?
Others here have more experience with ngSpice then I do…
The Time step too small is a “catch all” error message from ngSpice. When a simulation does not converge (for whatever reason) ngSpice attempts to decrease the time step, and it continues doing so untill it reaches some limit and gives up. So the timestep itself is never the reason. You could argue the message is misleading, or at least could be improved
I am certain ngSpice can read a wav file for simulation input, so I assume it can also output data to a wav file. To be certain, read the ngSpice manual on the sourceforge website. KiCad cooperates with ngSpice, but the ngspice project has it’s own website and documentation.
I tried toying with similar text fields to trigger those nspice special commands but seems its still not merged yet to the main ngspice version, at least not in that form:
sndparam: no such command available in ngspice
sndprint: no such command available in ngspice
So i guess next up is trying to build ngspice from that PR possibly? But I can’t even find how I use a special ngspice command from KiCad?
to get a 44.1 kHz sample rate But I realize now that timestep is just some initial step length and that the engine would zoom the timesteps in for convergence just as described for the *timestep to low" issue. I just thought the output would probably still be linear.
Gonna be more work I guess, but just interpolating linearly for the target sample rate between the actual sample points in the output would be fine…?
There is a ngspice git branch at ngspice / ngspice / Commit [276c4f] with current ngspice-44.2 enhanced by reading and writing wav files. This features the sndparam and sndprint commands.