Compare commits

...

18 Commits

Author SHA1 Message Date
837211424f
Merge pull request #31 from pblivingston/update-docs
Update docs
2025-12-12 09:02:32 +00:00
88901aa6ee
Merge pull request #30 from pblivingston/strip-commands
Strip commands
2025-12-12 08:37:05 +00:00
pblivingston
64ebc86f21 bpsidechain README 2025-12-10 19:54:39 -05:00
pblivingston
8855092438 organize unreleased
organize unreleased changes for readability
2025-12-09 13:20:09 -05:00
pblivingston
865d094450 update bus.levels.convert in CHANGELOG 2025-12-09 05:53:47 -05:00
pblivingston
1cdbf9e272 Update README.md
- more consistent style, organization, terminology
- 'level' -> 'levels'
- examples
- macrobutton index range
2025-12-09 05:51:23 -05:00
pblivingston
23b86fecb9 Update CHANGELOG.md 2025-12-09 05:51:23 -05:00
pblivingston
61b3ecd3d3 Update CHANGELOG.md 2025-12-09 05:49:02 -05:00
pblivingston
a2b75fa21b levels.convert
- hidden, float -> single
2025-12-09 05:47:11 -05:00
pblivingston
618f4a8462 Update README.md
forgot to include pitch examples
2025-12-08 22:40:19 -05:00
pblivingston
a22dccf18f Update README.md 2025-12-08 21:12:36 -05:00
pblivingston
64e6874a75 pan_y, examples
- added tests to demonstrate pan_y, though this is easily seen in the GUI
2025-12-08 15:01:55 -05:00
pblivingston
ac3e36838e gainlayers
gainlayers are now FloatArrayMember objects - this is a breaking change

prelim pester tests for potato pass
2025-12-08 14:49:15 -05:00
pblivingston
a5bade4fbb pitch class
- pitch class added to physical strips

prelim pester tests for potato pass
manual test for potato passes
- recallpreset()
2025-12-07 14:52:20 -05:00
pblivingston
2cf265b3b6 vaio, knobs
- vaio bool on physical strips
- denoiser.threshold
- StripAudibility class with knob float
- knob getters/setters types

prelim pester tests for potato and basic pass
2025-12-07 13:55:42 -05:00
pblivingston
0bdfb1c38f eqgain
- eqgain float members added to virtual strips
- bass/low aliases for eqgain1
- mid/med aliases for eqgain2
- treble/high aliases for eqgain3

prelim pester tests for potato pass
2025-12-07 11:50:48 -05:00
pblivingston
4189ac7721 appgain, appmute
- missing closing parenthesis in AppMute value string
- AppGain, AppMute overloads for index

prelim manual tests for potato pass
2025-12-07 10:41:59 -05:00
pblivingston
6d511d8aa6 limit, alias members
- limit [int] -> [float]
- moved mono bool member to physicalstrip
- added AddAliasMembers meta function
- mono and karaoke aliases added to virtualstrip

prelim pester tests for potato pass
2025-12-07 02:27:29 -05:00
6 changed files with 449 additions and 146 deletions

View File

@ -18,46 +18,75 @@ AddActionMembers now adds ScriptMethods instead of ScriptProperties:
Deprecated Recorder.Loop removed: use Recorder.Mode.Loop Deprecated Recorder.Loop removed: use Recorder.Mode.Loop
Recorder.FileType changed from method to write-only property Recorder.FileType changed from method to write-only property
Strip Gainlayers are now FloatArrayMember objects, see README for details
### Added ### Added
- IRemote base class - IRemote base class
- ArrayMember classes for array-like properties - ArrayMember classes for array-like properties
- Patch class - Patch class
- Option class - Option class
- Device classes - Device class
- EQ class - EQ class
- FX class - FX class
- AddAliasMembers meta function takes a hashtable `-MAP` of `alias = property`
- Vban.port sets Vban.Instream[0].port - Vban.port sets Vban.Instream[0].port
- Vban Midi and Command streams - Vban Midi and Command streams
- on, write-only - on, write-only
- name, write-only - name, write-only
- ip, write-only - ip, write-only
- Bus.Sel, Bus.Monitor, Bus.Vaio
- Bus.Mode.Set($mode)
- Recorder.Armedbus - Recorder.Armedbus
- Recorder.PreRecTime - Recorder.PreRecTime
- Recorder.Prefix - Recorder.Prefix
- Recorder.Eject() references 'Command.Eject' - Recorder.Eject() references 'Command.Eject'
- Recorder.State - Recorder.State
- Command.Reset() - Command.Reset()
- Command.Save($filepath) - Command.Save($filepath)
- Command.StorePreset() - Command.StorePreset()
- Command.RecallPreset() - Command.RecallPreset()
- Bus.Sel, Bus.Monitor, Bus.Vaio
- Bus.Mode.Set($mode)
- Strip.Karaoke alias for Strip.K
- Strip.EQGain1|EQGain2|EQGain3 with bass/low, mid/med, treble/high aliases, respectively
- StripAudibility class with Strip.Audibility.Knob
- Strip.Denoiser.Threshold
- Strip.VAIO
- Strip.Pitch, StripPitch class
- on
- drywet
- pitchvalue
- loformant
- medformant
- hiformant
- recallpreset($presetIndex)
### Changed ### Changed
- Device: explicit $arg types for consistency
- Meta: AddBoolMembers, AddIntMembers $arg types for consistency
- Float getters/setters now default to two decimal places.
- some vban.instream | vban.outstream commands now added with meta functions - some vban.instream | vban.outstream commands now added with meta functions
- on - on
- name - name
- ip - ip
- cast vban getters to types for consistency - cast vban getters to types for consistency
- Bus.Mono -> [int] for stereo reverse
- Bus.Levels.Convert return type [float] -> [single] for naming consistency, no functional change
- Meta: AddBoolMembers, AddIntMembers $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.
- Bus.Levels.Convert hidden and return type [float] -> [single] for naming consistency
- Strip.Mono is now an alias for Strip.MC on virtual strips
- Strip.AppMute|AppGain can now take an app index; see README for details
- Strip Knob setters: explicit $arg types for consistency
- Strip.Levels.Convert hidden and return type [float] -> [single] for naming consistency
### Fixed ### Fixed
@ -68,8 +97,15 @@ Recorder.FileType changed from method to write-only property
- vban.stream.port: [string]$arg -> [int]$arg - vban.stream.port: [string]$arg -> [int]$arg
- vban route range (API documentation is incorrect) - vban route range (API documentation is incorrect)
- vban.stream.sr: $this._port -> $this._sr - vban.stream.sr: $this._port -> $this._sr
- Recorder.channel values: 1..8 -> (2, 4, 6, 8) - Recorder.channel values: 1..8 -> (2, 4, 6, 8)
- Bus.Mono -> [int] for stereo reverse
- Strip.Limit type [int] -> [float]
- Missing closing parenthesis in AppMute value string
- Strip Knob getters: `this.Getter_String('') -> [math]::Round($this.Getter(''), 2)`
## [3.3.0] - 2024-06-29 ## [3.3.0] - 2024-06-29
### Added ### Added

