Page 2 of 2
Re: Importing raw data - or from text list
Posted: Wed Jun 01, 2016 8:52 pm
by steve
Sprinterdriver wrote: the largest values is like -300 and +480 - and I doubt that those data are accepded for sample input.
Audacity is using 32-bit float format. +480 to -300 is 'only' about +50 dB, which 32-bit float format can handle with ease.
Re: Importing raw data - or from text list
Posted: Thu Jun 02, 2016 11:28 pm
by Sprinterdriver
Here is a Autohotkey script that add a Open file dialog box to the Sample Data Import (SDI for short) dialog box:
Here is how the script must be used:
- Must run at the same time as Audacity.
- User would have to open the SDI by pressing Alt+N while main window is active.
- When SDI dialog box is active, user may press Ctrl+O to browse for a file. The file path will be inserted into the text field.
Things that may not work
- May not activate correct menu item after pressing Alt+N if SDI is not the last item on list, or if language* of Audacity interface is not english.
- Inside SDI dialog box, the buttons must NOT be activated (e.g. using tab inside) before Ctrl+O is pressed. Cursor MUST be placed in text input field.
- If SDI dialog box is opened manually (using mouse) - the tooltip will not appear. The Ctrl+O will however still function.
- Any future updates of SDI may change window title, or what control inside SDI gui that is active by default, may cause the script to not function properly.
* If the menus in Audacity is in different languages than english, there may be wrong menu opened, because the script sends the keystrokes Alt+G to open the dialog box.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Posted by Sprinterdriver on Audacityforum - 02.06.2016.
; http://forum.audacityteam.org/viewtopic.php?f=46&t=91581
#Singleinstance Force
#persistent
IfWinExist, Sample Data Import...
SetTimer, sampleDataImport_timer, 50
; Audacity main window
#IfWinActive, ahk_class wxWindowClassNR
; Alt+N --> Open "Generate / Sample data import"
; Important note - It need to be at bottom of the list in order to be able to select.
!n::
KeyWait, n
KeyWait, Alt
Send {Alt down}g
Send {Alt up}
Send {Up}{Enter} ; If the "Sample data import" is second last item, change to {up 2} - and so on.
SetTimer, sampleDataImport_timer, 50
Return
; Keep tooltip in place and close whenever the window close or loose focus.
sampleDataImport_timer:
IfWinActive, Sample Data Import...
ToolTip, Press Ctrl+O to browse the file to open, 105, 60
Else {
ToolTip
IfWinNotExist, Sample Data Import...
SetTimer, sampleDataImport_timer, Off
}
Return
#IfWinActive, Sample Data Import...
; Ctrl+O
; User still need to manually click OK to actually start the process..
^o::
FileSelectFile, filePath, 1, %A_MyDocuments%, Open a list of samples file, Plain text files (*.txt; *.csv)
If errorlevel ; Canceled by user
Return
SendInput, %filePath%
Return
Re: Importing raw data - or from text list
Posted: Fri Jun 03, 2016 12:34 am
by steve
Thanks Sprinterdriver. As I wrote earlier, I can't try it myself as I'm not on Windows, but it may well be useful for others.
If you're interested in 'signal processing' in any form, you should have a look at
Nyquist. I think you'd enjoy it

