First, several of us had started discussing XML, and how we can work with it as a means to achieve interoperability, or at least interchange between our softwares. So I want to open up that topic here.
I think all of our software to be as compatible with each other as possible, so how do we make that happen?
For example, some of my customers who use my Custom Scale Editor (CSE) on Windows have asked for features in my software to allow them to work with Robert Walker's Fractal Tune Smithy (FTS) in conjunction with CSE. Over the years, I have added features to CSE so that data can be exchanged by cut and paste from FTS, just by working with customers. I never even talked to Robert before this event. Now I have some contact with Robert, I want to know more about how I can make CSE more friendly to FTS.
The point is, if we have maximum compatibility, including file exchange, this will benefit everyone. We already have Scala files as a default, so that's fine, but these files don't work for anything beyond simple scale data.
For Mus2, Notist, Nota, FTS, and all my software, let's look into ways to share output and make interchange easier. XML and XSL seem to be the way to go for file formats.
Just a comment as well -- with all these things, I am wary that there is some initial interest and energy behind the idea when it begins, and some more ideas are exchanged, and then nothing happens after that. At worst, this message will sit here on the server with maybe a few replies, and nothing to come of it. We're all busy, but it would be great if we could be energetic and involved and not let the typical thing happen ; )
Looking forward to how this can develop.
Cheers,
Aaron
=====
--
MANAGERS ONLY: To post to MELM" group, send email to mton...@googlegroups.com
To unsubscribe from this group, send email to mtonalist+...@googlegroups.com
GOOGLE TRANSLATE IT: http://translate.google.com.tr
Yes, please post the zlib utility, if it's not too much trouble. I don't know how files work on Google Groups...
Anyway, I have zlib functions in my IDE which I can investigate, but others might not have them; if you have a utility, it will be easier for everyone to just use that.
Cheers,
Aaron
Decompressing a .mus2 file, I see that your XML style is heavy on attribute lists. I understand why, as it is more compact than atomic tags. Just for comparison, for example, you have this line:
<level at="1" value="275.242" cents="87.8048780488"/>
Which in tag atoms would be:
<level>
<at>1</at>
<value>275.242</value>
<cents>87.8048780488</cents>
</level>
This is a question of style and preference, but it also has a pretty huge impact on the way XSLT has to be written to work on the documents, and how a schema or DTD is written for error checking. It also has an impact on how the XML tree can be modified in future versions of your file format.
The arguments against using attribute lists are many, so I guess you are already familiar with them and made your choice deliberately. Please pardon me if it appears I am challenging your choice; I am no expert on XML, I only wonder if you would consider moving towards atomic tag structures for the sake of interoperability and also just for the future of Mus2? Of course these are your own formats, so it's totally your preference.
I feel this issue should be discussed because right now I see that our XML styles are at radical opposite ends, and if we have common style guidelines it helps us all work together more easily. Can others interested in this thread please comment briefly on their preferred XML style? I don't want to get into debates over it; I just want to see where we all are and how we feel about having common styles for the sake of collaboration.
Cheers,
Aaron
=====
As I think I mentioned at MELM, for all these innovative but non-standard things you're putting in the files, the new (several years old now) TUN standard likely has provisions. See version 2.0 here <http://www.mark-henning.de/download_e.php#Tuning>
Actually, we all should look at the TUN 2.0 as another exchange format. There is free C++ source there and also Its developer Mark Henning modeled many of the features of TUN 2.0 on my sketches of TuningXML. The .MSF file format was made specifically for allowing multi-channel tuning tables for Tonal Plexus keyboards. It is implemented in his Windows softsynth Anamark, but I don't know of other software supporting it.
Aaron
But I ran into problems with DTD and schema, and trying to make changes was very difficult. Not for debate, but just to state the major problems with XML attributes (taken from <http://www.w3schools.com/xml/xml_attributes.asp> but the same is found many other places online)
(1) attributes cannot contain multiple values (elements can)
(2) attributes cannot contain tree structures (elements can)
(3) attributes are not easily expandable (for future changes)
That particular page ends with this admonition: "Attributes are difficult to read and maintain. Use elements for data. Use attributes for information that is not relevant to the data."
So, after some time I came to reject attributes for these reasons, and now I only use atomic tags, and only use attributes for nonessential metadata. Since this is the recommended style for XML by coding "authorities", most people are also working this way now.
I understand using the XMLReader versus XMLDocument paradigm for loading are two different ways of working, but (for me at least) I find that reading in a stream is more error prone than reading the whole document, and the difference in time to process isn't that significant.
But I am not telling anyone what to do, of course, only giving some information for consideration. After I changed my mind away from attributes, I never went back and rewrote TuningXML because it was too much (tedious) work. I assume with some kind of automatic processing Qt can save XML style either way, but I don't know much about Qt ... yet : )
Cheers,
Aaron
=====
(1) attributes cannot contain multiple values (elements can)
(2) attributes cannot contain tree structures (elements can)
The scala keyboard map or some way to specify how the notes are to be played from a midi keyboard is the only other main thing I can think of that you would want to add that FTS uses currently.
This is what CSE is for. Tunings can be created in a huge number of ways, including importing any number of Scala files and mapping to a keyboard. CSE files can be exported in a variety of formats, including .scl + .kbm. There is a .Hz format that is simply a list of frequencies in a text file. No headers, nothing else, just Hz values, in chunks of 128, each chunk being a MIDI channel, for multi-channel support (TBX1 supports 4 channels, Tonal Plexus keyboard support all 16 MIDI channels).
Generally, the problem with all apps that support Scala files is the mapping. VSTs, AUs, standalone synths, you name it, it is the keyboard mapping that is the problem.
Apart from being the companion to TBX1 hardware, this whole problem of mapping scales is why CSE exists. It's supposed to make that process as easy as possible and provide export options for as many uses as possible. I guess I did a really bad job demonstrating it at MELM because I obviously didn't get that across; sorry.
I personally do not like having 2 files .scl + .kbm. I find this combination of 2 files an extremely unattractive option, for two reasons. First, because it forces every program that supports it to have intelligent parsing, which is too discouraging for developers who don't know anything about tuning and see it as a bother. Second, simply because it requires these two different files that have no internal connection so that it is impossible to error check. It may offer some flexibility for the user, but I really don't see any advantage, when an app like CSE exists to create 1 file that is exactly what is wanted, clearly showing "this MIDI key = this pitch" relationships for every note.
CSE provides formats that have 128 values for each MIDI channel you want to tune, up to 16 channels in a file in two formats .Hz and .csv. Valid file sizes are in increments of 128 values and those values correspond directly to MIDI notes. I can't think of anything simpler than that. The parser doesn't need to do any calculation, or hardly any after it gets the values. CSV is direct pitch bend data. Hz is frequency data.
If we want this stuff to be supported, we need standards that are as simple as possible to implement, and we need documentation and free code to do it. We're not there yet. I wanted to do it with CSE, it's not there yet. So let's do it already!?
Cheers,
Aaron
First, thanks for such a long message, but please don't feel you need to respond to everything in so much detail. I worry a little that you have other more important things to do ; )
I wasn't suggesting that TUN 2.0 be adopted by anyone actually. I wouldn't have done anything with TuningXML otherwise. I wouldn't suggest worrying about it for FTS, Robert, seriously. I only suggested looking at it in order perhaps to make your extra sections fit in with an existing specification.
If we want to discuss the specifics of TUN 2.0, they were really modeled on TuningXML. I guess I should point to my initial sketches of that. They appear rather ridiculous to me now, especially because I didn't understand XML at all back then. I was just exploring the idea and trying out different things. I was doing a lot of things simply wrong back then. You'll see, if you know XML at all. I asked for help, but nobody helped me then. Here it is anyway. <http://www.h-pi.com/wordpress/?p=24>
As far as human readability, XML is verbose and more human readable than any of these other files. XML allows us to clearly state what the data is in tags with specific names for everything. This is one of the main reasons to use it, to me at least.
Consider that a format like Scala really isn't readable on the same way. You have to know what a scala file is representing in order to make sense out of it. The fact that a number with a point and a number with a slash don't represent the same thing is absolutely not intuitive, for example. With XML, you may not know what a tag is if you don't know that word, but consulting a dictionary will answer the question.
The XML language gives structured data with human readable elements, so that the whole structure of the data in the file makes logical sense without any other reference whatsoever. This is very useful!
Why have a new format? The reasons are many; here are a few:
(1) syntax standardization - XML is a standard for any kind of data, we should have ghettoized formats for our stuff
(2) human readability - tags explain everything in an WML file, comments make up for any ambiguity
(3) interchange - XML parsers automatically error check and get the data already structured
(4) versatility - the file can represent things simple or complex, from a tuning to a notation file
(5) expandability - just add more tags
(6) adaptability - the data can be translated using XSL into any form imaginable
OK if I go on I'll start talking at cross purposes, and contradicting myself.
... and I also have a lot of other work I need to be doing ; )
Cheers,
Aaron
=====
I also once suggested to monz that he could perhaps allow his Tonescape code be ported into Mus2.
Oz.
✩ ✩ ✩
www.ozanyarman.com