247
README.md
View File

@ -113,16 +113,17 @@ $vmr.Logout()
### Strip ### Strip
The following strip commands are available: The following Strip properties are available:
- mute: bool - mute: bool
- mono: bool - mono: bool
- mc: bool - mc: bool
- k: int, from 0 to 4 - k/karaoke: int, from 0 to 4
- solo: bool - solo: bool
- A1-A5: bool - A1-A5: bool
- B1-B3: bool - B1-B3: bool
- limit: int, from -40 to 12 - vaio: bool
- limit: float, from -40.00 to 12.00
- gain: float, from -60.00 to 12.00 - gain: float, from -60.00 to 12.00
- label: string - label: string
- reverb: float, from 0.00 to 10.00 - reverb: float, from 0.00 to 10.00
@ -130,7 +131,7 @@ The following strip commands are available:
- fx1: float, from 0.00 to 10.00 - fx1: float, from 0.00 to 10.00
- fx2: float, from 0.00 to 10.00 - fx2: float, from 0.00 to 10.00
- pan_x: float, from -0.50 to 0.50 - pan_x: float, from -0.50 to 0.50
- pan_y: float, from 0.00 to 1.00 - pan_y: float, physical: from 0.00 to 1.00, virtual: from -0.50 to 0.50
- color_x: float, from -0.50 to 0.50 - color_x: float, from -0.50 to 0.50
- color_y: float, from 0.00 to 1.00 - color_y: float, from 0.00 to 1.00
- fx_x: float, from -0.50 to 0.50 - fx_x: float, from -0.50 to 0.50
@ -139,23 +140,40 @@ The following strip commands are available:
- postdelay: bool - postdelay: bool
- postfx1: bool - postfx1: bool
- postfx2: bool - postfx2: bool
- gainlayer0-gainlayer7: float - eqgain1/bass/low: float, from -12.00 to 12.00
- eqgain2/mid/med: float, from -12.00 to 12.00
- eqgain3/treble/high: float, from -12.00 to 12.00
for example: for example:
```powershell ```powershell
$vmr.strip[5].gainlayer1 = -8.3 $vmr.strip[6].karaoke = 3
$vmr.strip[0].limit = 4.5
$vmr.strip[2].label = 'example'
$vmr.strip[7].pan_y = -0.38
$vmr.strip[5].treble = -2.43
``` ```
A,B commands depend on Voicemeeter type. The following Strip methods are available:
gainlayers defined for Potato version only. - AppGain($appname or $appindex, $gain) : string or int, float, from 0.00 to 1.00
- AppMute($appname or $appindex, $mutestate) : string or int, bool
for example:
```powershell
$vmr.strip[5].AppGain("Spotify", 0.5)
$vmr.strip[5].AppMute("Spotify", $true)
$vmr.strip[7].AppGain(0, 0.28)
$vmr.strip[6].AppMute(2, $false)
```
A,B properties depend on Voicemeeter type.
mc, k for virtual strips only. mc, k for virtual strips only.
#### comp #### comp
The following strip.comp commands are available: The following Strip.comp properties are available:
- knob: float, from 0.00 to 10.00 - knob: float, from 0.00 to 10.00
- gainin: float, from -24.00 to 24.00 - gainin: float, from -24.00 to 24.00
@ -175,12 +193,12 @@ $vmr.strip[3].comp.attack = 8.5
#### gate #### gate
The following strip.gate commands are available: The following Strip.gate properties are available:
- knob: float, from 0.00 to 10.00 - knob: float, from 0.00 to 10.00
- threshold: float, from -60.00 to -10.00 - threshold: float, from -60.00 to -10.00
- damping: float, from -60.00 to -10.00 - damping: float, from -60.00 to -10.00
- bpsidechain: int, from 100 to 4000 - bpsidechain: float, from 100.00 to 4000.00
- attack: float, from 0.00 to 1000.00 - attack: float, from 0.00 to 1000.00
- hold: float, from 0.00 to 5000.00 - hold: float, from 0.00 to 5000.00
- release: float, from 0.00 to 5000.00 - release: float, from 0.00 to 5000.00
@ -193,9 +211,10 @@ $vmr.strip[3].gate.threshold = -40.5
#### denoiser #### denoiser
The following strip.denoiser commands are available: The following Strip.denoiser properties are available:
- knob: float, from 0.00 to 10.00 - knob: float, from 0.00 to 10.00
- threshold: float, from 0.00 to 10.00
for example: for example:
@ -203,21 +222,57 @@ for example:
$vmr.strip[3].denoiser.knob = 5 $vmr.strip[3].denoiser.knob = 5
``` ```
#### AppGain | AppMute #### pitch
- `AppGain(amount, gain)` : string, float The following Strip.pitch properties are available:
- `AppMute(amount, mutestate)` : string, bool
- on: bool
- drywet: float, from -100.00 to 100.00
- pitchvalue: float, from -12.00 to 12.00
- loformant: float, from -12.00 to 12.00
- medformant: float, from -12.00 to 12.00
- hiformant: float, from -12.00 to 12.00
The following Strip.pitch methods are available:
- RecallPreset($presetIndex) : int, from 0 to 7
for example: for example:
```powershell ```powershell
$vmr.strip[5].AppGain("Spotify", 0.5) $vmr.strip[2].pitch.recallpreset(4)
$vmr.strip[5].AppMute("Spotify", $true) $vmr.strip[4].pitch.drywet = -22.86
$vmr.strip[1].pitch.medformant = 2.1
```
#### audibility
The following Strip.audibility properties are available:
- knob: float, from 0.00 to 10.00
for example:
```powershell
$vmr.strip[1].audibility.knob = 2.66
```
#### gainlayer[i]
The following Strip.gainlayer[i] methods are available:
- Set($val) : float, from -60.00 to 12.00
- Get()
for example:
```powershell
$vmr.strip[4].gainlayer[7].set(-26.81)
``` ```
#### levels #### levels
The following strip.level commands are available: The following Strip.levels methods are available:
- PreFader() - PreFader()
- PostFader() - PostFader()
@ -231,7 +286,7 @@ $vmr.strip[2].levels.PreFader() -Join ', ' | Write-Host
### Bus ### Bus
The following bus commands are available: The following Bus properties are available:
- mute: bool - mute: bool
- sel: bool - sel: bool
@ -253,7 +308,7 @@ $vmr.bus[3].returnreverb = 5.7
#### modes #### modes
The following bus.mode members are available: The following Bus.mode members are available:
- normal: bool - normal: bool
- amix: bool - amix: bool
@ -268,22 +323,21 @@ The following bus.mode members are available:
- lfeonly: bool - lfeonly: bool
- rearonly: bool - rearonly: bool
The following bus.mode commands are available: The following Bus.mode methods are available:
- Set($mode) : string, sets the current bus mode - Set($mode) : string, sets the current bus mode
- Get(): returns the current bus mode. - Get() : returns the current bus mode
for example: for example:
```powershell ```powershell
$vmr.bus[0].mode.centeronly = $true $vmr.bus[0].mode.centeronly = $true
$vmr.bus[0].mode.Set('tvmix')
$vmr.bus[0].mode.Get()
``` ```
#### levels #### levels
The following strip.level commands are available: The following Bus.levels methods are available:
- All() - All()
@ -295,9 +349,23 @@ $vmr.bus[2].levels.All() -Join ', ' | Write-Host
### Strip|Bus ### Strip|Bus
The following Strip | Bus methods are available:
- FadeTo(amount, time) : float, int
- FadeBy(amount, time) : float, int
Modify gain to or by the selected amount in db over a time interval in ms.
for example:
```powershell
$vmr.strip[3].FadeTo(-18.75, 1000)
$vmr.bus[0].FadeBy(-10, 500)
```
#### device #### device
The following strip.device | bus.device commands are available: The following Strip.device | Bus.device properties are available:
- name: string - name: string
- sr: int - sr: int
@ -310,7 +378,7 @@ for example:
```powershell ```powershell
$vmr.strip[0].device.wdm = "Mic|Line|Instrument 1 (Audient EVO4)" $vmr.strip[0].device.wdm = "Mic|Line|Instrument 1 (Audient EVO4)"
$vmr.bus[0].device.name $vmr.bus[0].device.name | Write-Host
``` ```
name, sr are defined as read only. name, sr are defined as read only.
@ -319,12 +387,12 @@ asio only defined for Bus[0].Device
#### eq #### eq
The following strip.eq | bus.eq commands are available: The following Strip.eq | Bus.eq properties are available:
- on: bool - on: bool
- ab: bool - ab: bool
The following strip.eq | bus.eq methods are available: The following Strip.eq | Bus.eq methods are available:
- Load($filepath) : string - Load($filepath) : string
- Save($filepath) : string - Save($filepath) : string
@ -338,7 +406,7 @@ $vmr.bus[0].eq.ab = $false
##### channel.cell ##### channel.cell
The following eq.channel.cell commands are available: The following eq.channel.cell properties are available:
- on: bool - on: bool
- type: int, from 0 to 6 - type: int, from 0 to 6
@ -353,44 +421,39 @@ $vmr.strip[2].eq.channel[1].cell[4].type = 1
$vmr.bus[5].eq.channel[6].cell[3].on = $false $vmr.bus[5].eq.channel[6].cell[3].on = $false
``` ```
#### FadeTo | FadeBy
- `FadeTo(amount, time)` : float, int
- `FadeBy(amount, time)` : float, int
Modify gain to or by the selected amount in db over a time interval in ms.
for example:
```powershell
$vmr.strip[3].FadeTo(-18.7, 1000)
$vmr.bus[0].FadeBy(-10, 500)
```
### Macrobuttons ### Macrobuttons
Three modes defined: state, stateonly and trigger. The following Button properties are available:
- State runs associated scripts - state: bool, runs associated scripts
- Stateonly does not run associated scripts - stateonly: bool, does not run associated scripts
- Index range (0, 69) - trigger: bool
```powershell ```powershell
$vmr.button[3].state = $true $vmr.button[3].state = $true
$vmr.button[4].stateonly = $false $vmr.button[4].stateonly = $false
$vmr.button[5].trigger = $true $vmr.button[5].trigger = $true
``` ```
Index range (0, 79)
### VBAN ### VBAN
The following vban commands are available: The following Vban properties are available:
- enable: bool - enable: bool
- port: int, from 1024 - 65535 - port: int, from 1024 - 65535
For each vban in/out stream the following parameters are defined: for example:
```powershell
$vmr.vban.enable = $true
$vmr.vban.port = 6990
```
#### instream[i]|outstream[i]
The following Vban.instream | Vban.outstream properties are available:
- on: bool - on: bool
- name: string - name: string
@ -401,24 +464,21 @@ For each vban in/out stream the following parameters are defined:
- quality: int, from 0 to 4 - quality: int, from 0 to 4
- route: int, from 0 to 8 - route: int, from 0 to 8
SR, channel and bit are defined as readonly for instreams. Attempting to write for example:
to those parameters will throw an error. They are read and write for outstreams.
example:
```powershell ```powershell
$vmr.vban.enable = $true
$vmr.vban.port = 6990
$vmr.vban.instream[0].on = $true $vmr.vban.instream[0].on = $true
$vmr.vban.outstream[3].bit = 16 $vmr.vban.outstream[3].bit = 16
``` ```
SR, channel and bit are defined as readonly for instreams. Attempting to write
to those parameters will throw an error. They are read and write for outstreams.
### Command ### Command
Certain 'special' commands are defined by the API as performing actions rather than setting values. Certain 'special' commands are defined by the API as performing actions rather than setting values.
The following methods are available: The following Command methods are available:
- Show() - Show()
- Hide() - Hide()
@ -436,7 +496,7 @@ The following methods are available:
- RunMacrobuttons() : Launches the macrobuttons app - RunMacrobuttons() : Launches the macrobuttons app
- CloseMacrobuttons() : Closes the macrobuttons app - CloseMacrobuttons() : Closes the macrobuttons app
example: for example:
```powershell ```powershell
$vmr.command.Show() $vmr.command.Show()
@ -458,7 +518,7 @@ StorePreset('') and RecallPreset('') interact with the 'selected' preset. This i
### Fx ### Fx
The following Fx commands are available: The following Fx properties are available:
- Reverb.on: bool - Reverb.on: bool
- Reverb.ab: bool - Reverb.ab: bool
@ -473,12 +533,12 @@ $vmr.fx.reverb.ab = $false
### Patch ### Patch
The following Patch commands are available: The following Patch properties are available:
- postFaderComposite: bool - postFaderComposite: bool
- postFxInsert: bool - postFxInsert: bool
The following Patch members have .Set($val) and .Get() available: The following Patch members have methods Set($val) | Get() available:
- asio[i]: int, from 0 to ASIO input channels - asio[i]: int, from 0 to ASIO input channels
- OutA2[i]-OutA5[i]: int, from 0 to ASIO output channels - OutA2[i]-OutA5[i]: int, from 0 to ASIO output channels
@ -496,7 +556,7 @@ $vmr.patch.insert[4].get()
### Option ### Option
The following Option commands are available: The following Option properties are available:
- sr: int, (32000, 44100, 48000, 88200, 96000, 176400, 192000) - sr: int, (32000, 44100, 48000, 88200, 96000, 176400, 192000)
- asiosr: bool - asiosr: bool
@ -504,21 +564,15 @@ The following Option commands are available:
- sliderMode: bool - sliderMode: bool
- monitoringBus: int, from 0 to bus index - monitoringBus: int, from 0 to bus index
The following Option.delay[i] methods are available:
- Set($val): float, from 0.00 to 500.00
- Get()
for example: for example:
```powershell ```powershell
$vmr.Option.delay[2].set(30.26) # sets the delay for the third (2) bus
$vmr.Option.sliderMode = $false # sets slider mode to absolute $vmr.Option.sliderMode = $false # sets slider mode to absolute
``` ```
#### buffers #### buffers
The following Option.buffer commands are available: The following Option.buffer properties are available:
- mme: int, (441, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) - mme: int, (441, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048)
- wdm: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024, 1536, 2048) - wdm: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024, 1536, 2048)
@ -532,9 +586,22 @@ $vmr.Option.buffer.wdm = 512
$vmr.Option.buffer.asio = 0 # to use default buffer size $vmr.Option.buffer.asio = 0 # to use default buffer size
``` ```
#### delay[i]
The following Option.delay[i] methods are available:
- Set($val) : float, from 0.00 to 500.00
- Get()
for example:
```powershell
$vmr.Option.delay[2].set(30.26) # sets the delay for the third (2) bus
```
### Recorder ### Recorder
The following commands are available: The following Recorder properties are available:
- A1 - A5: bool - A1 - A5: bool
- B1 - B3: bool - B1 - B3: bool
@ -549,7 +616,15 @@ The following commands are available:
- channel: int, (2, 4, 6, 8) - channel: int, (2, 4, 6, 8)
- kbps: int, (32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320) - kbps: int, (32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320)
The following methods are available: for example:
```powershell
$vmr.recorder.A1 = $true
$vmr.recorder.filetype = 'mp3'
$vmr.recorder.kbps = 256
```
The following Recorder methods are available:
- Play() - Play()
- Stop() - Stop()
@ -562,38 +637,36 @@ The following methods are available:
- Load($filepath) : string - Load($filepath) : string
- GoTo($timestring) : string, must match the format 'hh:mm:ss' - GoTo($timestring) : string, must match the format 'hh:mm:ss'
example: for example:
```powershell ```powershell
$vmr.recorder.play() $vmr.recorder.play()
$vmr.recorder.A1 = $true
$vmr.recorder.GoTo("00:01:15") # go to 1min 15sec into track $vmr.recorder.GoTo("00:01:15") # go to 1min 15sec into track
``` ```
#### Mode #### mode
The following commands are available: The following Recorder.mode properties are available:
- recbus - recbus: bool
- playonload - playonload: bool
- loop - loop: bool
- multitrack - multitrack: bool
example: for example:
```powershell ```powershell
$vmr.recorder.mode.loop = $true $vmr.recorder.mode.loop = $true
``` ```
#### ArmStrip[i]|ArmBus[i] #### armstrip[i]|armbus[i]
The following methods are available: The following Recorder.armstrip | Recorder.armbus methods are available:
- Set($val) : bool - Set($val) : bool
- Get() - Get()
example: for example:
```powershell ```powershell
$vmr.recorder.armstrip[0].Set($true) $vmr.recorder.armstrip[0].Set($true)

