if(($ACT == 'edit' || $ACT == 'preview') && $INFO['editable']){ ?> } else { ?> } ?>
With minor modifications the ngSpice-sound libsndfile/libsamplerate wrapper source can just be compiled with other Software. Here's an experiment with qUCS1).
You need to get the build-dependencies for QUCS which includes admsXml''. You can start-off by patching the debian source which is easier to accomplish as it includes those as prebuild maintainer-files: sudo apt-get build-dep qucs, apt-get source qucs and continue to patch in ./qucs-0.0.11/qucs-core
Note: the patch is just a quick hack and experiment: The one to be thrown away.
cd /tmp wget http://downloads.sourceforge.net/qucs/qucs-0.0.11.tar.gz wget http://gareus.org/_media/oss/spicesound/qucs-0.0.11-core-snd-v1.1.diff tar xzf qucs-0.0.11.tar.gz cd qucs-0.0.11/qucs-core patch -p1 < ../../qucs-0.0.11-core-snd-v1.1.diff cd .. ./autogen.sh #CXXFLAGS="-Wall -g -O3" CFLAGS="-g -O2 -Wall" ./configure '--host=i486-linux-gnu' \ '--build=i486-linux-gnu' '--prefix=/usr' '--mandir=/usr/share/man' \ 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' && make ./configure && make sudo make install
The Audio-Source is represented by a voltage source in the circuit and the Audio-Sink is implemented as transient analysis command.
Audio Source Syntax:
Vsnd:V1 _net0 gnd U="1 V" TimeOffset="0.0" Samplerate="48000" Channel="0" Oversampling="64" File="test.wav"
Vsnd is a spin-off from Vac and has similar syntax in the netlist. The parameters are:
Note:
[A-Z][a-z][0-9]_. as options. This limits the path to input/output files to the current working directory!Audio Sink:
the TR transient analysis command has been re-used. TSOUND is equivalent to TR but has a few extra options and writes an audio-file instead of XML.
.TSOUND:TR1 Type="lin" Start="100ms" Stop="200ms" Points="76802" IntegrationMethod="Trapezoidal" Order="2" InitialStep="1 ns" MinStep="1e-8" MaxIter="150" reltol="0.001" abstol="1 pA" vntol="1 uV" Temp="26.85" LTEreltol="1e-3" LTEabstol="1e-6" LTEfactor="1" Solver="CroutLU" relaxTSR="no" initialDC="yes" MaxStep="0" Oversampling="16" File="test_out2.wav"
Parameters:
out.wav) - Output-File to write wav16, wav24, wav32, aiff and aliki. =
Note: set TSOUNDs Points parameter to ((Stop-Start)*Samplerate*Oversampling)+2
# Qucs 0.0.11 .TSOUND:TR1 Type="lin" Start="100ms" Stop="200ms" Points="76802" IntegrationMethod="Trapezoidal" Order="2" InitialStep="1 ns" MinStep="1e-8" MaxIter="150" reltol="0.001" abstol="1 pA" vntol="1 uV" Temp="26.85" LTEreltol="1e-3" LTEabstol="1e-6" LTEfactor="1" Solver="CroutLU" relaxTSR="no" initialDC="yes" MaxStep="0" Oversampling="16" File="sw4.wav" #.TR:TR1 Type="lin" Start="100ms" Stop="200ms" Points="76802" IntegrationMethod="Trapezoidal" Order="2" InitialStep="1 ns" MinStep="1e-8" MaxIter="150" reltol="0.001" abstol="1 pA" vntol="1 uV" Temp="26.85" LTEreltol="1e-3" LTEabstol="1e-6" LTEfactor="1" Solver="CroutLU" relaxTSR="no" initialDC="yes" MaxStep="0" #.AC:AC1 Type="lin" Start="20Hz" Stop="20 kHz" Points="100" Noise="no" Vsnd:V1 _net0 gnd U="1 V" TimeOffset="0.0" Samplerate="48000" Channel="0" Oversampling="64" File="slin5s48k_F.wav" R:R3 _net0 _net1 R="200 Ohm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85" C:C2 gnd _net1 C="1 uF" V="" C:C1 _net1 sound C=".1 uF" V="" R:R4 gnd sound R="10 kOhm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85"
Save the stanza above as bandpass.txt copy an audio-file to slin5s48k_F.wav in the same folder. Executing qucsator -i bandpass.txt will write sw4.wav: a 3 channel audio-file corresponding to the voltages on _net0 _net1 and sound