| The process you indicated works pretty much the same way on Vim for calling
an external program, so that's a start at any rate. I'd like to make sure
the scripts can be used by folks on various editors so maybe that's the way
to go. I know there are other more integrated methods as well, such as
Pymacs for Emacs and if_Python for Vim, but I don't know much about using
them. Anyone else know?
> seems quite simple on Emacs, but you will need to write at least one
> function in Elisp ... and once you can program Elisp, I don't see the
point
> in using Python anymore :) (ok, just kidding)
Elisp does look worth learning, but I figure most new programmers learning
Csound probably will want to start with only one scripting language. Seems
to me Python is the natural choice there considering it's popularity with
Csound and other music language developers as well as it's ease of use and
commonality between editors.
Basically I want to make a sort of universal step event editor type thing
that one can run from Emacs or Vim, or just run the scripts seperately, to
allow easy editing of general event lists. These lists can then be exported
as Csound scores, table for my sequencer, or midi files. So the concept is
that you just have a numeric grid with time going down in steps and pfields
across. Then one can select blocks of data and transfrom or insert data
quickly from the scripts. In Cakewalk there are many handy functions that I
plan on porting, like scaling selected data by a start and end percentage,
repeating blocks, etc. I was also thinking of adding "marker" fields off to
the right of the lines that would allow you to quickly select many notes
that may not be contiguous, and leave those selections intact for the
duration of a session. So say you wanted to select only the downbeats, you
could run a function that adds your mark to all downbeats, and later run any
functions you want on all notes with that mark. When you export to Csound
score, ftable, or midi, those marks would not be used. I think that could be
used for very nice pattern generation with multiple marks and smart scaling
functions.
If anyone else is interested in these ideas we could set up a list of script
ideas to be done and put them up somewhere. Right now I find GVim the
easiest because the mouse with Visual Block mode makes selecting blocks very
simple, but I expect that is just unfamiliarity with Emacs. Rather than join
the holy wars I think I'll just learn both. ; )
So for now I guess I will assume the method is:
- selected data goes into a buffer/register
- script runs on data as if it is a file
- selection is automatically replaced by output from script
Feedback from those more knowledgable about this would be appreciated.
Iain
>
> so:
>
>
> >The process:
> >- select a block of tab seperated numbers ( visual block mode in
vim )
> >- run a user command that:
> > - copies all selected data to a buffer/register/whathaveyou
>
> see Elisp functions copy-rectangle-to-register , kill-rectangle
> and extract-rectangle
>
> > - takes some arguments and passes data to a python script
> > - runs python script on said data as if it is a regular python input
> >file
>
> use shell-command to call python and get the result back
>
>
> > - replaces selected block in editor with the results of the python
> >script.
>
> functions kill-rectangle and insert-rectangle
>
>
> >I'd like to use Python instead of learning elisp, so that the scripts can
be
> >used from various apps ( all of Emacs, Vim, and Open Office allow Python
> >scripting right? ). But documentation on this process seems less than
> >perfectly clear to the new user . . .
>
>
> I don't know about using Python as a scripting langage for Emacs. what I
> just described is how you would call Python as a subprocess from some
Elisp
> code.
>
> Now I could include that into Csound-X: like, any selected matrix in score
> could be sent to an arbitrary external app then get replaced with the app
> output. But it is not clear what format should be used for input, and what
> format should be expected as output.
>
> is anyone interested in this idea ?
> (I've no idea of how many people actually work with Csound-X, as the
> feedback is very sparse)
>
>
> cheers,
>
> Stef
>
>
>
>
>
> --
> Send bugs reports to csound-bugs-sBK8fsN9CKk2EctHIo1CcQ@public.gmane.org
> (or to http://www.cs.bath.ac.uk/cgi-bin/csound )
> To unsubscribe, send email to csound-unsubscribe-nJFXYWEDAR8wZN84zEGlPg@public.gmane.org
>
_______________________________________________
csoundtekno mailing list
csoundtekno-N4abDuUB7xo@public.gmane.org
Subscribe, unsubscribe, change mailing list options: |