Compare commits

..

No commits in common. "46584236d46fc28a86f4eb582704e07a5644a85d" and "771238b3b65b585ab2d2f545f0f7af56884d35b5" have entirely different histories.

7 changed files with 123 additions and 108 deletions

View File

@ -57,7 +57,6 @@ Recorder.FileType changed from method to write-only property
- Device: explicit $arg types for consistency - Device: explicit $arg types for consistency
- Recorder.Armstrip|Armbus -> BoolArrayMember: now have .Get() - Recorder.Armstrip|Armbus -> BoolArrayMember: now have .Get()
- Cast Recorder getters to types for consistency - Cast Recorder getters to types for consistency
- Floats getters/setters now default to two decimal places.
### Fixed ### Fixed

View File

@ -123,18 +123,18 @@ The following strip commands are available:
- A1-A5: bool - A1-A5: bool
- B1-B3: bool - B1-B3: bool
- limit: int, from -40 to 12 - limit: int, from -40 to 12
- gain: float, from -60.00 to 12.00 - gain: float, from -60.0 to 12.0
- label: string - label: string
- reverb: float, from 0.00 to 10.00 - reverb: float, from 0.0 to 10.0
- delay: float, from 0.00 to 10.00 - delay: float, from 0.0 to 10.0
- fx1: float, from 0.00 to 10.00 - fx1: float, from 0.0 to 10.0
- fx2: float, from 0.00 to 10.00 - fx2: float, from 0.0 to 10.0
- pan_x: float, from -0.50 to 0.50 - pan_x: float, from -0.5 to 0.5
- pan_y: float, from 0.00 to 1.00 - pan_y: float, from 0.0 to 1.0
- color_x: float, from -0.50 to 0.50 - color_x: float, from -0.5 to 0.5
- color_y: float, from 0.00 to 1.00 - color_y: float, from 0.0 to 1.0
- fx_x: float, from -0.50 to 0.50 - fx_x: float, from -0.5 to 0.5
- fx_y: float, from 0.00 to 1.00 - fx_y: float, from 0.0 to 1.0
- postreverb: bool - postreverb: bool
- postdelay: bool - postdelay: bool
- postfx1: bool - postfx1: bool
@ -157,14 +157,14 @@ mc, k for virtual strips only.
The following strip.comp commands are available: The following strip.comp commands are available:
- knob: float, from 0.00 to 10.00 - knob: float, from 0.0 to 10.0
- gainin: float, from -24.00 to 24.00 - gainin: float, from -24.0 to 24.0
- ratio: float, from 1.00 to 8.00 - ratio: float, from 1.0 to 8.0
- threshold: float, from -40.00 to -3.00 - threshold: float, from -40.0 to -3.0
- attack: float, from 0.00 to 200.00 - attack: float, from 0.0 to 200.0
- release: float, from 0.00 to 5000.00 - release: float, from 0.0 to 5000.0
- knee: float, 0.00 to 1.00 - knee: float, 0.0 to 1.0
- gainout: float, from -24.00 to 24.00 - gainout: float, from -24.0 to 24.0
- makeup: bool - makeup: bool
for example: for example:
@ -177,13 +177,13 @@ $vmr.strip[3].comp.attack = 8.5
The following strip.gate commands are available: The following strip.gate commands are available:
- knob: float, from 0.00 to 10.00 - knob: float, from 0.0 to 10.0
- threshold: float, from -60.00 to -10.00 - threshold: float, from -60.0 to -10.0
- damping: float, from -60.00 to -10.00 - damping: float, from -60.0 to -10.0
- bpsidechain: int, from 100 to 4000 - bpsidechain: int, from 100 to 4000
- attack: float, from 0.00 to 1000.00 - attack: float, from 0.0 to 1000.0
- hold: float, from 0.00 to 5000.00 - hold: float, from 0.0 to 5000.0
- release: float, from 0.00 to 5000.00 - release: float, from 0.0 to 5000.0
for example: for example:
@ -195,7 +195,7 @@ $vmr.strip[3].gate.threshold = -40.5
The following strip.denoiser commands are available: The following strip.denoiser commands are available:
- knob: float, from 0.00 to 10.00 - knob: float, from 0.0 to 10.0
for example: for example:
@ -238,12 +238,12 @@ The following bus commands are available:
- monitor: bool - monitor: bool
- vaio: bool - vaio: bool
- mono: int, 0 off, 1 mono, 2 stereo reverse - mono: int, 0 off, 1 mono, 2 stereo reverse
- gain: float, from -60.00 to 12.00 - gain: float, from -60.0 to 12.0
- label: string - label: string
- returnreverb: float, from 0.00 to 10.00 - returnreverb: float, from 0.0 to 10.0
- returndelay: float, from 0.00 to 10.00 - returndelay: float, from 0.0 to 10.0
- returnfx1: float, from 0.00 to 10.00 - returnfx1: float, from 0.0 to 10.0
- returnfx2: float, from 0.00 to 10.00 - returnfx2: float, from 0.0 to 10.0
for example: for example:
@ -342,9 +342,9 @@ The following eq.channel.cell commands are available:
- on: bool - on: bool
- type: int, from 0 to 6 - type: int, from 0 to 6
- f: float, from 20.00 to 20000.00 - f: float, from 20.0 to 20000.0
- gain: float, from -12.00 to 12.00 - gain: float, from -12.0 to 12.0
- q: float, from 0.30 to 100.00 - q: float, from 0.3 to 100.0
for example: for example:
@ -538,7 +538,7 @@ The following commands are available:
- A1 - A5: bool - A1 - A5: bool
- B1 - B3: bool - B1 - B3: bool
- gain: float, from -60.00 to 12.00 - gain: float, from -60.0 to 12.0
- armedbus: int, from 0 to bus index - armedbus: int, from 0 to bus index
- state: string, ('play', 'stop', 'record', 'pause') - state: string, ('play', 'stop', 'record', 'pause')
- prerectime: int, from 0 to 20 seconds - prerectime: int, from 0 to 20 seconds

