mlml / autovot

Trainable algorithm for automatic measurement of voice onset time
GNU Lesser General Public License v3.0
62 stars 20 forks source link

plugin fixes #66

Closed thealk closed 10 years ago

thealk commented 10 years ago

Starting a separate issue for problems related to the praat plugin. See the end of issue #58 (summary of what the issue is now below:)

To install the plugin on mac, you must 1) rename the folder "praat_plugin" to "pluginpraat", 2) move setup.praat into this folder and 3) copy the to Library/Preferences/Praat Prefs/. Praat will only execute setup files in Praat Prefs within directories that start with "plugin".

You then must (for now) go into setup.praat and change the action command to include the original path of autovot.praat.

The current problem is that although the AutoVOT button successfully appears when you have a sound&TextGrid selected and allows you to open the window to specify your parameters, the system command on line 125 in autovot.praat is not being executed: screen shot 2014-09-28 at 12 11 57 pm

thealk commented 10 years ago

It DOES run with system_nocheck but I'm not sure yet if it executes properly. Stand by.

thealk commented 10 years ago

It now runs but doesn't modify the TextGrid, presumably because of this (which gets printed to the praatinfo window):

Output: 13:09:39.320 [auto_vot_decode.py] INFO: Input arguments consist of a single WAV and a single TextGrid. /bin/sh: VotFrontEnd2: command not found

thealk commented 10 years ago

Okay now it's going. I mistakenly was assuming this eliminated all user interaction with the command line, so hadn't run make clean yet.

So, looks good. Outstanding issues: 1) We have to figure out a solution for opening autovot.praat (we could just tell the user to edit setup.praat but I think @msonderegger's right... that's not a good long term solution). 2) praat_plugin needs to be renamed plugin_praat and contain the setup.praat file. Can I do this now or will this interfere with anything? 3) Do we want a praat interface for training too?

Functionality-wise it's great. It would be ideal, I think, to allow users to just indicate a directory containing the wav/TextGrid(s) rather than making them open the files in Praat first, though I don't think that's a necessary change.

jkeshet commented 10 years ago

I just figured out that you did not use the installer. The name change is done automatically when building the installer. Please go to the releases https://github.com/mlml/autovot/releases and download osx_praat_plugin_0.93.dmg Open it and follow instructions. Maybe remove your installation first.

thealk commented 10 years ago

Oh great! That works and is much simpler. The modified TextGrid did not get saved though, as it should with auto_vot_decode.py. When I ran auto_vot_decode.py without the plugin from the command line it successfully overwrote the old TGs. Any idea why that wouldn't happen with the praat plugin, since it's executing the same script?

thealk commented 10 years ago

Is there any way to iterate over several files with the plugin? It looks like you only have the option of doing one at a time (which is fine for smaller files, we'll just have to include a larger example for the tutorial, which is on the to-do list anyway). I updated the readme to include information about the plugin. I think now would be a good time to get the wiki up and running, so I'll work on that next.

msonderegger commented 10 years ago

So, it sounds like modulo the modified TextGrid getting saved, the installer does work? It does seem like being able to execute the script on a whole directory would be good. Or Yossi, was your thinking that that would be something the user would take care of with a Praat script? (Like any other Praat command you can do for one file at a time, like generating a pitch track.)

Getting the wiki going sounds great!

Thanks, both. Let me know if there's anything I can do..

jkeshet commented 10 years ago

Here are my comments. Please @thealk and @msonderegger please read them and see what you think. 1) Currently there is installer for Mac but I am not happy with it. The user have to enter the full path of praat plugin directory. Alternatively a new installer will do everything automatically, and will check there is Python and Praat Installed. 2) "The modified TextGrid did not get saved " --> the TextGrid is not designed to be saved! According to Praat design, after a processing tool is used, a new object is created. Nothing is supposed to be saved. If the user would like to save it - it is a different operation. 3) There will be no training in Praat. The Praat graphical interface will not support this issue. The user can train the classifier at the command line, and use the new trained model within the Praat plugin (there is an option for that) 4) "execute the script on a whole directory" --> again, this is not the way Praat works. If you would like to execute it on a whole directory you should write a script for that. It is the same as if you wish to extract Formants or Pitch on a whole directory. (and within this script you will also save the resulted TextGrid to some place).

thealk commented 10 years ago

1) After I used the installer I didn't have to enter the path - that was an issue before I realized there was a full installer. Or do you mean the instructions telling the user to click shift+cmd+g to get to the Praat Prefs folder? I agree, it would be simpler for the installer to do this automatically, though apart from this it works well. 2) I thought that since auto_vot_decode.py saves the new TextGrid output this wouldn't be affected by Praat. However, since it is an issue, we could instead add a line in autovot.praat to save the final TextGrid output with a new name (and could prompt the user to decide where they should go). 3) Training from the command line good to me. 4) Execute on a whole directory: This could either be added to autovot.praat (which could simultaneously allow users to enter the directory containing their data rather than opening the data in Praat first) or we could include a short script that allows this option. We could also leave that to the user, and include a note about it in the readme.

I can work on editing the praat scripts this weekend* if we decide those are changes we want. (* p.s. Yossi just so you are aware - from now on I will mostly be unavailable during weekdays because I've started a new program of study)

msonderegger commented 10 years ago

1) It sounds like if it's just the step Thea describes (shift+cmd+g) to get the Praat Prefs folder and the user has to do it once (ever), that's fine. But if you (Yossi) can get it to work without that, and check that Python and Praat are installed, that sounds great as well!

2) I think I see Yossi's point, which is that in Praat usually (always?) what commands do (besides Save menu commands) is create, manipulate, etc. new objects in Praat, so strictly speaking the plugin by itself shouldn't do more than that. (The "new textgrid" is presuambly being saved in a temporary directory somewhere.) This will mean that using the plugin does something different (because no textgrid is saved) from executing auto_vot_decode.py , which could be confusing to users who are using both the command-line tool and the Praat plugin... but if I understand right (Yossi?), this plugin is meant for users who won't be interacting with the command line at all (unless they need to train a new classifier).

3) Sounds good. I think technically this could be done from within Praat, but we can leave that for a future version, if ever. Shall we create an "enhancement" for this? (To stick with Praat's conventions on how plugins work, we'd need a way to represent a classifier as a Praat object -- so after training is run in the shell, the classifier would be loaded in as a VOTClassifier object, which we'd need to define. That would then be run on a wav and textgrid by highlighting the three objects and pressing a button. This would all require a lot of scripting.)

4) Since the most common use case will be using the plugin for all files in a directory, I think it makes sense to write a separate short sample Praat script that's not part of the plugin (Thea's option 2) and include it with AutoVOT. This will respect the Praat convention that plugins only act on objects inside Praat. The readme could then include as an example running this Praat script on all the tutorial file.

Thanks for all your work on this, both.

jkeshet commented 10 years ago

1) I am not happy with shift+cmd+g and would like to change it 2) I don't think we should change the native functionality of Praat. Thea - forget the command line scripts for a moment. A Praat user who never seen command line has some expectation from Praat. 3) I am a bit skeptical if we can define a Praat object within a praat script - but anyways - I open an "enhancement" issue for it. 4) We can write a script that process a file or some files in a directory. This script will call the autovot praat script internally. But I have a problem with this script - it means that the user will supply a set of TextGrid that contains a processing window. And this naturally done with Praat. If the user can create those automatically - it means that she/he will prefer to use the command line.

I opened a separate issue for (1) and (3) and I am closing this issue.=