| Jean Piche wrote:
> Charlie,
>
> Can you give a preview of the syntax flavour?
>
Sure,
"Objective" PERL allows two methods of invocation,
either:
$object->cmd($param(s),$value,$note(s))
or
cmd $object $param(s), $value ,$note(s)
where $object is the global "scorefile object " (lets me eventually
keep several edits going at once,, with copying between in edit buff.)
cmd is the command string "scale" or "set" or...etc.
$param(s) is either a parameter number, or an "anonymous array" of
parameters: written like so: [2,3,4,7]
$value is the value to pass the edit routine (there is some minor type
checking...I try to do the right thing when it comes to shifting or scaling
oct.pc, etc.) and $notes is a "scalar reference": to a list of note
references.
Hahahah...don't let this scare you: the syntax is:
## comment
$curEdit; ## = all da notes in edit buffer
$ins1 = $instrArray{1}; ## = all the notes in instr 1,I set this up for 'ya
$mylist = $object->selectByStart(2.0,7.5,$curEdit);
## several of these select routines : they can be arbitrarily deep.
Usually, one would use editBuf: it creates undo info.
$object->editBuf([scale, [2, 3], 123], $object->selectByStart(3, 12.3,
$curEdit));
OR
$mylist = selectByStart $object 3,12.3, $curEdit;
editBuf $object [scale,[2,3],1.23] , $mylist;
This would edit all notes with start times between 3 and 12.3 : multipling
the startTime and duration (parameters 2 &3) by 1.23
It's not the cleanest,simplest notation, but it is powerful, when embedded in
PERL. If a user finds this too complex, they can be asked to use
menus and simple forms to edit, but the power of any such scheme is
the embedding of the syntax in the language: and I think the world of PERL.
But I do include code that parses up the edit command for the user,
from menus, etc., then evaluates it. Just like I eval the arbitrary Perl
you may enter instead....
All edits are non-destructive, full undo is available, if you use the
editBuf syntax....the master "world-list" of notes is only cleaned of
earlier edits when one "saves as" (no simple save: always prompts for
name)......
The clumsiness of having the scorefile "$object" in all the commands
is perhaps compensated for when one realises that each $object is a unique
edit buffer,with it's own undo history. I am now finishing an "inter-object"
deep copy routine that will make inter-score copying meaningful. Then I'll
put in the
top level open/close.save stuff the way I imagtined it, and I'll release it
to
the (probably deeply apathetic) world....
Thanks for the interest...
Char lieB
--
*********************************************
Charlie Baker baker@charlieb.com
"when everything isn't roses, you don't get
any headroom" - Thomas Dolby "New Toy"
*********************************************
|