Help: Why does $eq or but not $lte in this instance? [Solved / Understood]

Tags: #<Tag:0x00007f756bafdc68>

In this extract, the first section, if _bitRateType is CBR that all works.

But if _bitRateType is VBR$lt or $lte will not work

I’ve reversed the order, reversed the use of Greater Than / Less Than … and other variants … it’s just not going to happen. Even if I put the VBR conditions first, CBR still works. !!!

If it’s a factor of 8, it’s CBR, that’s all good.
But if it’s not a factor of 8, it’s VBR … and it will show VBR in place of CBR, but it will NOT print the value.

e.g.
...[256 44100KHz CBR 2ch] works right with a CBR value.
... 44100KHz VBR 2ch] prints no value stand in if it’s VBR. :rage:

$noop(########### Audio Metrics Setup ###########################)
$noop(########### DevMode Values Only ############################)
$set(_biitrate,191.0)
$set(_saample,44100)
$set(_biits_per_sample,16)
$set(_chaannels,2)
$noop(########### CONFIRM DevMode is Disabled for Live Use ########)
$if($eq(%_devMode%,1)$set(_bitRateSpeed,%_sample%KHz ),$set(_bitRateSpeed,%_saample%KHz ))
$if($eq(%_devMode%,1)$set(_bitRateValue,%_bitrate%),$set(_bitRateValue,%_biitrate%))
$if($eq(%_devMode%,1)$set(_bitsPerSample,[%_bits_per_sample%]bit),$set(_bitsPerSample,[%_biits_per_sample%]bit))
$if($eq(%_devMode%,1)$set(_audioChannels,%_channels%ch]),$set(_audioChannels,%_chaannels%ch]))
$noop(Bitrate factors of 8.0 are CBR, Anything else is VBR)
$set(_bitRateType,$if($eq_any(%_bitRateValue%,320.0,256.0,224.0,192.0,160.0,128.0,112.0,96.0,80.0,64.0,56.0,48.0,40.0,32.0,24.0,16.0,8.0),CBR,VBR))
$if($eq(%_bitRateType%,CBR),
$if($eq(%_bitRateValue%,320.0),$set(_fileBitRate,[320 ),
$if($eq(%_bitRateValue%,256.0),$set(_fileBitRate,[256 ),
$if($eq(%_bitRateValue%,224.0),$set(_fileBitRate,[224 ),
$if($eq(%_bitRateValue%,192.0),$set(_fileBitRate,[192 ),
$if($eq(%_bitRateValue%,160.0),$set(_fileBitRate,[160 ),
$if($eq(%_bitRateValue%,128.0),$set(_fileBitRate,[128 ),
$if($eq(%_bitRateValue%,112.0),$set(_fileBitRate,[112 ),
$if($eq(%_bitRateValue%,96.0),$set(_fileBitRate,[96 ),
$if($eq(%_bitRateValue%,80.0),$set(_fileBitRate,[80 ),
$if($eq(%_bitRateValue%,64.0),$set(_fileBitRate,[64 ),
$if($eq(%_bitRateValue%,56.0),$set(_fileBitRate,[56 ),
$if($eq(%_bitRateValue%,48.0),$set(_fileBitRate,[48 ),
$if($eq(%_bitRateValue%,40.0),$set(_fileBitRate,[40 ),
$if($eq(%_bitRateValue%,32.0),$set(_fileBitRate,[32 ),
$if($eq(%_bitRateValue%,24.0),$set(_fileBitRate,[24 ),
$if($eq(%_bitRateValue%,16.0),$set(_fileBitRate,[16 ),
$if($eq(%_bitRateValue%,8.0),$set(_fileBitRate,[8 ),
))))))))))))))))))
$if($eq(%_bitRateType%,VBR),
$if($gt(%_bitRateValue%,319.0),$set(_fileBitRate,[320+),
$if($eq(%_bitRateValue%,220.0),$set(_fileBitRate,[V0 ),
$if($lt(%_bitRateValue%,191.0),$set(_fileBitRate,[V1 ),
$if($lt(%_bitRateValue%,170.0),$set(_fileBitRate,[V2 ),
$if($lt(%_bitRateValue%,150.0),$set(_fileBitRate,[V3 ),
$if($lt(%_bitRateValue%,140.0),$set(_fileBitRate,[V4 ),
$if($lt(%_bitRateValue%,130.0),$set(_fileBitRate,[V5 ),
$if($lt(%_bitRateValue%,120.0),$set(_fileBitRate,[V6 ),
)))))))))

$noop(######### File Naming Structure Variables Complete #########)
%_bitRateValue%

%_fileBitRate%%_bitRateSpeed%%_bitRateType% %_audioChannels%

What is %_bitRateValue% (bRV) set to for your VBR testing? Is it 191.0 from %_devMode% being set to 1? If so, then there’s a gap here:

$if($eq(%_bitRateValue%,220.0),$set(_fileBitRate,[V0 ),
$if($lt(%_bitRateValue%,191.0),$set(_fileBitRate,[V1 ),

You’re handling

  • bRV == 220
  • bRV < 191.0

but there’s nothing for 191.0 <= brV < 220.0.

4 Likes

…and here’s one that does what it’s supposed to do now. (Bzzzzt!) Wrong Answer!
(The Judges say that’s incorrect!)

When I actually applied it to files that have never been run through Picard before, I got garbage on the output end.

But now it is actually working, properly, like it’s supposed to.

It *really really HELPs… to use PROPER syntax … which means make absolutely sure you are interpreting the documentation correctly.

$noop(★ For Development Only - Variable Settings in Subsections ★)
$noop(★ Where Available - Audio Metrics Only at this Time ★)

$noop(########### Audio Metrics Setup  ###########################)
$noop(########### DevMode Values Only ############################)
$set(_biitrate,192)
$set(_saample_rate,44100)
$set(_biits_per_sample,16)
$set(_chaannels,2)
$set(_tiitle,My Great Score)

$set(_showBandwidth,1)

$set(_devMode,0)
$set(_showTime,1)

$noop(########### CONFIRM DevMode is Disabled for Live Use ########)
$noop({%title% - %_bitrate% - %_sample_rate% - %_bits_per_sample% - %_channels%})

$if($eq(%_devMode%,1),$set(_bitRateSpeed,%_saample_rate%KHz ),$set(_bitRateSpeed,%_sample_rate%KHz ))
$if($eq(%_devMode%,1),$set(_bitRateValue,$left(%_biitrate%,3)),$set(_bitRateValue,$left(%_bitrate%,3)))
$if($eq(%_devMode%,1),$set(_bitsPerSample,[%_biits_per_sample%]bit),$set(_bitsPerSample,[%_bits_per_sample%]bit))
$if($eq(%_devMode%,1),$set(_audioChannels,%_chaannels%ch]),$set(_audioChannels,%_channels%ch]))
$if($eq(%_devMode%,1),$set(_titleForFilename,%title%),$set(_titleForFilename,%title%))

$noop({%title% - %_bitRateValue% - %_bitRateSpeed% - %_bitsPerSample% - %_audioChannels% - %_titleForFilename% - %_fileCBRRate% - %_fileVBRRate% -  %_bitrate% - %_biitrate%})

$noop(Bitrate factors of 8.0 are CBR, Anything else is VBR)

$set(_bitRateType,$if($eq_any(%_bitRateValue%,320,256,224,192,160,128,112,96,80,64,56,48,40,32,24,16,8),CBR$set(_cbrRateValue,%_bitRateValue%),VBR$set(_vbrRateValue,%_bitRateValue%)))

$noop(Bitrate factors of 8.0 are most likely CBR with the remainder being VBR)

$if($eq(%_cbrRateValue%,320),$set(_fileCBRRate,[320 ),
$if($eq(%_cbrRateValue%,256),$set(_fileCBRRate,[256 ),
$if($eq(%_cbrRateValue%,224),$set(_fileCBRRate,[224 ),
$if($eq(%_cbrRateValue%,192),$set(_fileCBRRate,[192 ),
$if($eq(%_cbrRateValue%,160),$set(_fileCBRRate,[160 ),
$if($eq(%_cbrRateValue%,128),$set(_fileCBRRate,[128 ),
$if($eq(%_cbrRateValue%,112),$set(_fileCBRRate,[112 ),
$if($eq(%_cbrRateValue%,96),$set(_fileCBRRate,[96 ),
$if($eq(%_cbrRateValue%,80),$set(_fileCBRRate,[80 ),
$if($eq(%_cbrRateValue%,64),$set(_fileCBRRate,[64 ),
$if($eq(%_cbrRateValue%,56),$set(_fileCBRRate,[56 ),
$if($eq(%_cbrRateValue%,48),$set(_fileCBRRate,[48 ),
$if($eq(%_cbrRateValue%,40),$set(_fileCBRRate,[40 ),
$if($eq(%_cbrRateValue%,32),$set(_fileCBRRate,[32 ),
$if($eq(%_cbrRateValue%,24),$set(_fileCBRRate,[24 ),
$if($eq(%_cbrRateValue%,16),$set(_fileCBRRate,[16 ),
$if($eq(%_cbrRateValue%,8),$set(_fileCBRRate,[8 ),
										      )))))))))))))))))

$if($eq(%_bitRateType%,VBR)$set(_fileVBRRate,%_vbrRateValue% ) ,
$if($gt(%_vbrRateValue%,319),$set(_fileVBRRate,[320+ ),
$if($gt(%_vbrRateValue%,220),$set(_fileVBRRate,[V0 ),
$if($gt(%_vbrRateValue%,191),$set(_fileVBRRate,[V1 ),
$if($gt(%_vbrRateValue%,170),$set(_fileVBRRate,[V2 ),
$if($gt(%_vbrRateValue%,150),$set(_fileVBRRate,[V3 ),
$if($gt(%_vbrRateValue%,140),$set(_fileVBRRate,[V4 ),
$if($gt(%_vbrRateValue%,130),$set(_fileVBRRate,[V5 ),
$if($gt(%_vbrRateValue%,120),$set(_fileVBRRate,[V6 ),
												)))))))))

$noop(%_vbrRateValue%)
$noop(######### File Naming Structure Variables Complete #########)
$noop(★ GAME OVER ★)
%_titleForFilename%
$if($eq(%_showTime%,1), [%_length%] )
$if($eq(%_showBandwidth%,1),%_fileCBRRate%%_fileVBRRate%%_bitRateSpeed%%_bitRateType% %_audioChannels%)

$noop(★ 00 CREDITS ★)

This one -actually- works. For Real.

I won’t get back the several hours I spent banging on the desk, but I also will NOT forget how it works either. So, that’s a Win, just at a huge cost.