seqfil = 'ahXX'

//------------------------------
// axAssgn and bioref
//------------------------------

exists('axAssgn','parameter'):$e
if $e < 0.5 then
   create('axAssgn','flag')
endif 
setvalue('axAssgn','11')

exists('bioref','parameter'):$e
if $e < 0.5 then
   create('bioref','flag')
endif
setvalue('bioref','y') 

exists('BPautonoisecheck','parameter'):$e
if $e < 0.5 then
   create('BPautonoisecheck','real')
   BPautonoisecheck = 0.0
endif 

exists('BPclassic','parameter'):$e
if $e < 0.5 then
   create('BPclassic','string')
   BPclassic='n'
endif 

//-----------------------------
// ND Referencing Parameters
//-----------------------------

exists('refsource1','parameter'):$e
if $e < 0.5 then
   create('refsource1','flag')
   refsource1='sfrq' 
endif

exists('axis','parameter'):$e
if $e < 0.5 then
   create('axis','flag')
   axis='pp' 
endif

//------------------------------
// Spin Rate
//------------------------------

exists('srate','parameter'):$e
if $e < 0.5 then
   create('srate','frequency')
   srate = 5000
endif 

exists('hsrotor','parameter'):$e
if $e < 0.5 then
   create('hsrotor','flag') 
   setvalue('hsrotor','y')
endif

//------------------------------
// Receiver Delays
//------------------------------

exists('rd','parameter'):$e
if $e < 0.5 then
   create('rd','pulse')
   setlimit('rd',8192,0,0.0125)
   rd = 4.0  
endif 

exists('ad','parameter'):$e
if $e < 0.5 then
   create('ad','pulse')
   setlimit('ad',8192,0,0.0125)
   ad = 4.0 
endif

exists('ddrtc','parameter'):$e
if $e < 0.5 then
   create('ddrtc','pulse')
   setlimit('ddrtc',8192,0,0.0125)
   ddrtc = 8.0  
endif

exists('roff','parameter'):$e
if $e < 0.5 then
   create('roff','frequency')
   roff = 0.0
endif

//==================
// 2D acq parameters
//==================

exists('ni','parameter'):$e
if ($e < 0.5) then
   create('ni','integer')
   setlimit('ni',32767,0,1)
   ni = 1
endif

exists('sw1','parameter'):$e
if ($e < 0.5) then
   create('sw1','real')
   setlimit('sw1',5.0e6,1.0,parstep[5])
   sw1 = 50000.0
endif

exists('phase','parameter'):$e
if ($e < 0.5) then
   create('phase','integer')
   phase = 1,2
endif

exists('d2','parameter'):$e
if ($e < 0.5) then 
   create('d2','delay')
   parunits('set','d2','us')
   d2 = 0.0
endif

exists('d2acqret','parameter'):$e
if ($e < 0.5) then 
   create('d2acqret','delay')
   parunits('set','d2acqret','us')
   d2acqret = 0.0
endif

exists('d2dwret','parameter'):$e
if ($e < 0.5) then 
   create('d2dwret','delay')
   parunits('set','d2dwret','us')
   d2dwret = 0.0
endif

//------------------------------
// Basic Transmitter Properties
//------------------------------

exists('aX90','parameter'):$e
if $e < 0.5 then
   create('aX90','real')
   setlimit('aX90',4095,0,0)
   aX90 = 2000.0  
endif 

exists('aH90','parameter'):$e
if $e < 0.5 then
   create('aH90','real')
   setlimit('aH90',4095,0,0)
   aH90 = 2000.0 
endif 

exists('aY90','parameter'):$e
if $e < 0.5 then
   create('aY90','real')
   setlimit('aY90',4095,0,0)
   aY90 = 2000.0  
endif

exists('aZ90','parameter'):$e
if $e < 0.5 then
   create('aZ90','real')
   setlimit('aZ90',4095,0,0)
   aZ90 = 2000.0  
endif

exists('pwX90','parameter'):$e
if $e < 0.5 then
   create('pwX90','pulse')
   setlimit('pwX90',8192,0,0.0125)
   pwX90 = 4.0
endif 

exists('pwH90','parameter'):$e
if $e < 0.5 then
   create('pwH90','pulse')
   setlimit('pwH90',8192,0,0.0125)
   pwH90 = 4.0
