My server host is experiencing a DDoS attack. Not just my site, but the entire site's web servers. I have no idea what the issue is ... but my site (and email) as been out of service now for a day or so.
If you have a suggestion for a low-priced web hosting alternative or if you need to contact me please send mail to bobmellowood@gmail.com
Tuesday, May 10, 2016
Saturday, May 7, 2016
More afterbars
Finally found a bit of time to work on this some more :)
I think we're going to change the command name to "trigger" to keep it consistent with the existing track-trigger stuff. I'm also thinking that keyword options will be:
Trigger AT=xx CMD.. /// do at specified bar
Trigger After=xx CMD.. /// to after xx bars
Trigger Repeat=xx CMD... /// do every xx bars
Multiple trigger lines are permitted, and each can have its own settings.
I don't think that every user will be using this ... but it's a simple addition and should make using melodies set in macros a bit easier.
I think we're going to change the command name to "trigger" to keep it consistent with the existing track-trigger stuff. I'm also thinking that keyword options will be:
Trigger AT=xx CMD.. /// do at specified bar
Trigger After=xx CMD.. /// to after xx bars
Trigger Repeat=xx CMD... /// do every xx bars
Multiple trigger lines are permitted, and each can have its own settings.
I don't think that every user will be using this ... but it's a simple addition and should make using melodies set in macros a bit easier.
Thursday, May 5, 2016
New command: AfterBars
I've added a new command: AfterBars.
The idea is that you can set "something" to happen at some point in the future.
For example, you might want to print a message to the terminal every 10 bars (nope, no idea why you'd want to do this). Or, more usefully, you may have set a song (or part) into a macro and want to change the volume of this after a few bars. So, you can now do something like:
Mset Melody
C
D
.... more chord lines
EndMset
And expand this melody a number of times:
$Melody
$Melody
and now, for the final loop, we change the volume after 4 more bars:
AfterBars Count=4 Volume pp
And, now the command becomes cool.
You can even set a specific bar number (Bar=32) or repeat the command every nn bars.
I need to work on this a bit more and debug the line number settings before we get too excited. But, this will find itself into the next developer release. Hopefully, next week.
Standby :)
The idea is that you can set "something" to happen at some point in the future.
For example, you might want to print a message to the terminal every 10 bars (nope, no idea why you'd want to do this). Or, more usefully, you may have set a song (or part) into a macro and want to change the volume of this after a few bars. So, you can now do something like:
Mset Melody
C
D
.... more chord lines
EndMset
And expand this melody a number of times:
$Melody
$Melody
and now, for the final loop, we change the volume after 4 more bars:
AfterBars Count=4 Volume pp
And, now the command becomes cool.
You can even set a specific bar number (Bar=32) or repeat the command every nn bars.
I need to work on this a bit more and debug the line number settings before we get too excited. But, this will find itself into the next developer release. Hopefully, next week.
Standby :)
Sunday, April 24, 2016
Python exceptions
When writing Python code it's import to trap errors :) And MMA does this, fairly well.
But, I just had some fun with the plugin loader. I kept getting a weird error message which didn't make a lot sense. After a bit (well, actually quite a bit!) of head scratching I finally figured it out.
In the regplug.py module I have a bit of code which looked a bit like this:
try:
e = importlib.import_module(modName, package=None)
except ImportError:
error( ... report error ... )
this was meant to trap/report a problem loading the plugin module. If the module just didn't exist or was unreadable it worked fine.
But, what if the module was there and there was an error in it which caused a problem when loading? If it was something dumb like too many '(' or ')'s python reports the appropriate error as a crash. Okay, that's probably just fine. Writers of plugins should make sure that they work!
But, what if the module being loaded has a "import xxx" line? Well, since we're catching import errors, we catch it. I don't think we can set up a try/except which only works a one level.
The solution is simply to change our code to:
try:
e = importlib.import_module(modName, package=None)
except ImportError, err:
error("Plugin: Error loading module '%s'. Python is reporting '%s'. "
"Most likely there is an Import statement in the module which is not working."% (modName, str(err)))
and now MMA reports a more useful message.
But, I just had some fun with the plugin loader. I kept getting a weird error message which didn't make a lot sense. After a bit (well, actually quite a bit!) of head scratching I finally figured it out.
In the regplug.py module I have a bit of code which looked a bit like this:
try:
e = importlib.import_module(modName, package=None)
except ImportError:
error( ... report error ... )
this was meant to trap/report a problem loading the plugin module. If the module just didn't exist or was unreadable it worked fine.
But, what if the module was there and there was an error in it which caused a problem when loading? If it was something dumb like too many '(' or ')'s python reports the appropriate error as a crash. Okay, that's probably just fine. Writers of plugins should make sure that they work!
But, what if the module being loaded has a "import xxx" line? Well, since we're catching import errors, we catch it. I don't think we can set up a try/except which only works a one level.
The solution is simply to change our code to:
try:
e = importlib.import_module(modName, package=None)
except ImportError, err:
error("Plugin: Error loading module '%s'. Python is reporting '%s'. "
"Most likely there is an Import statement in the module which is not working."% (modName, str(err)))
and now MMA reports a more useful message.
Thursday, April 14, 2016
New test version
I finally got a crappy-weather-day here. Ideal to do some needed updating to the plugin routines! Ignazio wrote a nice little module (included in the MMA module directory) with some standard functions which should make writing a plugin easier (well, more consistent). So, that along with his docs, have been added to the official tree.
I really hope some of you are taking advantage of the plugin facility. Possibilities are endless!
So you can enjoy the latest I've put a new developer version up on the website. You can get it at: http://mellowood.ca/mma/downloads.html#developer
Unless we find some serious bugs, this will be the next stable release. Probably version 16.06. But who knows?
I really hope some of you are taking advantage of the plugin facility. Possibilities are endless!
So you can enjoy the latest I've put a new developer version up on the website. You can get it at: http://mellowood.ca/mma/downloads.html#developer
Unless we find some serious bugs, this will be the next stable release. Probably version 16.06. But who knows?
Tuesday, March 8, 2016
DupRiff
If you use RIFFs much you should know that you can copy an existing riff to other tracks. Easy.
But, I just added and enhancement to reverse the order :) Now you can copy FROM another track as well.
It's not a big deal, but is very handy to use in Begin/End situations.
But, I just added and enhancement to reverse the order :) Now you can copy FROM another track as well.
It's not a big deal, but is very handy to use in Begin/End situations.
Friday, March 4, 2016
Plugin security
I'm wondering if the current checks on the plugin security are not enough or silly and in the won't-ever-prevent-much category?
Right now we check to see if the requested plug has been "authorized" and let the user decide if he/she wants to use it.
One of the things we do is to run a checksum on the main module. This is stored with the authorization. If the checksum changes, we request a new authorization.
But, it's really silly since it's very easy for a "bad person" to sidestep with by calling another module. Leave the main "plugin.py" alone and modify something it calls. And so we go down the rabbit hole.
My proposal is to dump the checksum and just ask if the directory/module is okay.
And what do you folks think. Please let me know.
Right now we check to see if the requested plug has been "authorized" and let the user decide if he/she wants to use it.
One of the things we do is to run a checksum on the main module. This is stored with the authorization. If the checksum changes, we request a new authorization.
But, it's really silly since it's very easy for a "bad person" to sidestep with by calling another module. Leave the main "plugin.py" alone and modify something it calls. And so we go down the rabbit hole.
My proposal is to dump the checksum and just ask if the directory/module is okay.
And what do you folks think. Please let me know.
Subscribe to:
Posts (Atom)
I've been pretty neglectful in keeping this blog up-to-date. Lots of excuses ... but, I'll try to do a bit better! There is a new b...
-
I've been pretty neglectful in keeping this blog up-to-date. Lots of excuses ... but, I'll try to do a bit better! There is a new b...
-
I'm pleased to announce the long overdue update to MMA stable. Version 19.07 is now online and ready for your musical pursuits. Lots of ...
-
I've had requests over the years for on-line docs for MMA. Always just ignored them because ... well, the main reason was that the web h...