From 42e0cd9c916eef657acde9e55f50ea2a2a0f80d2 Mon Sep 17 00:00:00 2001 From: Willner Date: Tue, 21 Mar 2023 08:26:53 +0100 Subject: [PATCH] [bugfixed] problem with multiple x7 devices --- .../droid-lang/buildscript/scripts/build_win.ps1 | 12 ++++++------ .../droid-lang/buildscript/scripts/build_win.ps1 | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/language-extensions/sublime/droid-lang/buildscript/scripts/build_win.ps1 b/language-extensions/sublime/droid-lang/buildscript/scripts/build_win.ps1 index 0109cb5..78b212c 100644 --- a/language-extensions/sublime/droid-lang/buildscript/scripts/build_win.ps1 +++ b/language-extensions/sublime/droid-lang/buildscript/scripts/build_win.ps1 @@ -36,6 +36,12 @@ If($containsWord -contains $true) { $fileSysexHead= Get-Content "$PSScriptRoot/../sendmidi/win/sysexhead.txt" $fileSysexTail= Get-Content "$PSScriptRoot/../sendmidi/win/sysextail.txt" + + # parse content for the x7 device name + $x7deviceToken = "(?<=(# X7 send `")).*(?=`")" + $x7device = select-string $x7deviceToken -inputobject $droidcontent + if ([string]::IsNullOrWhiteSpace($x7device)) {$x7device = "x7" } + else { $x7device = $x7device.Matches.groups[0].value } # remove tabs, spaces & comments $droidcontent = $droidcontent -replace '(^\s+|\s+$)','' -replace '\t+','' -replace '(#)(.*)','' -replace '\s+\r\n+', "`r`n" @@ -43,12 +49,6 @@ If($containsWord -contains $true) # write temporary file $fileSysexTmp= "$PSScriptRoot/../sendmidi/tmp.syx" Set-Content $fileSysexTmp "$fileSysexHead $droidcontent $fileSysexTail" - - # parse content for the x7 device name - $x7deviceToken = "(?<=(# X7 send `")).*(?=`")" - $x7device = select-string $x7deviceToken -inputobject $droidcontent - if ([string]::IsNullOrWhiteSpace($x7device)) {$x7device = "x7" } - else { $x7device = $x7device.Matches.groups[0].value } # send the content of the temporary file Write-Host -ForegroundColor Yellow "Sending data via sysex to device" $x7device diff --git a/language-extensions/vscode/droid-lang/buildscript/scripts/build_win.ps1 b/language-extensions/vscode/droid-lang/buildscript/scripts/build_win.ps1 index 0109cb5..78b212c 100644 --- a/language-extensions/vscode/droid-lang/buildscript/scripts/build_win.ps1 +++ b/language-extensions/vscode/droid-lang/buildscript/scripts/build_win.ps1 @@ -36,6 +36,12 @@ If($containsWord -contains $true) { $fileSysexHead= Get-Content "$PSScriptRoot/../sendmidi/win/sysexhead.txt" $fileSysexTail= Get-Content "$PSScriptRoot/../sendmidi/win/sysextail.txt" + + # parse content for the x7 device name + $x7deviceToken = "(?<=(# X7 send `")).*(?=`")" + $x7device = select-string $x7deviceToken -inputobject $droidcontent + if ([string]::IsNullOrWhiteSpace($x7device)) {$x7device = "x7" } + else { $x7device = $x7device.Matches.groups[0].value } # remove tabs, spaces & comments $droidcontent = $droidcontent -replace '(^\s+|\s+$)','' -replace '\t+','' -replace '(#)(.*)','' -replace '\s+\r\n+', "`r`n" @@ -43,12 +49,6 @@ If($containsWord -contains $true) # write temporary file $fileSysexTmp= "$PSScriptRoot/../sendmidi/tmp.syx" Set-Content $fileSysexTmp "$fileSysexHead $droidcontent $fileSysexTail" - - # parse content for the x7 device name - $x7deviceToken = "(?<=(# X7 send `")).*(?=`")" - $x7device = select-string $x7deviceToken -inputobject $droidcontent - if ([string]::IsNullOrWhiteSpace($x7device)) {$x7device = "x7" } - else { $x7device = $x7device.Matches.groups[0].value } # send the content of the temporary file Write-Host -ForegroundColor Yellow "Sending data via sysex to device" $x7device