endif 

exists('pwY90','parameter'):$e
if $e < 0.5 then
   create('pwY90','pulse')
   setlimit('pwY90',8192,0,0.0125)
   pwY90 = 4.0
endif

exists('pwZ90','parameter'):$e
if $e < 0.5 then
   create('pwZ90','pulse')
   setlimit('pwZ90',8192,0,0.0125)
   pwZ90 = 4.0
endif

//---------------
// cpHX elements
//---------------

exists('shHX','parameter'):$e
if $e < 0.5 then
    create('shHX','flag')
    setvalue('shHX','c') 
endif

exists('toHX','parameter'):$e
if $e < 0.5 then
   create('toHX','flag')
endif 
setvalue('toHX','obs')

exists('frHX','parameter'):$e
if $e < 0.5 then
   create('frHX','flag')
endif
setvalue('frHX','dec')  

exists('chHX','parameter'):$e
if $e < 0.5 then
   create('chHX','flag')
   setvalue('chHX','fr')  
endif 

exists('aHhx','parameter'):$e
if $e < 0.5 then
   create('aHhx','real')
   setlimit('aHhx',4095,0,0)
   aHhx = 2000.0
endif 

exists('aXhx','parameter'):$e
if $e < 0.5 then
   create('aXhx','real')
   setlimit('aXhx',4095,0,0)
   aXhx = 2000.0
endif 

exists('bHX','parameter'):$e
if $e < 0.5 then
   create('bHX','real')
   setlimit('bHX',1000000,1.0e-6,0.0)
   bHX = 1.0e-6
endif 

exists('dHX','parameter'):$e
if $e < 0.5 then
   create('dHX','real')
   setlimit('dHX',4095,-4095,0)
   dHX = 0.0
endif 

exists('tHX','parameter'):$e
if $e < 0.5 then
   create('tHX','pulse')
   setlimit('tHX',500000,0,0.0125)
   tHX = 1000.0
endif

exists('ofHX','parameter'):$e
if $e < 0.5 then
   create('ofHX','frequency')
   ofHX = 0.0
endif  

//=====================
// decoupling options
//======================

exists('Hseq','parameter'):$e
if $e < 0.5 then
    create('Hseq','flag')
    setvalue('Hseq','spinal')
endif

//-----------
// tppm
//-----------

exists('aHtppm','parameter'):$e
if $e < 0.5 then
   create('aHtppm','real')
   setlimit('aHtppm',4095,0,0)
   aHtppm = 2000.0
endif

exists('pwHtppm','parameter'):$e
if $e < 0.5 then
   create('pwHtppm','pulse')
   setlimit('pwHtppm',8192,0,0.0125)
   pwHtppm = 8.0
endif

exists('phHtppm','parameter'):$e
if $e < 0.5 then
   create('phHtppm','real')
   setlimit('phHtppm',180.0,-180.0,0.0)
   phHtppm = 10.0
endif

exists('chHtppm','parameter'):$e
if $e < 0.5 then
   create('chHtppm','flag')
endif 
setvalue('chHtppm','dec')

//------------------------------
//  spinal 
//------------------------------

exists('aHspinal','parameter'):$e
if $e < 0.5 then
   create('aHspinal','real')
   setlimit('aHspinal',4095,0,0)
   aHspinal = 2000.0
endif

exists('pwHspinal','parameter'):$e
if $e < 0.5 then
   create('pwHspinal','pulse')
   setlimit('pwHspinal',8192,0,0.0125)
   pwHspinal=2000.0
endif

exists('phHspinal','parameter'):$e
if $e < 0.5 then
   create('phHspinal','real')
   setlimit('phHspinal',180.0,-180.0,0.0)
   phHspinal = 10.0
endif

exists('alpHspinal','parameter'):$e
if $e < 0.5 then
   create('alpHspinal','real')
   setlimit('alpHspinal',180.0,-180.0,0.0)
   alpHspinal = 5.0
endif

exists('chHspinal','parameter'):$e
if $e < 0.5 then
   create('chHspinal','flag')
endif 
setvalue('chHspinal','dec')

//========================================
// SPINAL, TPPM or WALTZ for Y decoupling
//========================================

exists('ddec2','parameter'):$e
if $e < 0.5 then
   create('ddec2','flag')
   setvalue('ddec2','n')
