Csound Csound-dev Csound-tekno Search About

python to create "custom score language" text highlighting & text editing interface

Date2007-08-06 03:36
FromTim Mortimer
Subjectpython to create "custom score language" text highlighting & text editing interface
Hello again.

I just thought i'd put my feelers out on this one.

I've gone python crazy over last couple of weeks, & amongst other things
i've "kind of sort of" come up with my own score writing language, that
combines most of the csound sco basics with handy little extras like:

* named parameter passing to score macros 
eg: 
CHORDX {pch=02,05,08}
LINE_Y {inst="flute"}

* auto-calculating note lengths from one start time to the next

* passing cresc/ dim type dynamic markings as a trajectory in a list that is
linked to the note time
eg:

0 flute 8 00 2000 100 {0:pp,500:f,2000:ppp}

* accumulating time / bar markers

4/4

5/16 etc

anyway, i'm keen to use Tkinter or something to come up with some simple
custom text highlighting for my "score meta language"

It might be as simple as colour coding instrument names for easy
identification for starters, but rather than starting from first principles,
i wondered if anyone has any simple working examples, perhaps of a Csound
syntax highlighter written in Python? (Jonathon I know you did something
like this for the wiki, but it probably spits out XML / html type info i
imagine, & is not something that can be used as custom highlighting for a
"text editor" per se??

Also wondering if simply telling scite what to do / look out for might be a
simpler & easier option? The list of key words & colours will be pretty
small compared to a "full on" programming language, but there might be a
whole lot of extra "bloat" involved in doing it in scite. I just want to
conditionally colour my text. full stop.

once i have developed something fully functional & coherent i'll happy share
what i have done if people are interested in seeing it. but it's possibly
quite idiosyncratic, & doesn't represent "an answer to everything for all
occasions" - i'm constantly "under the hood" in python at this stage -
tailoring & modifying as new applications & challenges come to my
attention.... 

anyway, keen for any simple functional examples, or rational suggestions.

cheers

Tim
-- 
View this message in context: http://www.nabble.com/python-to-create-%22custom-score-language%22-text-highlighting---text-editing-interface-tf4221950.html#a12010307
Sent from the Csound - General mailing list archive at Nabble.com.