Loading ...
Sorry, an error occurred while loading the content.

64167SVG and MIDI

Expand Messages
  • j.ingram48
    Nov 2, 2010
    • 0 Attachment
      This thread started at W3C [1], but both Helder and David have recommended that I move it here, so that's what I'm doing. The thread so far is quoted below.

      Helder wrote:
      > You mean "Inkscape" [1]? ;-)
      Oops, yes.

      > Yeah, I guess taking the "develop an Inkscape plug-in" approach is
      > probably wise for this case. I've seen a few software packages based
      > on this approach, mostly just to embed metadata which is used for
      > behavior during run-time.
      That sounds familiar. The extensions I have in mind are for use in an application which runs in real, performed time (a real player using Assistant Performer software).

      I was thinking of defining the following types:
      mus:type="system"
      mus:type="staff"
      mus:type="chord"
      mus:type="rest"
      mus:type="barline"
      etc.
      And
      mus:msPos (int)
      mus:staffName (string)
      mus:midiChannel (int)
      mus:midiPitches (list of ints)

      The system mus:msPos would be the default number of milliseconds from the beginning of the performance.
      The chord and rest mus:msPos would be the default number of milliseconds from the beginning of the system.

      I dont need a default duration (mus:msDuration) anywhere, because that value can easily be deduced from the sequences of mus:msPos if needed. Chord durations are, however, very often shorter in real time than their defaults would be (think Mozart staccato), so I think they would be unnecessary ballast and a potential source of errors...

      For example:

      <svg ... xmlns:mus="http://www.james-ingram-act-two/Moritz/scoreTypes" ... >
      <!-- there will be a sequence of systems in the page -->
      <g mus:type="system" mus:msPos="0">
      <!-- a sequence of staffs in the system -->
      <g mus:type="staff" mus:staffName="Flute" mus:midiChannel="0" >

      <!-- a sequence of clefs, barlines, rests, chords etc -->

      <g mus:type="rest" mus:msPos="0" >
      <!-- the rest text character -->
      <g mus:type="drawObjects">
      <!-- objects associated with the rest -->
      </g>
      </g> <!-- end of rest -->

      <g mus:type="barline">
      <!-- the barline line -->
      <g mus:type="drawObjects">
      <!-- objects associated with the barline -->
      </g>
      </g> <!-- end of barline -->

      <g mus:type="chord" mus:msPos="1348" mus:midiPitches="64 67 83 90">
      <!-- graphics for the chord symbol -->
      <g mus:type="drawObjects">
      <!-- control texts and other objects associated with the chord -->
      <!-- The control texts can be parsed for things like dynamics
      or patch changes ->
      </g>
      </g> <!-- end of chord -->

      <!-- etc. more chords, rests, barlines etc. -->

      </g> <!-- end of staff -->
      <!-- more staves -->
      </g> <!-- end of system -->
      <!-- more systems -->
      </svg>

      This has the interesting side effect that there does not have to be a rest or chord at the start of every staff. That's very useful, because notations should not have to insist on having tied notes where durations cross systems. We are not restricted to standard notation. :-) There probably has to be a special type mus:tiedChord for chord symbols which are continuations...

      David has now mentioned SMIL, so I've been reading a bit about that (for the first time). Maybe because I'm new to it, it seems less intuitive than the above scheme, and more verbose. It would be nice to reuse an existing standard if possible, but only if it is the right standard! :-) Does it have any advantages over the above scheme?

      Helder said:
      > I guess you might also find interesting (to mix/analyze/reuse) to know
      > about Audacity [2], which has some (apparently quite limited) support
      > for MIDI and whose license seems to be compatible with Inkscape's.
      Again, I'm not interested in the sounds themselves. My Assistant Performer outputs MIDI signals. What happens to the output after that is outside its control. There are lots of programs/synthesizers out there which are concerned with timbre-creation, and can provide interpretations of incoming MIDI data. For me, perhaps the most interesting is Max/MSP [1].

      David said:
      > It would be sort of like having SVG but for sound and it would allow the construction of complex
      > sounds.
      Constructing complex sounds is done at a level lower than chord symbols. I'm talking about written music, which is all about things like musical form. Levels higher than the chord level. SVG is of course the right language for describing scores.
      > Maybe there already is something like that but I doubt that it has
      > browser support to let me make music yet.
      Coming soon! :-) Browsers can display SVG scores and react to user input... I'm interested in live music making...

      > And I somehow doubt that if there
      > is, that they're integrating that closely with SMIL and SVG.
      ? I doubt it too. SMIL looks to me too complicated for my purposes, but I may be wrong...
      > Here's some fiddling I did with random music composition using audio clips
      > several years ago:
      > http://srufaculty.sru.edu/david.dailey/javascript/sound/sound3.html (working
      > in at least IE, FF, .
      Unfortunately your examples use Quicktime, which does not run on my system (Windows Vista 64bit Ultimate).

      all the best,
      James

      [1] http://lists.w3.org/Archives/Public/www-svg/2010Oct/0160.html
      [2] http://en.wikipedia.org/wiki/Max/MSP

      ==========================================================================

      This thread started as follows (in chronological order)

      > From: James Ingram <j.ingram@...>
      > Date: Wed, 27 Oct 2010 00:21:04 +0200
      > Message-ID: <4CC75450.2050305@...>
      > To: www-svg@...
      > Hi,
      >
      > I have an application which currently reads/writes both music scores and
      > midi. The music notation I want to use is not quite standard, so I want
      > to start writing my scores in SVG.
      >
      > I need to include logical information about chord symbols, (such as
      > their temporal duration and midi pitches) so that these do not have to
      > be deduced from the (static 2D) graphics when I read and play the file.
      >
      > Having read a few articles on SVG, the obvious way to do this would be
      > to include the information in each chord's <desc> element using a
      > standard string format.
      >
      > My questions are:
      > Is there already a recommended way to include such logical
      > (temporal/MIDI) information?
      > Is there a standard string format?
      > Should I be doing this some other way?
      >
      > I have not yet written any SVG but otherwise have a lot of experience in
      > this area, so I know what I'm letting myself in for. :-)
      >
      > best wishes,
      > James Ingram
      > --
      > www.james-ingram-act-two.de

      > From: Alex Danilo <alex@...>
      > Date: Fri, 29 Oct 2010 07:56:08 +1100
      > Message-Id: <K5Q0BL.30ONAN7WDXQ8@...>
      > To: James Ingram <j.ingram@...>
      > Cc: www-svg@...
      > Hi James,
      >
      > --Original Message--:
      > >Hi,
      > >
      > >I have an application which currently reads/writes both music scores and
      > >midi. The music notation I want to use is not quite standard, so I want
      > >to start writing my scores in SVG.
      > >
      > >I need to include logical information about chord symbols, (such as
      > >their temporal duration and midi pitches) so that these do not have to
      > >be deduced from the (static 2D) graphics when I read and play the file.
      > >
      > >Having read a few articles on SVG, the obvious way to do this would be
      > >to include the information in each chord's <desc> element using a
      > >standard string format.
      > >
      > >My questions are:
      > >Is there already a recommended way to include such logical
      > >(temporal/MIDI) information?
      >
      > In the past people have used SVG for music authoring programs,
      > but I don't think there is any preferred way to do this.
      >
      > >Is there a standard string format?
      >
      > Not that I'm aware of.
      >
      > >Should I be doing this some other way?
      >
      > Yes.
      >
      > If you pack this all into a string, you end up with the pain
      > of having to parse the string out which is painful at best.
      >
      > It might be a better idea to declare your own XML namespace
      > and declare the temporal and frequency information in your
      > own namespace which becomes part of the notes/chords. A lot
      > of authoring tools such as Inkscape, etc. use this approach
      > for custom markup.
      >
      > For example:
      >
      > <svg xmlns=" http://www.w3.org/2000/svg"
      > xmlns:xlink="http://www.w3.org/1999/xlink"
      > xmlns:mymusic="http://james.music.notation">
      > <defs>
      > <g id="middle-c" mymusic:note="middle-c" mymusic:frequency="440">
      > ... graphics in here, etc.
      > <g>
      > <g id="major-c" mymusic:chord="root-third-fifth">
      > <use xlink:href="middle-c" .../>
      > <use xlink:href="middle-e" .../>
      > <use xlink:href="middle-g" .../>
      > <g>
      > ...
      > </defs>
      > <g id="song" mymusic:duration="20">
      > <use xlink:href="major-c" ...
      > </g>
      >
      > This doesn't make a lot of sense musically of course, but
      > hopefully gives you an idea how to put this all into the
      > SVG file in a way that will be a lot easier for you to
      > reprocess and parse later.
      >
      > Alex
      >
      > >I have not yet written any SVG but otherwise have a lot of experience in
      > >this area, so I know what I'm letting myself in for. :-)
      > >
      > >best wishes,
      > >James Ingram
      > >--
      > >www.james-ingram-act-two.de
      --------------------------------------------------------------------------
      > From: James Ingram <j.ingram@...>
      > Date: Fri, 29 Oct 2010 10:20:39 +0200
      > Message-ID: <4CCA83D7.7000606@...>
      > To: www-svg@...
      > Hi Alex,
      >
      > That was very helpful, thanks!
      >
      > I'm now reading all about defining namespaces. :-)
      >
      > James
      > --
      > www.james-ingram-act-two.de
      --------------------------------------------------------------------------
      > From: Helder Magalhães <helder.magalhaes@...>
      > Date: Sat, 30 Oct 2010 09:09:46 +0100
      > Message-ID: <AANLkTinYdyeNS+nTctPef194fvwt-aYFHJ3uqT8gO+Eq@...>
      > To: James Ingram <j.ingram@...>
      > Cc: www-svg@...
      > Hi James,
      >
      >
      > > I need to include logical information about chord symbols, (such as their
      > > temporal duration and midi pitches) so that these do not have to be deduced
      > > from the (static 2D) graphics when I read and play the file.
      > >
      > > My questions are:
      > > Is there already a recommended way to include such logical (temporal/MIDI)
      > > information?
      >
      > I guess Alex already pointed out a good possible solution. I'd only
      > add to this the declarative animation support [1] already in SVG
      > (using SMIL), which adds the "temporal" information you might be
      > seeking about. :-)
      >
      >
      > > Should I be doing this some other way?
      >
      > (Apart from the above,) You could also try using scripting (for
      > example using ECMAScript - a.k.a. JavaScript - or other languages).
      > You'll *definitely* want to take a look at a tightly related SVG Wow!
      > demo [2]! ;-)
      >
      >
      > > I have not yet written any SVG but otherwise have a lot of experience in
      > > this area, so I know what I'm letting myself in for. :-)
      >
      > I'm assuming that "this area" relates to graphics and stuff and I'm
      > always glad to hear when someone with expertize joins the community.
      > Welcome and good luck! ;-)
      >
      >
      > > best wishes,
      > > James Ingram
      >
      > Hope this helps,
      > Helder
      >
      >
      > [1] http://www.w3.org/TR/SVG11/animate.html
      > [2] http://svg-wow.org/blog/2009/10/04/animated-lyrics/
      --------------------------------------------------------------------------
      > From: James Ingram <j.ingram@...>
      > Date: Sat, 30 Oct 2010 13:20:01 +0200
      > Message-ID: <4CCBFF61.4000102@...>
      > To: www-svg@...
      > CC: helder.magalhaes@...
      > Hi Helder,
      > Thanks for keeping this thread alive.
      >
      > I'm an expert in music notation with a background in writing music scores.
      > Briefly: I was Karlheinz Stockhausen's copyist 1974-2000. Wrote his
      > published scores in pen and ink until 1992, thereafter using a
      > combination of Finale and Freehand. In the 1990s I wrote a group of
      > plug-ins [1] for Freehand to help me create the complex scores I was
      > being asked to create. I will be referring to their code when creating
      > my SVG graphics.
      >
      > Thanks for pointing me at the animation examples, but I'm not currently
      > interested in animating the graphics. What interests me is real-time
      > user interaction with fixed, printable scores.
      >
      > In my first post, I said
      > > I need to include logical information about chord symbols, (such as their
      > > temporal duration and midi pitches) so that these do not have to be deduced
      > > from the (static 2D) graphics when I read and play the file.
      >
      > I should have said _default_ duration not 'temporal duration'. The
      > default duration can be overridden/ignored by any person or program
      > playing the score. The default duration is related to the logical width
      > of the symbol, and that's a value which is used to calculate the actual
      > horizontal position of the symbols on the staff. The logical width can't
      > be calculated from the graphics, because its only one of the inputs to
      > the algorithm which justifies the symbols across the staff. But its a
      > value which is known to the author of the graphics. :-)
      >
      > I've already written an Assistant Performer [2] application which does
      > the kind of user-interaction I have in mind. This currently reads scores
      > in CapXML format [3], but when I've created some (extended) SVG it will
      > be easy to make it read that too.
      >
      > Currently I'm developing an Assistant Composer application which will
      > _write_ (extended) SVG. (I'm also working on a long-overdue update of my
      > website.) The Assistant Composer uses rather personal algorithms [4],
      > but I could well imagine that _any_ music authoring program could write
      > the extended SVG I have in mind. My Assistant Performer could play
      > scores written by _any_ music authoring program if they exported my
      > (extended) SVG.
      >
      > If there's anyone out there working in this area, I'd be very interested
      > in cooperating.
      >
      > My mind has been exploding since Alex's post yesterday. Discovered that
      > Inkpen preserves custom markup when reading and saving files... :-))
      >
      > All the best,
      > James
      >
      > [1]
      > http://james-ingram-act-two.de/stockhausen/stockhausenSoftware.freeHandXtras.html
      > [2] http://james-ingram-act-two.de/moritz/moritzAssistantPerformer.html
      > [3] http://www.music-notation.info/de/formats/CapXML.html
      > [4] http://james-ingram-act-two.de/compositions/study2/aboutStudy2.html
      --------------------------------------------------------------------------
      > From: "Helder Magalhães" <helder.magalhaes@...>
      > To: "James Ingram" <j.ingram@...>
      > Cc: <www-svg@...>
      > Sent: Monday, November 01, 2010 7:19 PM
      > Subject: Re: SVG and MIDI
      >
      > > Hi James,
      > >
      > >
      > >> My mind has been exploding since Alex's post yesterday. Discovered that
      > >> Inkpen preserves custom markup when reading and saving files... :-))
      > >
      > > You mean "Inkscape" [1]? ;-)
      > >
      > > Yeah, I guess taking the "develop an Inkscape plug-in" approach is
      > > probably wise for this case. I've seen a few software packages based
      > > on this approach, mostly just to embed metadata which is used for
      > > behavior during run-time.
      > >
      > > I guess you might also find interesting (to mix/analyze/reuse) to know
      > > about Audacity [2], which has some (apparently quite limited) support
      > > for MIDI and whose license seems to be compatible with Inkscape's.
      > >
      > > Probably this is not the most appropriate mailing list for this sort
      > > of details: I'd hint you to place this sort of threads in the SVG
      > > Developers group [3] in the future. ;-)
      > >
      > >
      > >> All the best,
      > >> James
      > >
      > > Hope this helps,
      > > Helder
      > >
      > >
      > > [1] http://inkscape.org/
      > > [2] http://audacity.sourceforge.net/
      > > [3] http://tech.groups.yahoo.com/group/svg-developers
      --------------------------------------------------------------------------
      > From: ddailey <ddailey@...>
      > Date: Mon, 1 Nov 2010 20:34:42 -0400
      > Message-ID: <357BA9C4F35F494D83B8908F364226E5@disxgdg31szkx7>
      > To: Helder Magalhães <helder.magalhaes@...>, "James Ingram" <j.ingram@...>
      > Cc: <www-svg@...>
      > I would echo two of Helder's recommendations: SMIL for synchrony and
      > svg-developers (on yahoo groups) as a forum to exchange such ideas. I've
      > only half tuned into this thread, but for a long time I have wanted some
      > sort of musical markup notation not to annotate music but to compose and
      > play it (and of course interleave with graphical presentations).
      >
      > So something like <chord timber="flute" id="C"><note value="A,0"/><note
      > value="F,0"/><note timber="trombone" value="C,1" hold="C.end+1"/><voice
      > amplitude="7db" modulation="20hx"><animate animateValue="amplitude"
      > from="7db" to="4db" begin="2s" dur="1s" /></chord> could be "played" while
      > I'm doing a variety of other things with HTML and SVG. It would be sort of
      > like having SVG but for sound and it would allow the construction of complex
      > sounds. Maybe there already is something like that but I doubt that it has
      > browser support to let me make music yet. And I somehow doubt that if there
      > is, that they're integrating that closely with SMIL and SVG.
      >
      > (Musical markup : SVG) = (system sounds + audio files : installed fonts
      > +<img> + HTML)
      >
      > Here's some fiddling I did with random music composition using audio clips
      > several years ago:
      > http://srufaculty.sru.edu/david.dailey/javascript/sound/sound3.html (working
      > in at least IE, FF, . I'd like ot do something like that but to have direct
      > access to high level sound creation resources instead of the little
      > percussive voices, nice though they are)
      >
      > cheers
      > David
      --------------------------------------------------------------------------
    • Show all 4 messages in this topic