endif

exists('Yseq','parameter'):$e
if $e < 0.5 then
   create('Yseq','flag')
   setvalue('Yseq','waltz')
endif

//-----------
// dec2 tppm
//-----------

exists('aYtppm','parameter'):$e
if $e < 0.5 then
   create('aYtppm','real')
   setlimit('aYtppm',4095,0,0)
   aYtppm = 2000.0
endif

exists('pwYtppm','parameter'):$e
if $e < 0.5 then
   create('pwYtppm','pulse')
   setlimit('pwYtppm',10000,0,0.0125)
   pwYtppm = 8.0
endif

exists('phYtppm','parameter'):$e
if $e < 0.5 then
   create('phYtppm','real')
   setlimit('phYtppm',180.0,-180.0,0.0)
   phYtppm = 10.0
endif

exists('chYtppm','parameter'):$e
if $e < 0.5 then
   create('chYtppm','flag')
endif 
setvalue('chYtppm','dec2')

//------------------------------
//  dec2 spinal 
//------------------------------

exists('aYspinal','parameter'):$e
if $e < 0.5 then
   create('aYspinal','real')
   setlimit('aYspinal',4095,0,0)
   aYspinal = 2000.0
endif

exists('pwYspinal','parameter'):$e
if $e < 0.5 then
   create('pwYspinal','pulse')
   setlimit('pwYspinal',10000,0,0.0125)
   pwYspinal = 2000.0 
endif

exists('phYspinal','parameter'):$e
if $e < 0.5 then
   create('phYspinal','real')
   setlimit('phYspinal',180.0,-180.0,0.0)
   phYspinal = 10.0
endif

exists('chYspinal','parameter'):$e
if $e < 0.5 then
   create('chYspinal','flag')
endif 
setvalue('chYspinal','dec2')

exists('alpYspinal','parameter'):$e
if $e < 0.5 then
   create('alpYspinal','real')
   setlimit('alpYspinal',180.0,-180.0,0.0)
   alpYspinal = 5.0
endif

//------------------------------
//  dec2 waltz 
//------------------------------

exists('aYwaltz','parameter'):$e
if $e < 0.5 then
   create('aYwaltz','real')
   setlimit('aYwaltz',4095,0,0)
   aYwaltz = 2000.0
endif

exists('pwYwaltz','parameter'):$e
if $e < 0.5 then
   create('pwYwaltz','pulse')
   setlimit('pwYwaltz',10000,0,0.0125)
   pwYwaltz = 4.0
endif

exists('chYwaltz','parameter'):$e
if $e < 0.5 then
   create('chYwaltz','flag')
endif 
setvalue('chYwaltz','dec2')

//---------------
//  Mix Period X 
//---------------

exists('aHmix','parameter'):$e
if $e < 0.5 then
   create('aHmix','real')
   setlimit('aHmix',4095,0,0)
   aHmix = 2000.0
endif 

exists('tXmix','parameter'):$e
if $e < 0.5 then
   create('tXmix','pulse')
   setlimit('tXmix',500000,0.0,0.0125)
   tXmix = 200.0
endif

//==============================
// Choose a Mixing Sequence 
//==============================

exists('mMix','parameter'):$e
if $e < 0.5 then
   create('mMix','flag')
   setvalue('mMix','darr')
endif

//=============================
// Z-filter
//=============================

exists('tZF','parameter'):$e
if $e < 0.5 then
   create('tZF','pulse')
   setlimit('tZF',8192,0,0.0125)
   tZF = 200.0
endif 

exists('aHZF','parameter'):$e
if $e < 0.5 then
   create('aHZF','real')
   setlimit('aHZF',4095,0,0)
   aHZF = 2000.0
endif 

//==================
// SPC5 ELEMENTS
//==================

exists('qXspc5','parameter'):$e
if $e < 0.5 then
   create('qXspc5','real')
   setlimit('qXspc5',500,0,1)
   qXspc5 = 5.0
endif 

exists('chXspc5','parameter'):$e
if $e < 0.5 then
   create('chXspc5','flag')
endif 
setvalue('chXspc5','obs')

exists('ofXspc5','parameter'):$e
if $e < 0.5 then
   create('ofXspc5','frequency')
   ofXspc5 = 0.0