If you'd like a chat about Nyquist scripts and what they can do, drop in a post on the Nyquist part of the board (
http://forum.audacityteam.org/viewforum.php?f=39) and I'd be happy to chat with you about it.
Are you happy with the outcome of this forum thread? If so I'll close it.
Steve
Re: Importing raw data - or from text list
Posted: Fri Jun 03, 2016 1:59 pm
by Gale Andrews
What version of Windows are you on and which version of Sample Data Import are you using?
On Windows 10 using
http://forum.audacityteam.org/download/file.php?id=7264 (space added at the end of line 13) and latest AutoHotKey, ALT + N and CTRL + O do nothing. Yes, the script is running and other AHK scripts work.
Gale
Sprinterdriver wrote:Here is a Autohotkey script that add a Open file dialog box to the Sample Data Import (SDI for short) dialog box:
Here is how the script must be used:
- Must run at the same time as Audacity.
- User would have to open the SDI by pressing Alt+N while main window is active.
- When SDI dialog box is active, user may press Ctrl+O to browse for a file. The file path will be inserted into the text field.
Things that may not work
- May not activate correct menu item after pressing Alt+N if SDI is not the last item on list, or if language* of Audacity interface is not english.
- Inside SDI dialog box, the buttons must NOT be activated (e.g. using tab inside) before Ctrl+O is pressed. Cursor MUST be placed in text input field.
- If SDI dialog box is opened manually (using mouse) - the tooltip will not appear. The Ctrl+O will however still function.
- Any future updates of SDI may change window title, or what control inside SDI gui that is active by default, may cause the script to not function properly.
* If the menus in Audacity is in different languages than english, there may be wrong menu opened, because the script sends the keystrokes Alt+G to open the dialog box.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Posted by Sprinterdriver on Audacityforum - 02.06.2016.
; http://forum.audacityteam.org/viewtopic.php?f=46&t=91581
#Singleinstance Force
#persistent
IfWinExist, Sample Data Import...
SetTimer, sampleDataImport_timer, 50
; Audacity main window
#IfWinActive, ahk_class wxWindowClassNR
; Alt+N --> Open "Generate / Sample data import"
; Important note - It need to be at bottom of the list in order to be able to select.
!n::
KeyWait, n
KeyWait, Alt
Send {Alt down}g
Send {Alt up}
Send {Up}{Enter} ; If the "Sample data import" is second last item, change to {up 2} - and so on.
SetTimer, sampleDataImport_timer, 50
Return
; Keep tooltip in place and close whenever the window close or loose focus.
sampleDataImport_timer:
IfWinActive, Sample Data Import...
ToolTip, Press Ctrl+O to browse the file to open, 105, 60
Else {
ToolTip
IfWinNotExist, Sample Data Import...
SetTimer, sampleDataImport_timer, Off
}
Return
#IfWinActive, Sample Data Import...
; Ctrl+O
; User still need to manually click OK to actually start the process..
^o::
FileSelectFile, filePath, 1, %A_MyDocuments%, Open a list of samples file, Plain text files (*.txt; *.csv)
If errorlevel ; Canceled by user
Return
SendInput, %filePath%
Return
Re: Importing raw data - or from text list
Posted: Fri Jun 03, 2016 3:27 pm
by Gale Andrews
Gale Andrews wrote:What version of Windows are you on and which version of Sample Data Import are you using?
On Windows 10 using
http://forum.audacityteam.org/download/file.php?id=7264 (space added at the end of line 13) and latest AutoHotKey, ALT + N and CTRL + O do nothing. Yes, the script is running and other AHK scripts work.
OK, so following a PM from Sprinterdriver (who is on Windows XP) I had to open WIndow Spy from the running script's context menu to see what AHK expects for the window title. Accordingly I changed the line in the script after "; Audacity main window" to
Code: Select all
#IfWinActive, ahk_exe audacity.exe
And I had to change all the instances of the plugin's window title to
without the "..." because current Audacity removes the ellipsis given in the ;name line in the plugin from the plugin's dialogue window. Some older versions of Audacity did not do that.
Thanks for the script.
Gale
Re: [SOLVED] Importing raw data - or from text list
Posted: Fri Jun 03, 2016 3:51 pm
by Gale Andrews
Also another consideration on Windows 8/8.1 and 10 at least is that if Audacity is running with Administrative privileges the AHK script must be run with Administrative privileges too, or it will appear to do nothing.
Gale
Re: [SOLVED] Importing raw data - or from text list
Posted: Thu Jun 09, 2016 11:10 pm
by Sprinterdriver
UPDATE - I've figured out a method for supressing growth of integral of samples over time in Libre Office Calc. The method is simply to substract the average of a range* before and after each integrated samples.
* For this specific collection of sample data, I choose a range of 200 samples before and 200 samples prior - and less when closing in to start and end of data serie.
The .ods file is too big to upload, a brief description of the formula I used:
Data serie (integral) is in coloumn E. So in Cell F10000, the formula would be (range of average in this formula is +-50):
Resulting sound
Pretty interesting - I noticed that the auditible sound from the integrated data series is almost the same as for the original data serie, exepf it sounds like a high pass filter is applied - due to the formula used to suppress growing of samples, having similar effect on the sound as a high pass filter.