View File

@ -12,6 +12,7 @@ $KindMap = @{
'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1 } 'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 0; 'bus' = 0 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 0 }
'cells' = 0 'cells' = 0
'gainlayer' = 0
}; };
'banana' = @{ 'banana' = @{
'name' = 'banana' 'name' = 'banana'
@ -26,6 +27,7 @@ $KindMap = @{
'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 } 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 0; 'bus' = 8 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 8 }
'cells' = 6 'cells' = 6
'gainlayer' = 0
}; };
'potato' = @{ 'potato' = @{
'name' = 'potato' 'name' = 'potato'
@ -40,6 +42,7 @@ $KindMap = @{
'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 } 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 2; 'bus' = 8 } 'eq_ch' = @{ 'strip' = 2; 'bus' = 8 }
'cells' = 6 'cells' = 6
'gainlayer' = 8
}; };
} }

View File

@ -74,6 +74,16 @@ function AddActionMembers () {
} }
} }
function AddAliasMembers () {
param(
[hashtable]$MAP
)
foreach ($alias in $MAP.Keys) {
$this | Add-Member -MemberType AliasProperty -Name $alias `
-Value $MAP[$alias] -Force
}
}
function AddChannelMembers () { function AddChannelMembers () {
$num_A = $this.remote.kind.p_out $num_A = $this.remote.kind.p_out
$num_B = $this.remote.kind.v_out $num_B = $this.remote.kind.v_out
@ -86,21 +96,6 @@ function AddChannelMembers () {
AddBoolMembers -PARAMS $channels AddBoolMembers -PARAMS $channels
} }
function AddGainlayerMembers () {
[hashtable]$Signatures = @{}
0..7 | ForEach-Object {
# Define getter
$Signatures['Getter'] = "`$this.Getter('gainlayer[{0}]')" -f $_
# Define setter
$Signatures['Setter'] = "param ( [Single]`$arg )`n`$this.Setter('gainlayer[{0}]', `$arg)" `
-f $_
$param = 'gainlayer{0}' -f $_
$null = $param
Addmember
}
}
function Addmember { function Addmember {
$AddMemberParams = @{ $AddMemberParams = @{
Name = $param Name = $param

View File

@ -1,16 +1,20 @@
class Strip : IRemote { class Strip : IRemote {
[System.Collections.ArrayList]$gainlayer
[Object]$levels [Object]$levels
Strip ([int]$index, [Object]$remote) : base ($index, $remote) { Strip ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('mono', 'solo', 'mute') AddBoolMembers -PARAMS @('solo', 'mute')
AddIntMembers -PARAMS @('limit') AddFloatMembers -PARAMS @('gain', 'limit', 'pan_x', 'pan_y')
AddFloatMembers -PARAMS @('gain', 'pan_x', 'pan_y')
AddStringMembers -PARAMS @('label') AddStringMembers -PARAMS @('label')
AddChannelMembers AddChannelMembers
AddGainlayerMembers
$this.levels = [StripLevels]::new($index, $remote) $this.levels = [StripLevels]::new($index, $remote)
$this.gainlayer = @()
for ($i = 0; $i -lt $remote.kind.gainlayer; $i++) {
$this.gainlayer.Add([FloatArrayMember]::new($i, 'gainlayer', $this))
}
} }
[string] identifier () { [string] identifier () {
@ -42,7 +46,7 @@ class StripLevels : IRemote {
} }
} }
[float] Convert([float]$val) { hidden [single] Convert([single]$val) {
if ($val -gt 0) { if ($val -gt 0) {
return [math]::Round(20 * [math]::Log10($val), 1) return [math]::Round(20 * [math]::Log10($val), 1)
} }
@ -78,15 +82,20 @@ class PhysicalStrip : Strip {
[Object]$denoiser [Object]$denoiser
[Object]$eq [Object]$eq
[Object]$device [Object]$device
[Object]$audibility
[Object]$pitch
PhysicalStrip ([int]$index, [Object]$remote) : base ($index, $remote) { PhysicalStrip ([int]$index, [Object]$remote) : base ($index, $remote) {
AddFloatMembers -PARAMS @('color_x', 'color_y', 'fx_x', 'fx_y') AddFloatMembers -PARAMS @('color_x', 'color_y', 'fx_x', 'fx_y')
AddFloatMembers -PARAMS @('reverb', 'delay', 'fx1', 'fx2') AddFloatMembers -PARAMS @('reverb', 'delay', 'fx1', 'fx2')
AddBoolMembers -PARAMS @('postreverb', 'postdelay', 'postfx1', 'postfx2') AddBoolMembers -PARAMS @('postreverb', 'postdelay', 'postfx1', 'postfx2')
AddBoolMembers -PARAMS @('mono', 'vaio')
$this.comp = [StripComp]::new($index, $remote) $this.comp = [StripComp]::new($index, $remote)
$this.gate = [StripGate]::new($index, $remote) $this.gate = [StripGate]::new($index, $remote)
$this.denoiser = [StripDenoiser]::new($index, $remote) $this.denoiser = [StripDenoiser]::new($index, $remote)
$this.pitch = [StripPitch]::new($index, $remote)
$this.audibility = [StripAudibility]::new($index, $remote)
$this.eq = [StripEq]::new($index, $remote) $this.eq = [StripEq]::new($index, $remote)
$this.device = [StripDevice]::new($index, $remote) $this.device = [StripDevice]::new($index, $remote)
} }
@ -104,10 +113,10 @@ class StripComp : IRemote {
hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` hidden $_knob = $($this | Add-Member ScriptProperty 'knob' `
{ {
$this.Getter_String('') [math]::Round($this.Getter(''), 2)
} ` } `
{ {
param($arg) param([single]$arg)
return $this.Setter('', $arg) return $this.Setter('', $arg)
} }
) )
@ -124,10 +133,10 @@ class StripGate : IRemote {
hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` hidden $_knob = $($this | Add-Member ScriptProperty 'knob' `
{ {
$this.Getter_String('') [math]::Round($this.Getter(''), 2)
} ` } `
{ {
param($arg) param([single]$arg)
return $this.Setter('', $arg) return $this.Setter('', $arg)
} }
) )
@ -135,6 +144,7 @@ class StripGate : IRemote {
class StripDenoiser : IRemote { class StripDenoiser : IRemote {
StripDenoiser ([int]$index, [Object]$remote) : base ($index, $remote) { StripDenoiser ([int]$index, [Object]$remote) : base ($index, $remote) {
AddFloatMembers -PARAMS @('threshold')
} }
[string] identifier () { [string] identifier () {
@ -143,10 +153,44 @@ class StripDenoiser : IRemote {
hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` hidden $_knob = $($this | Add-Member ScriptProperty 'knob' `
{ {
$this.Getter_String('') [math]::Round($this.Getter(''), 2)
} ` } `
{ {
param($arg) param([single]$arg)
return $this.Setter('', $arg)
}
)
}
class StripPitch : IRemote {
StripPitch ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('on')
AddFloatMembers -PARAMS @('drywet', 'pitchvalue', 'loformant', 'medformant', 'hiformant')
}
[string] identifier () {
return 'Strip[' + $this.index + '].Pitch'
}
[void] RecallPreset ([int]$presetIndex) {
$this.Setter('RecallPreset', $presetIndex)
}
}
class StripAudibility : IRemote {
StripAudibility ([int]$index, [Object]$remote) : base ($index, $remote) {
}
[string] identifier () {
return 'Strip[' + $this.index + '].Audibility'
}
hidden $_knob = $($this | Add-Member ScriptProperty 'knob' `
{
[math]::Round($this.Getter(''), 2)
} `
{
param([single]$arg)
return $this.Setter('', $arg) return $this.Setter('', $arg)
} }
) )
@ -174,14 +218,34 @@ class VirtualStrip : Strip {
VirtualStrip ([int]$index, [Object]$remote) : base ($index, $remote) { VirtualStrip ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('mc') AddBoolMembers -PARAMS @('mc')
AddIntMembers -PARAMS @('k') AddIntMembers -PARAMS @('k')
AddFloatMembers -PARAMS @('eqgain1', 'eqgain2', 'eqgain3')
AddAliasMembers -MAP @{
mono = 'mc'
karaoke = 'k'
bass = 'eqgain1'
low = 'eqgain1'
mid = 'eqgain2'
med = 'eqgain2'
treble = 'eqgain3'
high = 'eqgain3'
}
} }
[void] AppGain ([string]$appname, [single]$gain) { [void] AppGain ([string]$appname, [single]$gain) {
$this.Setter('AppGain', "(`"$appname`", $gain)") $this.Setter('AppGain', "(`"$appname`", $gain)")
} }
[void] AppGain ([int]$appindex, [single]$gain) {
$this.Setter("App[$appindex].Gain", $gain)
}
[void] AppMute ([string]$appname, [bool]$mutestate) { [void] AppMute ([string]$appname, [bool]$mutestate) {
$this.Setter('AppMute', "(`"$appname`", $(if ($mutestate) { 1 } else { 0 })") $this.Setter('AppMute', "(`"$appname`", $(if ($mutestate) { 1 } else { 0 }))")
}
[void] AppMute ([int]$appindex, [bool]$mutestate) {
$this.Setter("App[$appindex].Mute", $mutestate)
} }
} }