endif 

exists('aXspc5','parameter'):$e
if $e < 0.5 then
   create('aXspc5','real')
   setlimit('aXspc5',4095,0,0)
   aXspc5 = 2000.0
endif 

exists('pwXspc5','parameter'):$e
if $e < 0.5 then
   create('pwXspc5','pulse')
   setlimit('pwXspc5',8192,0,0.0125)
   pwXspc5 = 16.0
endif 

exists('tXspc5ret','parameter'):$e
if $e < 0.5 then
   create('tXspc5ret','pulse')
   setlimit('tXspc5ret',500000.0,0,0.0125)
   tXspc5ret = 0.0
endif 

exists('dqfXspc5','parameter'):$e
if $e < 0.5 then
   create('dqfXspc5','flag')
   setvalue('dqfXspc5','n')
endif 

//=============================
// CW 1H decoupling during SPC5
//=============================

exists('aHmixspc5','parameter'):$e
if $e < 0.5 then
   create('aHmixspc5','real')
   setlimit('aHmixspc5',4095,0,0)
   aHmixspc5 = 2000.0
endif 

//==================
// C6 ELEMENTS
//==================

exists('qXc6','parameter'):$e
if $e < 0.5 then
   create('qXc6','real')
   setlimit('qXc6',500,0,1)
   qXc6 = 6.0
endif 

exists('chXc6','parameter'):$e
if $e < 0.5 then
   create('chXc6','flag')
endif 
setvalue('chXc6','obs')

exists('ofXc6','parameter'):$e
if $e < 0.5 then
   create('ofXc6','frequency')
   ofXc6 = 0.0
endif 

exists('aXc6','parameter'):$e
if $e < 0.5 then
   create('aXc6','real')
   setlimit('aXc6',4095,0,0)
   aXc6 = 2000.0
endif 

exists('pwXc6','parameter'):$e
if $e < 0.5 then
   create('pwXc6','pulse')
   setlimit('pwXc6',8192,0,0.0125)
   pwXc6 = 16.0
endif

exists('tXc6ret','parameter'):$e
if $e < 0.5 then
   create('tXc6ret','pulse')
   setlimit('tXc6ret',500000.0,0,0.0125)
   tXc6ret = 0.0
endif 

exists('dqfXc6','parameter'):$e
if $e < 0.5 then
   create('dqfXc6','flag')
   setvalue('dqfXc6','n')
endif 

//=============================
// CW 1H decoupling during C6
//=============================

exists('aHmixc6','parameter'):$e
if $e < 0.5 then
   create('aHmixc6','real')
   setlimit('aHmixc6',4095,0,0)
   aHmixc6 = 2000.0
endif

//==================
// C7 ELEMENTS
//==================

exists('qXc7','parameter'):$e
if $e < 0.5 then
   create('qXc7','real')
   setlimit('qXc7',500,0,1)
   qXc7 = 7.0
endif 

exists('chXc7','parameter'):$e
if $e < 0.5 then
   create('chXc7','flag')
endif 
setvalue('chXc7','obs')

exists('ofXc7','parameter'):$e
if $e < 0.5 then
   create('ofXc7','frequency')
   ofXc7 = 0.0
endif 

exists('aXc7','parameter'):$e
if $e < 0.5 then
   create('aXc7','real')
   setlimit('aXc7',4095,0,0)
   aXc7 = 2000.0
endif 

exists('pwXc7','parameter'):$e
if $e < 0.5 then
   create('pwXc7','pulse')
   setlimit('pwXc7',8192,0,0.0125)
   pwXc7 = 16.0
endif 

exists('tXc7ret','parameter'):$e
if $e < 0.5 then
   create('tXc7ret','pulse')
   setlimit('tXc7ret',500000.0,0,0.0125)
   tXc7ret = 0.0
endif 

exists('dqfXc7','parameter'):$e
if $e < 0.5 then
   create('dqfXc7','flag')
   setvalue('dqfXc7','n')
endif 

//=============================
// CW 1H decoupling during C7
//=============================

exists('aHmixc7','parameter'):$e
if $e < 0.5 then
   create('aHmixc7','real')
   setlimit('aHmixc7',4095,0,1)
   aHmixc7 = 2000.0
endif 

//==================
// PARIS ELEMENTS
//==================

