Restarting Natlink

I am returning to NL after a 7 year hiatus. Advanced scripting just doen't do it all the time. After I make a correction to y python script, how do I get it to be recognized by DNS without restarting the program?

Thanks,

Allan

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Toggle the microphone on and

Toggle the microphone on and off?

No need to restart DNS,

No need to restart DNS, simply save your file and switch your microphone off and on again... or use a script.. and, assuming that you are not using Vocola,

natlink.execScript('SetMicrophone 0') ...to switch microphone off
natlink.playString('{Ctrl+s}') ...to save
natlink.execScript('SetMicrophone 1') ...to switch it back on.

Mark

I think Mark is correct.

I think Mark is correct. Toggling the mic will do a lot of good.

When you use Vocola command files, the checking of changed command files is on after a "edit commands" voice command. With the new version to be released soon, even Vocola is checking for changes at each utterance I believe.

When you use Unimacro grammars, and you start editing the grammar file by a voice command ("edit grammar folders" for example), Natlink will check for this grammar file changes at each utterance.

If you want constant checking at each utterance all the time (which is default switched off because of overhead), turn on the variable

checkForGrammarChanges = 1

on line 119 of natlinkmain.py in the natlink/MacroSystem/core directory.

Quintijn

Quote: When you use Vocola

Quote:

When you use Vocola command files, the checking of changed command files is on after a "edit commands" voice command. With the new version to be released soon, even Vocola is checking for changes at each utterance I believe.
If you want constant checking at each utterance all the time (which is default switched off because of overhead), turn on the variable

Why would it ever be necessary to check at each utterance? Why would it not be sufficient to check just when a file is changed and saved... this overhead seems somewhat OTT.

Mark

Ah, but how do you know that

Ah, but how do you know that a file was changed? I think the only way in Python is to check the modification times of each file. That really doesn't take all that much time because all the information is in RAM.

mdl wrote: Ah, but how do

mdl wrote:

Ah, but how do you know that a file was changed?

Because I changed it? Then a save and microphone on/off should be sufficient, or do you see Dragonfly/Vocola/Unimacro/Natlink etc as self modifying during execution... and that frightens me just a little.

Mark

Vocola files need constant checking

For python grammar files, checking is done when the microphone toggles. And automatically when you edit Unimacro grammars in the way I describe above or when you set the switch as mentioned above. But you have the mic toggle for forcing checking for changes.

For Vocola command files (.vcl and .vch) it is a bit more tricky, because natlinkmain has to know when Vocola changed python grammar files (as generated from the Vocola command files). And yes, include files can be changed and the user can change command files either programmatically some way or open the file without issuing a voice command.

When Vocola (re)generates all its command files into python grammar files, natlinkmain is informed, and checks for python files immediate, and ONLY ONCE. This is a special feature in natlinkmain for Vocola.

Because it is possible that Vocola command files (.vcl) of include files (.vch) are changed without a voice command ("edit commands" or "edit global commands"), the Vocola developers prefer to check for changes of .vch and .vcl files at each utterance. Some overhead, but - I believe - and according to measurements by Mark Lillibridge - reasonably small. I am making some efforts to reduce this overhead a bit more for the next natlink release.

Quintijn

should this be default behaviour when Vocola is enabled?

Maybe this should be the default behaviour for Vocola, or it could be configurable via the configuration GUI.

Derek Morin

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Syndicate content