Csound Csound-dev Csound-tekno Search About

ANN: Modulor, micro-utility for Cabel

Date2006-05-14 00:01
Fromandrea valle
SubjectANN: Modulor, micro-utility for Cabel
(It seems a bit excessive to mark it with a ANN...)


I'm working on Cabel (thanks Sebastian) for didactical purposes. For 
the same purposes, I'd like to use it as a GUI representing Csound UGen 
as strictly as possible.
More, I wanted to have minimal components to show synthesis algorithms.

Cabel shipped with many nice modules, but if I want a simple oscillator 
I want to have oscil and I want to have it with name "oscil".

So I wrote Modulor, which is a little python script which translate 
html pages of the reference manual in cabel xml modules.
In this way I avoid re-coding in xml the basic opcodes. More generally, 
one can quickly test Csound opcodes in Cabel. If one pass to Modulor a 
folder, all the files contained in that folder will be translated 
automatically.
Even in case of mistakes in the generated code, Modulor should provide 
an easy way to have a first sketch of the xml module, so that you have 
not to start from scratch.

Maybe Modulor can be of some interest for some of you working with 
Cabel.


So, summarizing:


What Modulor tries to do
-----------------------------------
- Cabel modules are generated from xhtml pages of the csound reference 
manual
- descriptions used by Cabel are extracted form reference xhtml too
(thanks to Stefan Gutsfeld)

How it works
-------------------------------------
- optional args ([...]) are deleted
- function references (e.g. "i...fn") are replaced by progressive 
number (it's up to the user to provide in score the required tables)
- the generated module name for an opcode is Opcode
- in case of opcodes working with both kr and ar, two modules are 
(should be) generated: Opcode_ar and Opcode_kr
- x entries for both a/k rates are replaced with kr rate (this cold be 
changed easily. But it seems the most obvious choice)
- Opcode.xml is placed in the same folder of opcode.html
-----------------------------------

Download
-------------------------------------

http://www.semiotiche.it/andrea/sw/modulor.py.zip


Usage
---------------------------------
- from terminal: python modulor.py opcode.html     --> generates 
"opcode.xml"
- from terminal: python modulor.py opcodes/          --> for each 
opcode.html in "opcodes" folder  generates opcode.xml

Warnings
---------------------------------
- Testings has been actually very very limited (distort1, oscil, in, 
out, moog, line)
- Modulor contains some dirty python hack, so...



I'm developing on macosx (where Cabel doesn't work) and testing with 
difficulties in windows. So I'm expecting troubles (even if I tested 
code and generated modules on win).
Feedback is welcome.

Best


-a-





Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
andrea.valle@unito.it

Date2006-05-16 14:47
FromHector Centeno-Garcia
SubjectRe: ANN: Modulor, micro-utility for Cabel
Hi,

Thank you for sharing this! I tried to run Modulor in winodws and I get 
this error message:

C:\Documents and Settings\Hector\Desktop\modulor.py>python modulor.py html/
Traceback (most recent call last):
  File "modulor.py", line 289, in ?
    a.run()
  File "modulor.py", line 276, in run
    self.createModuleDef()
  File "modulor.py", line 197, in createModuleDef
    moduleDef = moduleDef + ''
%(
AttributeError: Modulor instance has no attribute 'description'


I'm trying it with python 2.4 and windows XP.

Hector.



andrea valle wrote:
> (It seems a bit excessive to mark it with a ANN...)
>
>
> I'm working on Cabel (thanks Sebastian) for didactical purposes. For 
> the same purposes, I'd like to use it as a GUI representing Csound 
> UGen as strictly as possible.
> More, I wanted to have minimal components to show synthesis algorithms.
>
> Cabel shipped with many nice modules, but if I want a simple 
> oscillator I want to have oscil and I want to have it with name "oscil".
>
> So I wrote Modulor, which is a little python script which translate 
> html pages of the reference manual in cabel xml modules.
> In this way I avoid re-coding in xml the basic opcodes. More 
> generally, one can quickly test Csound opcodes in Cabel. If one pass 
> to Modulor a folder, all the files contained in that folder will be 
> translated automatically.
> Even in case of mistakes in the generated code, Modulor should provide 
> an easy way to have a first sketch of the xml module, so that you have 
> not to start from scratch.
>
> Maybe Modulor can be of some interest for some of you working with Cabel.
>
>
> So, summarizing:
>
>
> What Modulor tries to do
> -----------------------------------
> - Cabel modules are generated from xhtml pages of the csound reference 
> manual
> - descriptions used by Cabel are extracted form reference xhtml too
> (thanks to Stefan Gutsfeld)
>
> How it works
> -------------------------------------
> - optional args ([...]) are deleted
> - function references (e.g. "i...fn") are replaced by progressive 
> number (it's up to the user to provide in score the required tables)
> - the generated module name for an opcode is Opcode
> - in case of opcodes working with both kr and ar, two modules are 
> (should be) generated: Opcode_ar and Opcode_kr
> - x entries for both a/k rates are replaced with kr rate (this cold be 
> changed easily. But it seems the most obvious choice)
> - Opcode.xml is placed in the same folder of opcode.html
> -----------------------------------
>
> Download
> -------------------------------------
>
> http://www.semiotiche.it/andrea/sw/modulor.py.zip
>
>
> Usage
> ---------------------------------
> - from terminal: python modulor.py opcode.html     --> generates 
> "opcode.xml"
> - from terminal: python modulor.py opcodes/          --> for each 
> opcode.html in "opcodes" folder  generates opcode.xml
>
> Warnings
> ---------------------------------
> - Testings has been actually very very limited (distort1, oscil, in, 
> out, moog, line)
> - Modulor contains some dirty python hack, so...
>
>
>
> I'm developing on macosx (where Cabel doesn't work) and testing with 
> difficulties in windows. So I'm expecting troubles (even if I tested 
> code and generated modules on win).
> Feedback is welcome.
>
> Best
>
>
> -a-
>
>
>
>
>
> Andrea Valle
> DAMS - Facoltà di Scienze della Formazione
> Università degli Studi di Torino
> http://www.semiotiche.it/andrea
> andrea.valle@unito.it