exists('chHmparis','parameter'):$e
if $e < 0.5 then
   create('chHmparis','flag')
endif 
setvalue('chHmparis','dec')

exists('ofHmparis','parameter'):$e
if $e < 0.5 then
   create('ofHmparis','frequency')
   ofHmparis = 0.0
endif 

exists('aHmparis','parameter'):$e
if $e < 0.5 then
   create('aHmparis','real')
   setlimit('aHmparis',4095,0,0)
   aHmparis = 2000.0
endif 

exists('pwHmparis','parameter'):$e
if $e < 0.5 then
   create('pwHmparis','pulse')
   setlimit('pwHmparis',8192,0,0.0125)
   pwHmparis = 8.0
endif 

//==================
// rfdr ELEMENTS
//==================

exists('chXrfdr','parameter'):$e
if $e < 0.5 then
   create('chXrfdr','flag')
endif 
setvalue('chXrfdr','obs')

exists('ofXrfdr','parameter'):$e
if $e < 0.5 then
   create('ofXrfdr','frequency')
   ofXrfdr = 0.0
endif 

exists('qXrfdr','parameter'):$e
if $e < 0.5 then
   create('qXrfdr','real')
   setlimit('qXrfdr',256,0,1)
   qXrfdr = 1
endif 

exists('aXrfdr','parameter'):$e
if $e < 0.5 then
   create('aXrfdr','real')
   setlimit('aXrfdr',4095,0,0)
   aXrfdr = 2000.0
endif 

exists('aHrfdr','parameter'):$e
if $e < 0.5 then
   create('aHrfdr','real')
   setlimit('aHrfdr',4095,0,0)
   aHrfdr = 2000.0
endif 

exists('pwXrfdr','parameter'):$e
if $e < 0.5 then
   create('pwXrfdr','pulse')
   setlimit('pwXrfdr',8192,0,0.0125)
   pwXrfdr = 8.0
endif 

exists('tXrfdrret','parameter'):$e
if $e < 0.5 then
   create('tXrfdrret','pulse')
   setlimit('tXrfdrret',500000.0,0,0.0125)
   tXrfdrret = 0.0
endif 

//=================================================
// Set Constant-time Decoupling 
//=================================================

exists('ctd','parameter'):$e
if $e < 0.5 then
   create('ctd','flag')
   setvalue('ctd','y')
endif

exists('tRFmax','parameter'):$e
if $e < 0.5 then
   create('tRFmax','pulse')
   setlimit('tRFmax',500000.0,0,0.0125)
   tRFmax = 5000.0
endif

// --------------------------------------------------
// Set parameters specific to the experiment
// --------------------------------------------------

exists('wrtp','parameter'):$e
if ($e < 0.5) then 
   create('wrtp','string')
endif
wrtp = 'reset_ahXX'
reset_ahXX

//------------------------------------------------
//  Set Bit 14 for new parameters of the .par file 
//------------------------------------------------

$params = 'frHX toHX chHspinal chHtppm chXc7 chXspc5 chXc6 chXrfdr chHmparis chYtppm chYspinal chYwaltz '
$params = $params + 'refsource1 axis BPautonoisecheck BPclassic wrtp '
$params = $params + 'roff sw1 ni phase d2 d2acqret d2dwret '
$params = $params + 'alpHspinal '
$params = $params + 'aYspinal pwYspinal alpYspinal phYspinal Yseq ddec2 '
$params = $params + 'aYtppm pwYtppm phYtppm aYwaltz pwYwaltz '
$params = $params + 'aHmix tXmix tRFmax ctd mMix aHZF tZF '
$params = $params + 'aHmixc7 qXc7 ofXc7 aXc7 pwXc7 tXc7ret dqfXc7 '
$params = $params + 'aHmixspc5 qXspc5 ofXspc5 aXspc5 pwXspc5 tXspc5ret dqfXspc5 '
$params = $params + 'aHmixc6 qXc6 ofXc6 aXc6 pwXc6 tXc6ret dqfXc6 '
$params = $params + 'ofHmparis aHmparis pwHmparis '
$params = $params + 'ofXrfdr qXrfdr aXrfdr aHrfdr pwXrfdr tXrfdrret'
setprotect('','clear',16384)
setprotect($params,'on',16384)

