Hi, my name is Mike McGonagle. I have been using Csound off and on for
the past
four years. SAOL is something that I wished Csound was. I am interested
in
algorithmic composition, and from what I see so far, SAOL could be
adapted for
the purposes of algorithmic generation, running along side of SASL
(generating
SASL code which is passed to SAOL).
Youngmoo Kim wrote:
> One possible
> addition to MPEG-4 version 2 is some level of integration with Java, most
> likely an API to pass control messages to a host-dependent SAOL
> implementation.
This might be something that would work in conjunction with my idea
above.
> So, I'm wondering what others are doing that might be related to this (it
> sounds like Jan-Helge is doing some interesting stuff!). Also, I'd like to
> stimulate a discussion regarding a "feature list" of possible control
> interaction between Java and SAOL. Some obvious things might be tempo
> control, jump-to time/location, play/pause/stop, and real-time MIDI event
> passing. As SAOL developers, I'm hoping you may have suggestions for other,
> potentially more interesting, kinds of interaction. Any thoughts...?
It would seem to me that many comments have been made about mounting a
GUI on to
SAOL. Maybe, instead, there could be a shell that handles the editing of
SAOL
datatypes. This would keep the SAOL API very focused on what the
intended
purposes are. The editor shell would read and write both raw and ASCII
MPEG 4
files.
I have started a parser for SAOL in Java using ANTLR. I have made an
attachment
of the file so far, all that is there is the lexer. There is still a lot
that I
have to learn about SAOL to continue with the parser. If anyone is
interested in
helping with this, please feel free to add your code.
Michael McGonagle
header {
}
{
import java.io.*;
}
class SAOLParser extends Parser;
options {
tokenVocabulary = SAOL;
defaultErrorHandler = true;
}
class SAOLLexer extends Lexer;
options {
charVocabulary = '\0'..'\377';
tokenVocabulary = SAOL;
testLiterals = false;
k = 2;
}
{
// parser method and variable declarations
public static void main(String[] args) {
try {
InputStream input = null;
if (args.length == 0) {
input = System.in;
} else {
input = new FileInputStream(args[0]);
}
SAOLLexer lexer = new SAOLLexer(input);
Token t = lexer.nextToken();
while(!t.getText().equals("null")) {
System.out.println(t.toString());
t = lexer.nextToken();
}
} catch(Exception e) {
System.err.println("parser exception: " + e);
e.printStackTrace();
}
}
}
WS
: ( ' ' | '\t' | '\f' )
| ( "\r\n" | '\r' | '\n' )
{ newline(); }
;
LINE_COMMENT
: "//" ( ~( '\r' | '\n' ))*
{
$setType(Token.SKIP);
newline();
}
;
AND : "&&" ;
OR : "||" ;
GEQ : ">=" ;
LEQ : "<=" ;
NEQ : "!=" ;
EQEQ : "==" ;
MINUS : "-" ;
STAR : "*" ;
SLASH : "/" ;
PLUS : "+" ;
GT : ">" ;
LT : "<" ;
Q : "?" ;
COL : ":" ;
LP : "(" ;
RP : ")" ;
LC : "{" ;
RC : "}" ;
LB : "[" ;
RB : "]" ;
SEM : ";" ;
COM : "," ;
EQ : "=" ;
NOT : "!" ;
IDENT
: ( 'a'..'z' | 'A'..'Z' | '_' ) ( 'a'..'z' | 'A'..'Z' | '0'..'9' | '_' )*
;
NUMBER
: ( '0'..'9' )+ ( '.' ( '0'..'9' )* )?
| ( '.' ( '0'..'9' )+ )
;
STRING_LITERAL
: '"'!
( '"' '"'!
| ESC
| ~( '"' | '\\' | '\n' | '\r' )
)*
( '"'!
| // this should be an error... a line terminated by eol
{ System.err.println("Literal EOL in string is invalid."); }
)
;
// escape sequence -- note that this is protected; it can only be called
// from another lexer rule -- it will not ever directly return a token to
// the parser
// There are various ambiguities hushed in this rule. The optional
// '0'...'9' digit matches should be matched here rather than letting
// them go back to STRING_LITERAL to be matched. ANTLR does the
// right thing by matching immediately; hence, it's ok to shut off
// the FOLLOW ambig warnings.
protected
ESC
: '\\'
( 'n'
| 'r'
| 't'
| 'b'
| 'f'
| '"'
| '\''
| '\\'
| ( '0'..'3' )
( options { warnWhenFollowAmbig = false; }
: ('0'..'9')
( options { warnWhenFollowAmbig = false; }
: '0'..'9'
)?
)?
| ( '4'..'7' )
( options { warnWhenFollowAmbig = false; }
: ( '0'..'9' )
)?
)
;
This archive was generated by hypermail 2b29 : Wed May 10 2000 - 12:15:23 EDT