View File

@ -43,16 +43,10 @@ class FloatArrayMember : ArrayMember {
[int]$decimals [int]$decimals
FloatArrayMember ( FloatArrayMember (
[int]$index, [string]$prefix, [Object]$parent, [int]$decimals [int]$index, [string]$prefix, [Object]$parent, [int]$decimals = 1
) : base ($index, $prefix, $parent) { ) : base ($index, $prefix, $parent) {
$this.decimals = $decimals $this.decimals = $decimals
} }
FloatArrayMember (
[int]$index, [string]$prefix, [Object]$parent
) : base ($index, $prefix, $parent) {
$this.decimals = 2
}
[double] Get () { [double] Get () {
return [math]::Round($this.Getter(''), $this.decimals) return [math]::Round($this.Getter(''), $this.decimals)

View File

@ -16,13 +16,12 @@ function AddBoolMembers () {
function AddFloatMembers () { function AddFloatMembers () {
param( param(
[String[]]$PARAMS, [String[]]$PARAMS
[int]$decimals = 2
) )
[hashtable]$Signatures = @{} [hashtable]$Signatures = @{}
foreach ($param in $PARAMS) { foreach ($param in $PARAMS) {
# Define getter # Define getter
$Signatures['Getter'] = "[math]::Round(`$this.Getter('{0}'), {1})" -f $param, $decimals $Signatures['Getter'] = "[math]::Round(`$this.Getter('{0}'), 1)" -f $param
# Define setter # Define setter
$Signatures['Setter'] = "param ( [Single]`$arg )`n`$this.Setter('{0}', `$arg)" ` $Signatures['Setter'] = "param ( [Single]`$arg )`n`$this.Setter('{0}', `$arg)" `
-f $param -f $param

View File

@ -14,7 +14,7 @@ class Option : IRemote {
$this.delay = @() $this.delay = @()
for ($i = 0; $i -lt $num_A; $i++) { for ($i = 0; $i -lt $num_A; $i++) {
$this.delay.Add([FloatArrayMember]::new($i, 'delay', $this)) $this.delay.Add([FloatArrayMember]::new($i, 'delay', $this, 2))
} }
} }

View File

@ -244,81 +244,94 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Describe 'Float Tests' -Tag 'float' -ForEach @( Describe 'Float Tests' -Tag 'float' {
@{ Gain = -24.63; Knob = 5.27; Slide = -7.51; Xy10 = 0.83; Xy05 = -0.42; MsHz = 196.57 }
@{ Gain = -12.48; Knob = 8.91; Slide = 3.14; Xy10 = 0.27; Xy05 = 0.69; MsHz = 142.13 }
) {
Context 'Strip, one physical one virtual' -ForEach @( Context 'Strip, one physical one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in } @{ Index = $phys_in }, @{ Index = $virt_in }
) { ) {
It "Should set Strip[$index].Gain" { It "Should set Strip[$index].Gain to $value" -ForEach @(
$vmr.strip[$index].gain = $gain @{ Value = 3.6; Expected = 3.6 }, @{ Value = -8.2; Expected = -8.2 }
$vmr.strip[$index].gain | Should -Be $gain ) {
$vmr.strip[$index].gain = $value
$vmr.strip[$index].gain | Should -Be $expected
} }
} }
Context 'Strip, physical only' -ForEach @( Context 'Strip, physical only' -Skip:$ifBasic -ForEach @(
@{ Index = $phys_in } @{ Index = $phys_in }
) { ) {
Context 'Comp, Gate' -Skip:$ifBasic { Context 'Knobs' -Skip:$ifBasic -ForEach @(
It "Should set Strip[$index].Comp" { @{ Value = 8.3; Expected = 8.3 }, @{ Value = 5.1; Expected = 5.1 }
$vmr.strip[$index].comp.knob = $knob ) {
$vmr.strip[$index].comp.knob | Should -Be $knob It "Should set Strip[$index].Comp to $value" {
$vmr.strip[$index].comp.knob = $value
$vmr.strip[$index].comp.knob | Should -Be $expected
} }
It "Should set Strip[$index].Gate" { It "Should set Strip[$index].Gate to $value" {
$vmr.strip[$index].gate.knob = $knob $vmr.strip[$index].gate.knob = $value
$vmr.strip[$index].gate.knob | Should -Be $knob $vmr.strip[$index].gate.knob | Should -Be $expected
}
It "Should set Strip[$index].Denoiser to $value" -Skip:$ifNotPotato {
$vmr.strip[$index].denoiser.knob = $value
$vmr.strip[$index].denoiser.knob | Should -Be $expected
} }
} }
Context 'Comp' -Skip:$ifNotPotato { Context 'Comp' -Skip:$ifNotPotato {
It "Should set Strip[$index].Comp.Attack" { It "Should set Strip[$index].Comp.Attack" -ForEach @(
$vmr.strip[$index].comp.attack = $msHz @{ Value = 8.3; Expected = 8.3 }, @{ Value = 5.1; Expected = 5.1 }
$vmr.strip[$index].comp.attack | Should -Be $msHz ) {
$vmr.strip[$index].comp.attack = $value
$vmr.strip[$index].comp.attack | Should -Be $expected
} }
It "Should set Strip[$index].Comp.Knee" { It "Should set Strip[$index].Comp.Knee" -ForEach @(
$vmr.strip[$index].comp.knee = $xy10 @{ Value = 0.3; Expected = 0.3 }, @{ Value = 0.8; Expected = 0.8 }
$vmr.strip[$index].comp.knee | Should -Be $xy10 ) {
$vmr.strip[$index].comp.knee = $value
$vmr.strip[$index].comp.knee | Should -Be $expected
} }
} }
Context 'Gate' -Skip:$ifNotPotato { Context 'Gate' -Skip:$ifNotPotato {
It "Should set Strip[$index].Gate.BPSidechain" { It "Should set Strip[$index].Gate.BPSidechain" -ForEach @(
$vmr.strip[$index].gate.bpsidechain = $msHz @{ Value = 103.1; Expected = 103.1 }, @{ Value = 3800; Expected = 3800 }
$vmr.strip[$index].gate.bpsidechain | Should -Be $msHz ) {
$vmr.strip[$index].gate.bpsidechain = $value
$vmr.strip[$index].gate.bpsidechain | Should -Be $expected
} }
It "Should set Strip[$index].Gate.Hold" { It "Should set Strip[$index].Gate.Hold" -ForEach @(
$vmr.strip[$index].gate.hold = $msHz @{ Value = 0.3; Expected = 0.3 }, @{ Value = 5000; Expected = 5000 }
$vmr.strip[$index].gate.hold | Should -Be $msHz ) {
} $vmr.strip[$index].gate.hold = $value
} $vmr.strip[$index].gate.hold | Should -Be $expected
Context 'Denoiser' -Skip:$ifNotPotato {
It "Should set Strip[$index].Denoiser" {
$vmr.strip[$index].denoiser.knob = $knob
$vmr.strip[$index].denoiser.knob | Should -Be $knob
} }
} }
Context 'EQ' -Skip:$ifNotPotato -ForEach @( Context 'EQ' -Skip:$ifNotPotato -ForEach @(
@{ Eq = $vmr.strip[$index].eq } @{ Eq = $vmr.strip[$index].eq }
) { ) {
It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].F" { It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].F" -ForEach @(
$eq.channel[$strip_ch].cell[$cells].f = $msHz @{ Value = 1234.6; Expected = 1234.6 }, @{ Value = 7500; Expected = 7500 }
$eq.channel[$strip_ch].cell[$cells].f | Should -Be $msHz ) {
$eq.channel[$strip_ch].cell[$cells].f = $value
$eq.channel[$strip_ch].cell[$cells].f | Should -Be $expected
} }
It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].Gain" { It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].Gain" -ForEach @(
$eq.channel[$strip_ch].cell[$cells].gain = $slide @{ Value = 4.2; Expected = 4.2 }, @{ Value = -7.3; Expected = -7.3 }
$eq.channel[$strip_ch].cell[$cells].gain | Should -Be $slide ) {
$eq.channel[$strip_ch].cell[$cells].gain = $value
$eq.channel[$strip_ch].cell[$cells].gain | Should -Be $expected
} }
It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].Q" { It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].Q" -ForEach @(
$eq.channel[$strip_ch].cell[$cells].q = $knob @{ Value = 1.2; Expected = 1.2 }, @{ Value = 5.6; Expected = 5.6 }
$eq.channel[$strip_ch].cell[$cells].q | Should -Be $knob ) {
$eq.channel[$strip_ch].cell[$cells].q = $value
$eq.channel[$strip_ch].cell[$cells].q | Should -Be $expected
} }
} }
} }
@ -326,37 +339,47 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Context 'Bus, one physical one virtual' -ForEach @( Context 'Bus, one physical one virtual' -ForEach @(
@{ Index = $phys_out }, @{ Index = $virt_out } @{ Index = $phys_out }, @{ Index = $virt_out }
) { ) {
It "Should set Bus[$index].Gain" { It "Should set Bus[$index].Gain" -ForEach @(
$vmr.bus[$index].gain = $gain @{ Value = 5.2; Expected = 5.2 }, @{ Value = -38.2; Expected = -38.2 }
$vmr.bus[$index].gain | Should -Be $gain ) {
$vmr.bus[$index].gain = $value
$vmr.bus[$index].gain | Should -Be $expected
} }
Context 'EQ' -Skip:$ifBasic -ForEach @( Context 'EQ' -Skip:$ifBasic -ForEach @(
@{ Eq = $vmr.bus[$index].eq } @{ Eq = $vmr.bus[$index].eq }
) { ) {
It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].F" { It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].F" -ForEach @(
$eq.channel[$bus_ch].cell[$cells].f = $msHz @{ Value = 1234.6; Expected = 1234.6 }, @{ Value = 7500; Expected = 7500 }
$eq.channel[$bus_ch].cell[$cells].f | Should -Be $msHz ) {
$eq.channel[$bus_ch].cell[$cells].f = $value
$eq.channel[$bus_ch].cell[$cells].f | Should -Be $expected
} }
It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Gain" { It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Gain" -ForEach @(
$eq.channel[$bus_ch].cell[$cells].gain = $slide @{ Value = 4.2; Expected = 4.2 }, @{ Value = -7.3; Expected = -7.3 }
$eq.channel[$bus_ch].cell[$cells].gain | Should -Be $slide ) {
$eq.channel[$bus_ch].cell[$cells].gain = $value
$eq.channel[$bus_ch].cell[$cells].gain | Should -Be $expected
} }
It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Q" { It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Q" -ForEach @(
$eq.channel[$bus_ch].cell[$cells].q = $knob @{ Value = 1.2; Expected = 1.2 }, @{ Value = 5.6; Expected = 5.6 }
$eq.channel[$bus_ch].cell[$cells].q | Should -Be $knob ) {
$eq.channel[$bus_ch].cell[$cells].q = $value
$eq.channel[$bus_ch].cell[$cells].q | Should -Be $expected
} }
} }
} }
Context 'Option' { Context 'Option' {
It "Should set and get Option.delay[$phys_out]" { It "Should set and get Option.delay[$phys_out]" -ForEach @(
$vmr.option.delay[$phys_out].set($msHz) @{ Value = 486.57 }, @{ Value = 26.41 }
) {
$vmr.option.delay[$phys_out].set($value)
$vmr.command.restart() $vmr.command.restart()
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
$vmr.option.delay[$phys_out].get() | Should -Be $msHz $vmr.option.delay[$phys_out].get() | Should -Be $value
} }
} }
} }
@ -885,7 +908,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.recorder.filetype = $filetype $vmr.recorder.filetype = $filetype
$vmr.recorder.state = 'record' $vmr.recorder.state = 'record'
Start-Sleep -Milliseconds 10 Start-Sleep -Milliseconds 100
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date) $stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
$vmr.recorder.state | Should -Be 'record' $vmr.recorder.state | Should -Be 'record'
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
@ -979,7 +1002,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
BeforeEach { BeforeEach {
$vmr.recorder.record() $vmr.recorder.record()
Start-Sleep -Milliseconds 10 Start-Sleep -Milliseconds 100
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date) $stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000

View File

@ -12,7 +12,7 @@ function Test-RecDir ([object]$vmr, [string]$recDir) {
try { try {
$vmr.recorder.record() $vmr.recorder.record()
Start-Sleep -Milliseconds 10 Start-Sleep -Milliseconds 100
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date) $stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000