//--------------------------------------------------------
//  Clear parameters in 'clearparams' in the apptype macro
//--------------------------------------------------------

exists('clearparams','parameter'):$e
if $e < 0.5 then
   create('clearparams','string')
endif
setprotect('clearparams','on',16384)
$clearparams = 'frHX toHX chHspinal chHtppm chXc7 chXspc5 chXc6 chXrfdr chHmparis chYtppm chYspinal chYwaltz ' 
$clearparams = $clearparams + 'refsource1 axis '
setvalue('clearparams',$clearparams)

//-------------------------------
//  Set the parameter templates
//-------------------------------

setprotect('dg','clear',4)
$dg = '1:ACQUISITION:sw:1,at:6,np:0,d1:6,nt:0,ct:0,bs:0,'
$dg = $dg + 'ss:0,rd:1,ad:1,ddrtc:1,rof3(rof3):1,gain:0,roff:1,temp:0,srate:1;'
$dg = $dg + '1:cpHX:shHX,chHX,aHhx:0,aXhx:0,bHX:6,dHX:6,tHX:1,ofHX:3;'
$dg = $dg + '1(Hseq=\'tppm\'):tppmH:aHtppm:0,pwHtppm:1,phHtppm:2;'
$dg = $dg + '1(Hseq=\'spinal\'):spinalH:aHspinal:0,pwHspinal:1,phHspinal:2;'
$dg = $dg + '1(Yseq=\'tppm\' and ddec2=\'y\'):tppmY:aYtppm:0,pwHtppm:1,phHtppm:2;'
$dg = $dg + '1(Yseq=\'spinal\' and ddec2=\'y\'):spinalY:aYspinal:0,pwYspinal:1,phYspinal:2,alpYspinal:2;'
$dg = $dg + '1(Yseq=\'waltz\' and ddec2=\'y\'):waltzY:aYwaltz:0,pwYwaltz:1;'
$dg = $dg + '1(ctd=\'y\'):CONSTANT DECOUPLE:tRFmax:1;'
$dg = $dg + '1(ctd<>\'y\'):STANDARD DECOUPLE:;'
dg[1] = $dg
$dg = ''
$dg = $dg + '1(mMix=\'spc5\'):SPC5 MIXING:aXspc5:0,pwXspc5:1,qXspc5:0,tXspc5ret:1,ofXspc5:1,dqfXspc5,aHmixspc5:0;'
$dg = $dg + '1(mMix=\'c7\'):C7 MIXING:aXc7:0,pwXc7:1,qXc7:0,tXc7ret:1,ofXc7:1,dqfXc7,aHmixc7:0;'
$dg = $dg + '1(mMix=\'c6\'):C6 MIXING:aXc6:0,pwXc6:1,qXc6:0,tXc6ret:1,ofXc6:1,dqfXc6,aHmixc6:0;'
$dg = $dg + '1(mMix=\'paris\'):PARIS MIXING:aHmparis:0,pwHmparis:1,ofHmparis:1;'
$dg = $dg + '1(mMix=\'rfdr\'):RFDR MIXING:aXrfdr:0,pwXrfdr:1,qXrfdr:0,tXc6ret:1,ofXrfdr:1,dqfXrfdr,aHrfdr:0;'
$dg = $dg + '1(mMix=\'darr\'):DARR MIXING:tXmix:1,aHmix:1;'
$dg = $dg + '1(mMix=\'spc5\' or mMix=\'c7\' or mMix=\'c6\' or mMix=\'rfdr\'):Z Filter:aHZF:0,tZF:0;'
$dg = $dg + '1:FLAGS:ctd,ddec2,mMix;'
dg[2] = $dg

setprotect('dg2','clear',4)
$dg2 = '1:OBSERVE:tn,sfrq:6,tof:1,tpwr:0,aX90:0,pwX90:1;'
$dg2=$dg2+'1:1D Acquisition:sw:1,np:0,at:7;'
$dg2=$dg2+'2:DECOUPLE:dn,dfrq:6,dof:1,dpwr:0,aH90:0,pwH90:1;'
$dg2=$dg2+'2:2D Acquisition:sw1:1,ni:0,phase:0,d2:7,d2acqret:7,d3dwret:7;'
$dg2=$dg2+'3:DECOUPLE2:dn2,dfrq2:6,dof2:1,dpwr2:0,aY90:0,pwY90:1;'
$dg2=$dg2+'4:DECOUPLE3:dn3,dfrq3:6,dof3:1,dpwr3:0,aZ90:0,pwZ90:1;'
dg2 = $dg2
setprotect('dg2','on',4)