Date2006-05-16 15:02
Fromandrea valle
SubjectRe: ANN: Modulor, micro-utility for Cabel
I'm happy you find it useful (when you can run it...)
I suppose I fixed that problem this morning.
I've uploaded the fixed version two hours ago.

(Actually modulor is not robust at all.)

Please download and try again (and let me know).

Best

-a-

PS1: A major bug consists in the fact that if you have optional params 
in the ins, modulor raises an exception. I have to fix it.
PS2: function i-params are now exported. I've added a IntegerSource_ir 
that allows real time switching of functions.



On 16 May 2006, at 15:47, Hector Centeno-Garcia wrote:

> Hi,
>
> Thank you for sharing this! I tried to run Modulor in winodws and I 
> get this error message:
>
> C:\Documents and Settings\Hector\Desktop\modulor.py>python modulor.py 
> html/
> Traceback (most recent call last):
>  File "modulor.py", line 289, in ?
>    a.run()
>  File "modulor.py", line 276, in run
>    self.createModuleDef()
>  File "modulor.py", line 197, in createModuleDef
>    moduleDef = moduleDef + ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-
> instance" xsi:noNamespaceSchemaLocation="modul.xsd" name="%s" 
> description="%s">'
> %(
> AttributeError: Modulor instance has no attribute 'description'
>
>
> I'm trying it with python 2.4 and windows XP.
>
> Hector.
>
>
>
> andrea valle wrote:
>> (It seems a bit excessive to mark it with a ANN...)
>>
>>
>> I'm working on Cabel (thanks Sebastian) for didactical purposes. For 
>> the same purposes, I'd like to use it as a GUI representing Csound 
>> UGen as strictly as possible.
>> More, I wanted to have minimal components to show synthesis 
>> algorithms.
>>
>> Cabel shipped with many nice modules, but if I want a simple 
>> oscillator I want to have oscil and I want to have it with name 
>> "oscil".
>>
>> So I wrote Modulor, which is a little python script which translate 
>> html pages of the reference manual in cabel xml modules.
>> In this way I avoid re-coding in xml the basic opcodes. More 
>> generally, one can quickly test Csound opcodes in Cabel. If one pass 
>> to Modulor a folder, all the files contained in that folder will be 
>> translated automatically.
>> Even in case of mistakes in the generated code, Modulor should 
>> provide an easy way to have a first sketch of the xml module, so that 
>> you have not to start from scratch.
>>
>> Maybe Modulor can be of some interest for some of you working with 
>> Cabel.
>>
>>
>> So, summarizing:
>>
>>
>> What Modulor tries to do
>> -----------------------------------
>> - Cabel modules are generated from xhtml pages of the csound 
>> reference manual
>> - descriptions used by Cabel are extracted form reference xhtml too
>> (thanks to Stefan Gutsfeld)
>>
>> How it works
>> -------------------------------------
>> - optional args ([...]) are deleted
>> - function references (e.g. "i...fn") are replaced by progressive 
>> number (it's up to the user to provide in score the required tables)
>> - the generated module name for an opcode is Opcode
>> - in case of opcodes working with both kr and ar, two modules are 
>> (should be) generated: Opcode_ar and Opcode_kr
>> - x entries for both a/k rates are replaced with kr rate (this cold 
>> be changed easily. But it seems the most obvious choice)
>> - Opcode.xml is placed in the same folder of opcode.html
>> -----------------------------------
>>
>> Download
>> -------------------------------------
>>
>> http://www.semiotiche.it/andrea/sw/modulor.py.zip
>>
>>
>> Usage
>> ---------------------------------
>> - from terminal: python modulor.py opcode.html     --> generates 
>> "opcode.xml"
>> - from terminal: python modulor.py opcodes/          --> for each 
>> opcode.html in "opcodes" folder  generates opcode.xml
>>
>> Warnings
>> ---------------------------------
>> - Testings has been actually very very limited (distort1, oscil, in, 
>> out, moog, line)
>> - Modulor contains some dirty python hack, so...
>>
>>
>>
>> I'm developing on macosx (where Cabel doesn't work) and testing with 
>> difficulties in windows. So I'm expecting troubles (even if I tested 
>> code and generated modules on win).
>> Feedback is welcome.
>>
>> Best
>>
>>
>> -a-
>>
>>
>>
>>
>>
>> Andrea Valle
>> DAMS - Facoltà di Scienze della Formazione
>> Università degli Studi di Torino
>> http://www.semiotiche.it/andrea
>> andrea.valle@unito.it
>
> -- 
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>
>
Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
andrea.valle@unito.it