From 6154af7ad7850b3f256638caba49cc670c9a3654 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Thu, 27 Nov 2025 08:40:55 -0500 Subject: [PATCH 1/6] Create eq.ps1 - eq - eq channel - eq cell --- lib/eq.ps1 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/eq.ps1 diff --git a/lib/eq.ps1 b/lib/eq.ps1 new file mode 100644 index 0000000..bf2162c --- /dev/null +++ b/lib/eq.ps1 @@ -0,0 +1,60 @@ +class Eq : IRemote { + [System.Collections.ArrayList]$channel + [string]$prefix + + Eq ([string]$prefix, [int]$chCount, [Object]$parent) : base ($parent.index, $parent.remote) { + AddBoolMembers -PARAMS @('on', 'ab') + + $this.channel = @() + for ($ch = 0; $ch -lt $chCount; $ch++) { + $this.channel.Add([EqChannel]::new($ch, $this)) + } + + $this.prefix = $prefix + } + + [void] Load ([string]$filename) { + $param = 'Command.Load{0}Eq[{1}]' -f $this.prefix, $this.index + $this.remote.Setter($param, $filename) + } + + [void] Save ([string]$filename) { + $param = 'Command.Save{0}Eq[{1}]' -f $this.prefix, $this.index + $this.remote.Setter($param, $filename) + } +} + +class EqChannel : IRemote { + [System.Collections.ArrayList]$cell + [string]$eqId + + EqChannel ([int]$index, [Object]$eq) : base ($index, $eq.remote) { + $this.eqId = $eq.identifier() + + $this.cell = @() + $cellCount = $this.remote.kind.cells + for ($c = 0; $c -lt $cellCount; $c++) { + $this.cell.Add([EqCell]::new($c, $this)) + } + } + + [string] identifier () { + return '{0}.Channel[{1}]' -f $this.eqId, $this.index + } +} + +class EqCell : IRemote { + [string]$channelId + + EqCell ([int]$index, [Object]$channel) : base ($index, $channel.remote) { + $this.channelId = $channel.identifier() + + AddBoolMembers -PARAMS @('on') + AddIntMembers -PARAMS @('type') + AddFloatMembers -PARAMS @('f', 'gain', 'q') + } + + [string] identifier () { + return '{0}.Cell[{1}]' -f $this.channelId, $this.index + } +} \ No newline at end of file From 60d97a89b42cb761e70d8b88413fa080ae648d2b Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Thu, 27 Nov 2025 09:49:46 -0500 Subject: [PATCH 2/6] stripeq, buseq - replace iremote with eq for stripeq and buseq - move identifier to eq - avoid passing entire parent objects --- lib/Voicemeeter.psm1 | 1 + lib/bus.ps1 | 9 ++------- lib/eq.ps1 | 20 ++++++++++++-------- lib/kinds.ps1 | 9 +++++++++ lib/strip.ps1 | 9 ++------- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/lib/Voicemeeter.psm1 b/lib/Voicemeeter.psm1 index 42b0762..b786667 100644 --- a/lib/Voicemeeter.psm1 +++ b/lib/Voicemeeter.psm1 @@ -5,6 +5,7 @@ . $PSScriptRoot\iremote.ps1 . $PSScriptRoot\arraymember.ps1 . $PSScriptRoot\device.ps1 +. $PSScriptRoot\eq.ps1 . $PSScriptRoot\strip.ps1 . $PSScriptRoot\bus.ps1 . $PSScriptRoot\macrobuttons.ps1 diff --git a/lib/bus.ps1 b/lib/bus.ps1 index bd0ac15..03fe3b1 100644 --- a/lib/bus.ps1 +++ b/lib/bus.ps1 @@ -83,13 +83,8 @@ class BusMode : IRemote { } } -class BusEq : IRemote { - BusEq ([int]$index, [Object]$remote) : base ($index, $remote) { - AddBoolMembers -PARAMS @('on', 'ab') - } - - [string] identifier () { - return 'Bus[' + $this.index + '].EQ' +class BusEq : Eq { + BusEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Bus', $remote.kind.bus_ch) { } } diff --git a/lib/eq.ps1 b/lib/eq.ps1 index bf2162c..13b11e5 100644 --- a/lib/eq.ps1 +++ b/lib/eq.ps1 @@ -2,15 +2,19 @@ class Eq : IRemote { [System.Collections.ArrayList]$channel [string]$prefix - Eq ([string]$prefix, [int]$chCount, [Object]$parent) : base ($parent.index, $parent.remote) { + Eq ([int]$index, [Object]$remote, [string]$prefix, [int]$chCount) : base ($index, $remote) { + $this.prefix = $prefix + AddBoolMembers -PARAMS @('on', 'ab') $this.channel = @() for ($ch = 0; $ch -lt $chCount; $ch++) { - $this.channel.Add([EqChannel]::new($ch, $this)) + $this.channel.Add([EqChannel]::new($ch, $remote, $this.identifier())) } + } - $this.prefix = $prefix + [string] identifier () { + return '{0}[{1}].EQ' -f $this.prefix, $this.index } [void] Load ([string]$filename) { @@ -28,13 +32,13 @@ class EqChannel : IRemote { [System.Collections.ArrayList]$cell [string]$eqId - EqChannel ([int]$index, [Object]$eq) : base ($index, $eq.remote) { - $this.eqId = $eq.identifier() + EqChannel ([int]$index, [Object]$remote, [string]$eqId) : base ($index, $remote) { + $this.eqId = $eqId $this.cell = @() $cellCount = $this.remote.kind.cells for ($c = 0; $c -lt $cellCount; $c++) { - $this.cell.Add([EqCell]::new($c, $this)) + $this.cell.Add([EqCell]::new($c, $remote, $this.identifier())) } } @@ -46,8 +50,8 @@ class EqChannel : IRemote { class EqCell : IRemote { [string]$channelId - EqCell ([int]$index, [Object]$channel) : base ($index, $channel.remote) { - $this.channelId = $channel.identifier() + EqCell ([int]$index, [Object]$remote, [string]$channelId) : base ($index, $remote) { + $this.channelId = $channelId AddBoolMembers -PARAMS @('on') AddIntMembers -PARAMS @('type') diff --git a/lib/kinds.ps1 b/lib/kinds.ps1 index e2cc224..27766e8 100644 --- a/lib/kinds.ps1 +++ b/lib/kinds.ps1 @@ -11,6 +11,9 @@ $KindMap = @{ 'insert' = 0 'vban_in' = 4 'vban_out' = 4 + 'strip_ch' = 0 + 'bus_ch' = 0 + 'cells' = 0 }; 'banana' = @{ 'name' = 'banana' @@ -24,6 +27,9 @@ $KindMap = @{ 'insert' = 22 'vban_in' = 8 'vban_out' = 8 + 'strip_ch' = 0 + 'bus_ch' = 8 + 'cells' = 6 }; 'potato' = @{ 'name' = 'potato' @@ -37,6 +43,9 @@ $KindMap = @{ 'insert' = 34 'vban_in' = 8 'vban_out' = 8 + 'strip_ch' = 2 + 'bus_ch' = 8 + 'cells' = 6 }; } diff --git a/lib/strip.ps1 b/lib/strip.ps1 index ef16163..b73aecb 100644 --- a/lib/strip.ps1 +++ b/lib/strip.ps1 @@ -152,13 +152,8 @@ class StripDenoiser : IRemote { ) } -class StripEq : IRemote { - StripEq ([int]$index, [Object]$remote) : base ($index, $remote) { - AddBoolMembers -PARAMS @('on', 'ab') - } - - [string] identifier () { - return 'Strip[' + $this.index + '].EQ' +class StripEq : Eq { + StripEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Strip', $remote.kind.strip_ch) { } } From dedb4201bef83713ebfee0ac976b310a64854b7b Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:54:54 -0500 Subject: [PATCH 3/6] update tests pester tests pass for all kinds --- tests/higher.Tests.ps1 | 326 +++++++++++++++++++++++++++++++---------- tests/run.ps1 | 3 + 2 files changed, 252 insertions(+), 77 deletions(-) diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 3f2dda0..68af850 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -27,25 +27,32 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { } } - Context 'physical only' -ForEach @( + Context 'Strip, physical only' -ForEach @( @{ Index = $phys_in } ) { - Context 'eq.{param}' -Skip:$ifNotPotato { + Context 'Eq' -Skip:$ifNotPotato -ForEach @( + @{ Eq = $vmr.strip[$index].eq } + ) { It "Should set Strip[$index].EQ.On to $value" { - $vmr.strip[$index].eq.on = $value - $vmr.strip[$index].eq.on | Should -Be $expected - } + $eq.on = $value + $eq.on | Should -Be $value + } + + It "Should set Strip[$index].EQ.AB to $value" { + $eq.ab = $value + $eq.ab | Should -Be $value + } + + It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].On to $value" { + $eq.channel[$strip_ch].cell[$cells].on = $value + $eq.channel[$strip_ch].cell[$cells].on | Should -Be $value + } } } Context 'Bus, one physical one virtual' -ForEach @( @{ Index = $phys_out }, @{ Index = $virt_out } ) { - It "Should set and get Bus[$index].Eq.On" -Skip:$ifBasic { - $vmr.bus[$index].eq.on = $value - $vmr.bus[$index].eq.on | Should -Be $expected - } - It "Should set and get Bus[$index].Mono" { $vmr.bus[$index].mono = $value $vmr.bus[$index].mono | Should -Be $expected @@ -60,6 +67,25 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.bus[$index].mode.centeronly = $value $vmr.bus[$index].mode.centeronly | Should -Be $expected } + + Context 'Eq' -Skip:$ifBasic -ForEach @( + @{ Eq = $vmr.bus[$index].eq } + ) { + It "Should set Bus[$index].EQ.On to $value" { + $eq.on = $value + $eq.on | Should -Be $value + } + + It "Should set Bus[$index].EQ.AB to $value" { + $eq.ab = $value + $eq.ab | Should -Be $value + } + + It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].On to $value" { + $eq.channel[$bus_ch].cell[$cells].on = $value + $eq.channel[$bus_ch].cell[$cells].on | Should -Be $value + } + } } Context 'Macrobutton' -ForEach @( @@ -146,95 +172,129 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { } Describe 'Float Tests' { - Describe 'Strip tests' { - Context 'one physical, one virtual' -ForEach @( - @{ Index = $phys_in }, @{ Index = $virt_in } + Context 'Strip, one physical one virtual' -ForEach @( + @{ Index = $phys_in }, @{ Index = $virt_in } + ) { + It "Should set Strip[$index].Gain to $value" -ForEach @( + @{ Value = 3.6; Expected = 3.6 }, @{ Value = -8.2; Expected = -8.2 } ) { - Context 'gain' -ForEach @( - @{ Value = 3.6; Expected = 3.6 }, @{ Value = -8.2; Expected = -8.2 } - ) { - It "Should set Strip[$index].Gain to $value" { - $vmr.strip[$index].gain = $value - $vmr.strip[$index].gain | Should -Be $expected - } + $vmr.strip[$index].gain = $value + $vmr.strip[$index].gain | Should -Be $expected + } + } + + Context 'Strip, physical only' -Skip:$ifBasic -ForEach @( + @{ Index = $phys_in } + ) { + Context 'Knobs' -Skip:$ifBasic -ForEach @( + @{ Value = 8.3; Expected = 8.3 }, @{ Value = 5.1; Expected = 5.1 } + ) { + 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 to $value" { + $vmr.strip[$index].gate.knob = $value + $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 'physical only' -Skip:$ifBasic -ForEach @( - @{ Index = $phys_in } - ) { - Context 'comp, gate' -ForEach @( + Context 'Comp' -Skip:$ifNotPotato { + It "Should set Strip[$index].Comp.Attack" -ForEach @( @{ Value = 8.3; Expected = 8.3 }, @{ Value = 5.1; Expected = 5.1 } ) { - 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 to $value" { - $vmr.strip[$index].gate.knob = $value - $vmr.strip[$index].gate.knob | Should -Be $expected - } + $vmr.strip[$index].comp.attack = $value + $vmr.strip[$index].comp.attack | Should -Be $expected } - Context 'denoiser' -Skip:$ifNotPotato -ForEach @( - @{ Value = 8.3; Expected = 8.3 }, @{ Value = 5.1; Expected = 5.1 } - ) { - It "Should set Strip[$index].Denoiser to $value" { - $vmr.strip[$index].denoiser.knob = $value - $vmr.strip[$index].denoiser.knob | Should -Be $expected - } - } - - Context 'comp.{param}' -Skip:$ifNotPotato -ForEach @( - @{ Value = 8.3; Expected = 8.3 }, @{ Value = 5.1; Expected = 5.1 } - ) { - It "Should set Strip[$index].Comp.Attack to $value" { - $vmr.strip[$index].comp.attack = $value - $vmr.strip[$index].comp.attack | Should -Be $expected - } - } - - Context 'comp.{param}' -Skip:$ifNotPotato -ForEach @( + It "Should set Strip[$index].Comp.Knee" -ForEach @( @{ Value = 0.3; Expected = 0.3 }, @{ Value = 0.8; Expected = 0.8 } ) { - It "Should set Strip[$index].Comp.Knee to $value" { - $vmr.strip[$index].comp.knee = $value - $vmr.strip[$index].comp.knee | Should -Be $expected - } + $vmr.strip[$index].comp.knee = $value + $vmr.strip[$index].comp.knee | Should -Be $expected } + } - Context 'gate.{param}' -Skip:$ifNotPotato -ForEach @( - @{ Value = 103; Expected = 103 }, @{ Value = 3800; Expected = 3800 } + Context 'Gate' -Skip:$ifNotPotato { + It "Should set Strip[$index].Gate.BPSidechain" -ForEach @( + @{ Value = 103.1; Expected = 103.1 }, @{ Value = 3800; Expected = 3800 } ) { - It "Should set Strip[$index].Gate.BPSidechain to $value" { - $vmr.strip[$index].gate.bpsidechain = $value - $vmr.strip[$index].gate.bpsidechain | Should -Be $expected - } + $vmr.strip[$index].gate.bpsidechain = $value + $vmr.strip[$index].gate.bpsidechain | Should -Be $expected } - Context 'gate.{param}' -Skip:$ifNotPotato -ForEach @( + It "Should set Strip[$index].Gate.Hold" -ForEach @( @{ Value = 0.3; Expected = 0.3 }, @{ Value = 5000; Expected = 5000 } ) { - It "Should set Strip[$index].Gate.Hold to $value" { - $vmr.strip[$index].gate.hold = $value - $vmr.strip[$index].gate.hold | Should -Be $expected - } + $vmr.strip[$index].gate.hold = $value + $vmr.strip[$index].gate.hold | Should -Be $expected } - } + } + + Context 'EQ' -Skip:$ifNotPotato -ForEach @( + @{ Eq = $vmr.strip[$index].eq } + ) { + It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].F" -ForEach @( + @{ Value = 1234.6; Expected = 1234.6 }, @{ Value = 7500; Expected = 7500 } + ) { + $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" -ForEach @( + @{ Value = 4.2; Expected = 4.2 }, @{ Value = -7.3; Expected = -7.3 } + ) { + $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" -ForEach @( + @{ Value = 1.2; Expected = 1.2 }, @{ Value = 5.6; Expected = 5.6 } + ) { + $eq.channel[$strip_ch].cell[$cells].q = $value + $eq.channel[$strip_ch].cell[$cells].q | Should -Be $expected + } + } } - Describe 'Bus tests' { - Context 'one physical, one virtual' -ForEach @( - @{ Index = $phys_out }, @{ Index = $virt_out } + Context 'Bus, one physical one virtual' -ForEach @( + @{ Index = $phys_out }, @{ Index = $virt_out } + ) { + It "Should set Bus[$index].Gain" -ForEach @( + @{ Value = 5.2; Expected = 5.2 }, @{ Value = -38.2; Expected = -38.2 } ) { - Context 'gain' -ForEach @( - @{ Value = 5.2; Expected = 5.2 }, @{ Value = -38.2; Expected = -38.2 } + $vmr.bus[$index].gain = $value + $vmr.bus[$index].gain | Should -Be $expected + } + + Context 'EQ' -Skip:$ifBasic -ForEach @( + @{ Eq = $vmr.bus[$index].eq } + ) { + It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].F" -ForEach @( + @{ Value = 1234.6; Expected = 1234.6 }, @{ Value = 7500; Expected = 7500 } ) { - It "Should set Bus[$index].Gain to $value" { - $vmr.bus[$index].gain = $value - $vmr.bus[$index].gain | Should -Be $expected - } + $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" -ForEach @( + @{ Value = 4.2; Expected = 4.2 }, @{ Value = -7.3; Expected = -7.3 } + ) { + $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" -ForEach @( + @{ Value = 1.2; Expected = 1.2 }, @{ Value = 5.6; Expected = 5.6 } + ) { + $eq.channel[$bus_ch].cell[$cells].q = $value + $eq.channel[$bus_ch].cell[$cells].q | Should -Be $expected } } } @@ -272,6 +332,32 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.strip[$index].device.sr | Should -BeOfType [int] } } + + Context 'Eq' -Skip:$ifNotPotato -ForEach @( + @{ Eq = $vmr.strip[$index].eq } + ) { + It "Should set Strip[$index].EQ.Channel[$strip_ch].Cell[$cells].Type" -ForEach @( + @{ Value = 0; Expected = 0 }, @{ Value = 6; Expected = 6 } + ) { + $eq.channel[$strip_ch].cell[$cells].type = $value + $eq.channel[$strip_ch].cell[$cells].type | Should -Be $expected + } + } + } + + Context 'Bus, one physical one virtual' -ForEach @( + @{ Index = $phys_out }, @{ Index = $virt_out } + ) { + Context 'Eq' -Skip:$ifBasic -ForEach @( + @{ Eq = $vmr.bus[$index].eq } + ) { + It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Type" -ForEach @( + @{ Value = 0; Expected = 0 }, @{ Value = 6; Expected = 6 } + ) { + $eq.channel[$bus_ch].cell[$cells].type = $value + $eq.channel[$bus_ch].cell[$cells].type | Should -Be $expected + } + } } Context 'Bus, physical only' -ForEach @( @@ -393,6 +479,49 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.strip[$index].device.name | Should -Be $value } } + + Context 'EQ' -Skip:$ifNotPotato -ForEach @( + @{ Eq = $vmr.strip[$index].eq } + ) { + It "Should save then load Strip[$index].EQ" -ForEach @( + @{ Fq = 1234.5; Gain = 4.2; Ql = 56.2; Type = 3 } + ) { + $tmp = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "vmreq-$(New-Guid).xml") + try { + # set some values + $eq.channel[$strip_ch].cell[$cells].f = $fq + $eq.channel[$strip_ch].cell[$cells].gain = $gain + $eq.channel[$strip_ch].cell[$cells].q = $ql + $eq.channel[$strip_ch].cell[$cells].type = $type + + # save eq + $eq.Save($tmp) + Start-Sleep -Milliseconds 100 + Test-Path $tmp | Should -BeTrue + + # change values + $eq.channel[$strip_ch].cell[$cells].f = 1000 + $eq.channel[$strip_ch].cell[$cells].gain = 0 + $eq.channel[$strip_ch].cell[$cells].q = 1 + $eq.channel[$strip_ch].cell[$cells].type = 0 + + # load eq + $eq.Load($tmp) + Start-Sleep -Milliseconds 100 + + # verify values + $eq.channel[$strip_ch].cell[$cells].f | Should -Be $fq + $eq.channel[$strip_ch].cell[$cells].gain | Should -Be $gain + $eq.channel[$strip_ch].cell[$cells].q | Should -Be $ql + $eq.channel[$strip_ch].cell[$cells].type | Should -Be $type + } + finally { + if (Test-Path $tmp) { + Remove-Item $tmp -Force + } + } + } + } } Context 'Bus, one physical, one virtual' -ForEach @( @@ -405,6 +534,49 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.bus[$index].label = $value $vmr.bus[$index].label | Should -Be $expected } + + Context 'EQ' -Skip:$ifBasic -ForEach @( + @{ Eq = $vmr.bus[$index].eq } + ) { + It "Should save then load Bus[$index].EQ" -ForEach @( + @{ Fq = 1234.5; Gain = 4.2; Ql = 56.2; Type = 3 } + ) { + $tmp = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "vmreq-$(New-Guid).xml") + try { + # set some values + $eq.channel[$bus_ch].cell[$cells].f = $fq + $eq.channel[$bus_ch].cell[$cells].gain = $gain + $eq.channel[$bus_ch].cell[$cells].q = $ql + $eq.channel[$bus_ch].cell[$cells].type = $type + + # save eq + $eq.Save($tmp) + Start-Sleep -Milliseconds 100 + Test-Path $tmp | Should -BeTrue + + # change values + $eq.channel[$bus_ch].cell[$cells].f = 1000 + $eq.channel[$bus_ch].cell[$cells].gain = 0 + $eq.channel[$bus_ch].cell[$cells].q = 1 + $eq.channel[$bus_ch].cell[$cells].type = 0 + + # load eq + $eq.Load($tmp) + Start-Sleep -Milliseconds 100 + + # verify values + $eq.channel[$bus_ch].cell[$cells].f | Should -Be $fq + $eq.channel[$bus_ch].cell[$cells].gain | Should -Be $gain + $eq.channel[$bus_ch].cell[$cells].q | Should -Be $ql + $eq.channel[$bus_ch].cell[$cells].type | Should -Be $type + } + finally { + if (Test-Path $tmp) { + Remove-Item $tmp -Force + } + } + } + } } Context 'Bus, physical only' -ForEach @( diff --git a/tests/run.ps1 b/tests/run.ps1 index e592d91..a4d73ea 100644 --- a/tests/run.ps1 +++ b/tests/run.ps1 @@ -18,6 +18,9 @@ function main() { $vban_out = $vmr.kind.vban_out - 1 $insert = $vmr.kind.insert - 1 $composite = $vmr.kind.composite - 1 + $strip_ch = $vmr.kind.strip_ch - 1 + $bus_ch = $vmr.kind.bus_ch - 1 + $cells = $vmr.kind.cells - 1 # skip conditions by kind $ifBasic = $vmr.kind.name -eq 'basic' From d13b08eff4ba5b4db183d3f27e79cb6965a62224 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:09:06 -0500 Subject: [PATCH 4/6] update docs --- CHANGELOG.md | 1 + README.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cde41a..e56a5c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Before any major/minor/patch is released all test units will be run to verify th - Patch class - Option class - Device classes +- EQ class ## [3.3.0] - 2024-06-29 diff --git a/README.md b/README.md index 694399b..3024ac1 100644 --- a/README.md +++ b/README.md @@ -321,6 +321,11 @@ The following strip.eq | bus.eq commands are available: - on: bool - ab: bool +The following strip.eq | bus.eq methods are available: + +- Load($filepath) : string +- Save($filepath) : string + for example: ```powershell @@ -328,6 +333,23 @@ $vmr.strip[0].eq.on = $true $vmr.bus[0].eq.ab = $false ``` +##### channel.cell + +The following eq.channel.cell commands are available: + +- on: bool +- type: int, from 0 to 6 +- f: float, from 20.0 to 20000.0 +- gain: float, from -12.0 to 12.0 +- q: float, from 0.3 to 100.0 + +for example: + +```powershell +$vmr.strip[2].eq.channel[1].cell[4].type = 1 +$vmr.bus[5].eq.channel[6].cell[3].on = $false +``` + #### FadeTo | FadeBy - `FadeTo(amount, time)` : float, int From 8038fc24ceca80d5d9095ef73842db7c28f471a8 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Thu, 27 Nov 2025 20:21:43 -0500 Subject: [PATCH 5/6] identifier, kindOfEq - move identifier back to BusEq and StripEq for clarity and looser coupling - adjust kindmap so we can get channel count with kindOfEq --- lib/bus.ps1 | 6 +++++- lib/eq.ps1 | 16 ++++++---------- lib/strip.ps1 | 6 +++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/bus.ps1 b/lib/bus.ps1 index 03fe3b1..0ba086d 100644 --- a/lib/bus.ps1 +++ b/lib/bus.ps1 @@ -84,7 +84,11 @@ class BusMode : IRemote { } class BusEq : Eq { - BusEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Bus', $remote.kind.bus_ch) { + BusEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Bus') { + } + + [string] identifier () { + return 'Bus[' + $this.index + '].EQ' } } diff --git a/lib/eq.ps1 b/lib/eq.ps1 index 13b11e5..048ebe3 100644 --- a/lib/eq.ps1 +++ b/lib/eq.ps1 @@ -1,29 +1,25 @@ class Eq : IRemote { [System.Collections.ArrayList]$channel - [string]$prefix + [string]$kindOfEq - Eq ([int]$index, [Object]$remote, [string]$prefix, [int]$chCount) : base ($index, $remote) { - $this.prefix = $prefix + Eq ([int]$index, [Object]$remote, [string]$kindOfEq) : base ($index, $remote) { + $this.kindOfEq = $kindOfEq AddBoolMembers -PARAMS @('on', 'ab') $this.channel = @() - for ($ch = 0; $ch -lt $chCount; $ch++) { + for ($ch = 0; $ch -lt $remote.kind.eq_ch[$this.kindOfEq]; $ch++) { $this.channel.Add([EqChannel]::new($ch, $remote, $this.identifier())) } } - [string] identifier () { - return '{0}[{1}].EQ' -f $this.prefix, $this.index - } - [void] Load ([string]$filename) { - $param = 'Command.Load{0}Eq[{1}]' -f $this.prefix, $this.index + $param = 'Command.Load{0}Eq[{1}]' -f $this.kindOfEq, $this.index $this.remote.Setter($param, $filename) } [void] Save ([string]$filename) { - $param = 'Command.Save{0}Eq[{1}]' -f $this.prefix, $this.index + $param = 'Command.Save{0}Eq[{1}]' -f $this.kindOfEq, $this.index $this.remote.Setter($param, $filename) } } diff --git a/lib/strip.ps1 b/lib/strip.ps1 index b73aecb..87062cc 100644 --- a/lib/strip.ps1 +++ b/lib/strip.ps1 @@ -153,7 +153,11 @@ class StripDenoiser : IRemote { } class StripEq : Eq { - StripEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Strip', $remote.kind.strip_ch) { + StripEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Strip') { + } + + [string] identifier () { + return 'Strip[' + $this.index + '].EQ' } } From 02bc1747461bdbf699ac7a3a09a1b0c02e1be383 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Thu, 27 Nov 2025 20:33:03 -0500 Subject: [PATCH 6/6] forgot to save kinds --- lib/kinds.ps1 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/kinds.ps1 b/lib/kinds.ps1 index 27766e8..cb5e6b7 100644 --- a/lib/kinds.ps1 +++ b/lib/kinds.ps1 @@ -11,8 +11,7 @@ $KindMap = @{ 'insert' = 0 'vban_in' = 4 'vban_out' = 4 - 'strip_ch' = 0 - 'bus_ch' = 0 + 'eq_ch' = @{ 'strip' = 0; 'bus' = 0 } 'cells' = 0 }; 'banana' = @{ @@ -27,8 +26,7 @@ $KindMap = @{ 'insert' = 22 'vban_in' = 8 'vban_out' = 8 - 'strip_ch' = 0 - 'bus_ch' = 8 + 'eq_ch' = @{ 'strip' = 0; 'bus' = 8 } 'cells' = 6 }; 'potato' = @{ @@ -43,8 +41,7 @@ $KindMap = @{ 'insert' = 34 'vban_in' = 8 'vban_out' = 8 - 'strip_ch' = 2 - 'bus_ch' = 8 + 'eq_ch' = @{ 'strip' = 2; 'bus' = 8 } 'cells' = 6 }; }