setprotect('ap','clear',4)
$ap = '1:SAMPLE:date,temp:1,srate:1,file;'
$ap = $ap + '1:ACQUISITION:sw:1,at:6,np:0,d1:6,nt:0,ct:0,bs:0,'
$ap = $ap + 'ss:0,rd:1,ad:1,ddrtc:1,rof3(rof3):1,gain:0,roff:1;'
$ap = $ap + '1(ni):2D ACQUISITION:d2:6,sw1:1,ni:0,phase:0;'
$ap = $ap + '1(ni2):3D ACQUISITION:d3:6,sw2:1,ni2:0,phase2:0;'
$ap = $ap + '1:DECOUPLE:dn,dfrq:6,dof:1,dpwr:0,aH90:0,pwH90:1;'
$ap = $ap + '1(dfrq2>0):DECOUPLE2:dn2,dfrq2:6,dof2:1,dpwr2:0,aY90:0,pwY90:1;'
$ap = $ap + '1(dfrq3>0):DECOUPLE3:dn3,dfrq3:6,dof3:1,dpwr3:0,aZ90:0,pwZ90:1;'
$ap = $ap + '1:cpHX:shHX,chHX,aHhx:0,aXhx:0,bHX:6,dHX:6,tHX:1,ofHX:3;'
ap[1]=$ap
$ap=''

$ap = $ap + '1(Hseq=\'tppm\'):tppmH:aHtppm:0,pwHtppm:1,phHtppm:2;'
$ap = $ap + '1(Hseq=\'spinal\'):spinalH:aHspinal:0,pwHspinal:1,phHspinal:2;'
$ap = $ap + '1(Yseq=\'tppm\' and ddec2=\'y\'):tppmY:aYtppm:0,pwHtppm:1,phHtppm:2;'
$ap = $ap + '1(Yseq=\'spinal\' and ddec2=\'y\'):spinalY:aYspinal:0,pwYspinal:1,phYspinal:2,alpYspinal:2;'
$ap = $ap + '1(Yseq=\'waltz\' and ddec2=\'y\'):waltzY:aYwaltz:0,pwYwaltz:1;'
$ap = $ap + '1(ctd=\'y\'):CONSTANT DECOUPLE:tRFmax:1;'
$ap = $ap + '1(ctd<>\'y\'):STANDARD DECOUPLE:;'
ap[2] = $ap
$ap = ''

$ap = $ap + '1(mMix=\'spc5\'):SPC5 MIXING:aXspc5:0,pwXspc5:1,qXspc5:0,tXspc5ret:1,ofXspc5:1,dqfXspc5,aHmixspc5:0;'
$ap = $ap + '1(mMix=\'c7\'):C7 MIXING:aXc7:0,pwXc7:1,qXc7:0,tXc7ret:1,ofXc7:1,dqfXc7,aHmixc7:0;'
$ap = $ap + '1(mMix=\'c6\'):C6 MIXING:aXc6:0,pwXc6:1,qXc6:0,tXc6ret:1,ofXc6:1,dqfXc6,aHmixc6:0;'
$ap = $ap + '1(mMix=\'paris\'):PARIS MIXING:aHmparis:0,pwHmparis:1,ofHmparis:1;'
$ap = $ap + '1(mMix=\'rfdr\'):RFDR MIXING:aXrfdr:0,pwXrfdr:1,qXrfdr:0,tXrfdrret:1,ofXrfdr:1,dqfXrfdr,aHrfdr:0;'
$ap = $ap + '1(mMix=\'darr\'):DARR MIXING:tXmix:1,aHmix:1;'
$ap = $ap + '1(mMix=\'spc5\' or mMix=\'c7\' or mMix=\'c6\' or mMix=\'rfdr\'):Z Filter:aHZF:0,tZF:0;'
$ap = $ap + '1:FLAGS:ctd,ddec2,mMix;'
ap[3] = $ap
setvalue('ap',$ap,'processed')
setprotect('ap','on',4)

