str cellpath
// now dfined in main script
int mli1 = 450 // ON beam
int mli2 = 130 // 150 // 170 // OFF beam
// int mli3 = 235 // zero spike rate
create pulsegen /pulse
setfield ^ delay1 0.0 level1 -0.05 width1 10000 // for GABA
// setfield ^ delay1 0.0 level1 -0.07 width1 10000 // for AMPA
create RC /lowpass
setfield ^ R 1.0 C 0.5e-6
create diffamp /Vclamp
setfield ^ saturation 999.0 gain 1 // minus 0.07
addmsg /pulse /lowpass INJECT output
addmsg /lowpass /Vclamp PLUS state
create PID /PID1
create PID /PID2
// create PID /PID3
setfield /PID1 gain 1e-6 tau_i {dt} tau_d {dt/4.0} saturation 999.0 // output 1
setfield /PID2 gain 1e-6 tau_i {dt} tau_d {dt/4.0} saturation 999.0 // output 1
// setfield /PID3 gain 1e-6 tau_i {dt} tau_d {dt/4.0} saturation 999.0 // output 1
addmsg /Vclamp /PID1 CMD output
addmsg /Vclamp /PID2 CMD output
// addmsg /Vclamp /PID3 CMD output
cellpath = "/molecular_layer/Stellate[" @ {{mli_i}-1} @ "]"
addmsg /PID1 {cellpath}/soma INJECT output
addmsg {cellpath}/soma /PID1 SNS Vm
cellpath = "/molecular_layer/Stellate[" @ {{mli_j}-1} @ "]"
addmsg /PID2 {cellpath}/soma INJECT output
addmsg {cellpath}/soma /PID2 SNS Vm
// cellpath = "/molecular_layer/Stellate[" @ {{mli_k}-1} @ "]"
// addmsg /PID3 {cellpath}/soma INJECT output
// addmsg {cellpath}/soma /PID3 SNS Vm