View File

@ -30,6 +30,23 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Context 'Strip, physical only' -ForEach @( Context 'Strip, physical only' -ForEach @(
@{ Index = $phys_in } @{ Index = $phys_in }
) { ) {
It "Should set Strip[$index].Mono" {
$vmr.strip[$index].mono = $value
$vmr.strip[$index].mono | Should -Be $expected
}
It "Should set Strip[$index].VAIO" {
$vmr.strip[$index].vaio = $value
$vmr.strip[$index].vaio | Should -Be $expected
}
Context 'Pitch' -Skip:$ifNotPotato {
It "Should set Strip[$index].Pitch.On" {
$vmr.strip[$index].pitch.on = $value
$vmr.strip[$index].pitch.on | Should -Be $expected
}
}
Context 'Eq' -Skip:$ifNotPotato -ForEach @( Context 'Eq' -Skip:$ifNotPotato -ForEach @(
@{ Eq = $vmr.strip[$index].eq } @{ Eq = $vmr.strip[$index].eq }
) { ) {
@ -50,6 +67,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Strip, first virtual' -ForEach @(
@{ Index = $phys_in + 1 }
) {
It "Should set Strip[$index].MC via alias 'Mono'" {
$vmr.strip[$index].mono = $value
$vmr.strip[$index].mc | Should -Be $expected
}
}
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 }
) { ) {
@ -246,7 +272,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Describe 'Float Tests' -Tag 'float' -ForEach @( Describe 'Float Tests' -Tag 'float' -ForEach @(
@{ Gain = -24.63; Knob = 5.27; Slide = -7.51; Xy10 = 0.83; Xy05 = -0.42; MsHz = 196.57 } @{ 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 } @{ Gain = -12.48; Knob = 8.91; Slide = 3.14; Xy10 = 0.27; Xy05 = 0.29; 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 }
@ -255,11 +281,30 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.strip[$index].gain = $gain $vmr.strip[$index].gain = $gain
$vmr.strip[$index].gain | Should -Be $gain $vmr.strip[$index].gain | Should -Be $gain
} }
It "Should set Strip[$index].Limit" -Skip:$ifBasic {
$vmr.strip[$index].limit = $gain
$vmr.strip[$index].limit | Should -Be $gain
}
Context 'Gainlayers' -Skip:$ifNotPotato -ForEach @(
@{ Layer = $phys_out }, @{ Layer = $virt_out }
) {
It "Should set Strip[$index].Gainlayer[$layer]" {
$vmr.strip[$index].gainlayer[$layer].set($gain)
$vmr.strip[$index].gainlayer[$layer].get() | Should -Be $gain
}
}
} }
Context 'Strip, physical only' -ForEach @( Context 'Strip, physical only' -ForEach @(
@{ Index = $phys_in } @{ Index = $phys_in }
) { ) {
It "Should set Strip[$index].Pan_Y" {
$vmr.strip[$index].pan_y = $xy10
$vmr.strip[$index].pan_y | Should -Be $xy10
}
Context 'Comp, Gate' -Skip:$ifBasic { Context 'Comp, Gate' -Skip:$ifBasic {
It "Should set Strip[$index].Comp" { It "Should set Strip[$index].Comp" {
$vmr.strip[$index].comp.knob = $knob $vmr.strip[$index].comp.knob = $knob
@ -301,6 +346,45 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.strip[$index].denoiser.knob = $knob $vmr.strip[$index].denoiser.knob = $knob
$vmr.strip[$index].denoiser.knob | Should -Be $knob $vmr.strip[$index].denoiser.knob | Should -Be $knob
} }
It "Should set Strip[$index].Denoiser.Threshold" {
$vmr.strip[$index].denoiser.threshold = $knob
$vmr.strip[$index].denoiser.threshold | Should -Be $knob
}
}
Context 'Pitch' -Skip:$ifNotPotato {
It "Should set Strip[$index].Pitch.drywet" {
$vmr.strip[$index].pitch.drywet = $slide
$vmr.strip[$index].pitch.drywet | Should -Be $slide
}
It "Should set Strip[$index].Pitch.pitchvalue" {
$vmr.strip[$index].pitch.pitchvalue = $slide
$vmr.strip[$index].pitch.pitchvalue | Should -Be $slide
}
It "Should set Strip[$index].Pitch.loformant" {
$vmr.strip[$index].pitch.loformant = $slide
$vmr.strip[$index].pitch.loformant | Should -Be $slide
}
It "Should set Strip[$index].Pitch.medformant" {
$vmr.strip[$index].pitch.medformant = $slide
$vmr.strip[$index].pitch.medformant | Should -Be $slide
}
It "Should set Strip[$index].Pitch.hiformant" {
$vmr.strip[$index].pitch.hiformant = $slide
$vmr.strip[$index].pitch.hiformant | Should -Be $slide
}
}
Context 'Audibility' -Skip:$ifNotBasic {
It "Should set Strip[$index].Audibility" {
$vmr.strip[$index].audibility.knob = $knob
$vmr.strip[$index].audibility.knob | Should -Be $knob
}
} }
Context 'EQ' -Skip:$ifNotPotato -ForEach @( Context 'EQ' -Skip:$ifNotPotato -ForEach @(
@ -323,6 +407,53 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Strip, virtual only' -ForEach @(
@{ Index = $virt_in }
) {
It "Should set Strip[$index].Pan_Y" {
$vmr.strip[$index].pan_y = $xy05
$vmr.strip[$index].pan_y | Should -Be $xy05
}
Context 'EQ' {
BeforeEach {
$vmr.strip[$index].eqgain1 = 0
$vmr.strip[$index].eqgain2 = 0
$vmr.strip[$index].eqgain3 = 0
}
It "Should set Strip[$index].EQGain1 via alias 'bass'" {
$vmr.strip[$index].bass = $slide
$vmr.strip[$index].eqgain1 | Should -Be $slide
}
It "Should set Strip[$index].EQGain1 via alias 'low'" {
$vmr.strip[$index].low = $slide
$vmr.strip[$index].eqgain1 | Should -Be $slide
}
It "Should set Strip[$index].EQGain2 via alias 'mid'" {
$vmr.strip[$index].mid = $slide
$vmr.strip[$index].eqgain2 | Should -Be $slide
}
It "Should set Strip[$index].EQGain2 via alias 'med'" {
$vmr.strip[$index].med = $slide
$vmr.strip[$index].eqgain2 | Should -Be $slide
}
It "Should set Strip[$index].EQGain3 via alias 'treble'" {
$vmr.strip[$index].treble = $slide
$vmr.strip[$index].eqgain3 | Should -Be $slide
}
It "Should set Strip[$index].EQGain3 via alias 'high'" {
$vmr.strip[$index].high = $slide
$vmr.strip[$index].eqgain3 | Should -Be $slide
}
}
}
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 }
) { ) {
@ -362,18 +493,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
Describe 'Int Tests' -Tag 'int' { Describe 'Int Tests' -Tag 'int' {
Context 'Strip, one physical, one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in }
) {
It "Should set and get Strip[$index].Limit" -Skip:$ifBasic -ForEach @(
@{ Value = 3; Expected = 3 }
@{ Value = -6; Expected = -6 }
) {
$vmr.strip[$index].limit = $value
$vmr.strip[$index].limit | Should -Be $expected
}
}
Context 'Strip, physical only' -ForEach @( Context 'Strip, physical only' -ForEach @(
@{ Index = $phys_in } @{ Index = $phys_in }
) { ) {
@ -395,6 +514,19 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Strip, second virtual' -Skip:$ifBasic -ForEach @(
@{ Index = $phys_in + 2 }
) {
It "Should set Strip[$index].K via alias 'Karaoke'" -ForEach @(
@{ Value = 0; Expected = 0 }
@{ Value = 2; Expected = 2 }
@{ Value = 4; Expected = 4 }
) {
$vmr.strip[$index].karaoke = $value
$vmr.strip[$index].k | Should -Be $expected
}
}
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 }
) { ) {