[Csnd] An "expressive" dynamics system

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] An "expressive" dynamics system

Zoë Sparks
Hi Csounders,

Over time I've switched to using Csound for all of my electronic
music work; generally I'm thrilled with it. There's just one
feature so far I've found myself missing from other environments:
a system for "human" or "expressive" dynamics as found in music
notation programs like Sibelius or Finale. A lot of the music I
write is in a "traditional Western" style, at least as much as it
has melodies and harmonies and Western scales and so on. I'm used
to writing my music out in Western score format, and it's very
convenient in a notation program to be able to use traditional
dynamic markings (forte, piano, etc.) and have the program work
out the appropriate amplitude for each note on playback. In a
piece with a lot of notes, it can be very tedious to set the
amplitude for each note by hand; I would much rather mark a whole
section "mezzoforte" and have the computer work out the fine
details.

Does anything like this currently exist for Csound? If not, I'll
have a go at writing a score-processing program to accomplish
this.

Best wishes,
Zoë

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Michael Gogins-2
Csound can directly perform musicxml. I wrote this feature. I will see if it is up to the job. If so you can write in a scoring program, save your piece as xml, and render it with csound.

If it's not good enough you can certainly use MIDI files. 

What scoring program do you use? Can you send me a sample musicxml file and a sample MIDI file?

Regards, 
Mike

On Feb 12, 2017 7:23 AM, "Zoë Sparks" <[hidden email]> wrote:
Hi Csounders,

Over time I've switched to using Csound for all of my electronic
music work; generally I'm thrilled with it. There's just one
feature so far I've found myself missing from other environments:
a system for "human" or "expressive" dynamics as found in music
notation programs like Sibelius or Finale. A lot of the music I
write is in a "traditional Western" style, at least as much as it
has melodies and harmonies and Western scales and so on. I'm used
to writing my music out in Western score format, and it's very
convenient in a notation program to be able to use traditional
dynamic markings (forte, piano, etc.) and have the program work
out the appropriate amplitude for each note on playback. In a
piece with a lot of notes, it can be very tedious to set the
amplitude for each note by hand; I would much rather mark a whole
section "mezzoforte" and have the computer work out the fine
details.

Does anything like this currently exist for Csound? If not, I'll
have a go at writing a score-processing program to accomplish
this.

Best wishes,
Zoë

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

jpff
In reply to this post by Zoë Sparks
In a very simple way the beats score generator tries to do this.
Probably simplistic.

==John ff

On Sun, 12 Feb 2017, Zoë Sparks wrote:

> Hi Csounders,
>
> Over time I've switched to using Csound for all of my electronic
> music work; generally I'm thrilled with it. There's just one
> feature so far I've found myself missing from other environments:
> a system for "human" or "expressive" dynamics as found in music
> notation programs like Sibelius or Finale. A lot of the music I
> write is in a "traditional Western" style, at least as much as it
> has melodies and harmonies and Western scales and so on. I'm used
> to writing my music out in Western score format, and it's very
> convenient in a notation program to be able to use traditional
> dynamic markings (forte, piano, etc.) and have the program work
> out the appropriate amplitude for each note on playback. In a
> piece with a lot of notes, it can be very tedious to set the
> amplitude for each note by hand; I would much rather mark a whole
> section "mezzoforte" and have the computer work out the fine
> details.
>
> Does anything like this currently exist for Csound? If not, I'll
> have a go at writing a score-processing program to accomplish
> this.
>
> Best wishes,
> Zoë
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Steven Yi
In reply to this post by Zoë Sparks
Hi Zoë,

I think this is an interesting question of music modeling.  In my
head, the way I might model it is is:

1. Per layer of music, which may be mapped per instrument or per
abstract part, there would be a dynamics variable.
2. Per note, notes would not have dynamics, but might have articulations.

The dynamics might be interpreted by each instrument (well, performer
in a bigger model) and apply the current dynamics when performing the
note.

I've attached a CSD to demonstrate. (There's some commented code
related to strings and channels that caused a problem so ignore
those.)  Some thoughts:

1.  There is instr 1 and 2 provided for setting the dynamics variable.
One sets a value immediately (similar to writing in "pp" or "f" for
dynamics in notation).  The other allows for changing values over time
(i.e., crescendo/descrescendo).  The changing values over time is
using a linear ramp, which isn't ideal, but is here for illustrative
purposes.

2. instr 100 uses the dynamics variable in two ways. First it is used
in the amplitude calculation. Second, it is used in the amount to
modulate the filter cutoff.  (Again, the filter cutoff calculation is
a bit simplistic and should apply an exponential curve of some
sort...)

The design I was going to use with channels should be apparent from
the commented out code, but there seems to be an issue with strings at
the moment.  If it did work, instr 1 and 2 could be made to
generically modify any channel by passing in what channel to modify as
a p-field.  That'd make it useful then for modulating dynamics for
some layers but not others (i.e., "strings descresendo here while
brass crescendos")

Hope that's useful!
steven

On Sun, Feb 12, 2017 at 7:24 AM, Zoë Sparks <[hidden email]> wrote:

> Hi Csounders,
>
> Over time I've switched to using Csound for all of my electronic
> music work; generally I'm thrilled with it. There's just one
> feature so far I've found myself missing from other environments:
> a system for "human" or "expressive" dynamics as found in music
> notation programs like Sibelius or Finale. A lot of the music I
> write is in a "traditional Western" style, at least as much as it
> has melodies and harmonies and Western scales and so on. I'm used
> to writing my music out in Western score format, and it's very
> convenient in a notation program to be able to use traditional
> dynamic markings (forte, piano, etc.) and have the program work
> out the appropriate amplitude for each note on playback. In a
> piece with a lot of notes, it can be very tedious to set the
> amplitude for each note by hand; I would much rather mark a whole
> section "mezzoforte" and have the computer work out the fine
> details.
>
> Does anything like this currently exist for Csound? If not, I'll
> have a go at writing a score-processing program to accomplish
> this.
>
> Best wishes,
> Zoë
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

dynamics.csd (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Steven Yi
John's just fixed up the issue I had with strings, so here's an
updated version that does use the channel system. It uses two
instruments and independently modulates the two layers' dynamics.

On Sun, Feb 12, 2017 at 11:06 AM, Steven Yi <[hidden email]> wrote:

> Hi Zoë,
>
> I think this is an interesting question of music modeling.  In my
> head, the way I might model it is is:
>
> 1. Per layer of music, which may be mapped per instrument or per
> abstract part, there would be a dynamics variable.
> 2. Per note, notes would not have dynamics, but might have articulations.
>
> The dynamics might be interpreted by each instrument (well, performer
> in a bigger model) and apply the current dynamics when performing the
> note.
>
> I've attached a CSD to demonstrate. (There's some commented code
> related to strings and channels that caused a problem so ignore
> those.)  Some thoughts:
>
> 1.  There is instr 1 and 2 provided for setting the dynamics variable.
> One sets a value immediately (similar to writing in "pp" or "f" for
> dynamics in notation).  The other allows for changing values over time
> (i.e., crescendo/descrescendo).  The changing values over time is
> using a linear ramp, which isn't ideal, but is here for illustrative
> purposes.
>
> 2. instr 100 uses the dynamics variable in two ways. First it is used
> in the amplitude calculation. Second, it is used in the amount to
> modulate the filter cutoff.  (Again, the filter cutoff calculation is
> a bit simplistic and should apply an exponential curve of some
> sort...)
>
> The design I was going to use with channels should be apparent from
> the commented out code, but there seems to be an issue with strings at
> the moment.  If it did work, instr 1 and 2 could be made to
> generically modify any channel by passing in what channel to modify as
> a p-field.  That'd make it useful then for modulating dynamics for
> some layers but not others (i.e., "strings descresendo here while
> brass crescendos")
>
> Hope that's useful!
> steven
>
> On Sun, Feb 12, 2017 at 7:24 AM, Zoë Sparks <[hidden email]> wrote:
>> Hi Csounders,
>>
>> Over time I've switched to using Csound for all of my electronic
>> music work; generally I'm thrilled with it. There's just one
>> feature so far I've found myself missing from other environments:
>> a system for "human" or "expressive" dynamics as found in music
>> notation programs like Sibelius or Finale. A lot of the music I
>> write is in a "traditional Western" style, at least as much as it
>> has melodies and harmonies and Western scales and so on. I'm used
>> to writing my music out in Western score format, and it's very
>> convenient in a notation program to be able to use traditional
>> dynamic markings (forte, piano, etc.) and have the program work
>> out the appropriate amplitude for each note on playback. In a
>> piece with a lot of notes, it can be very tedious to set the
>> amplitude for each note by hand; I would much rather mark a whole
>> section "mezzoforte" and have the computer work out the fine
>> details.
>>
>> Does anything like this currently exist for Csound? If not, I'll
>> have a go at writing a score-processing program to accomplish
>> this.
>>
>> Best wishes,
>> Zoë
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

dynamics.csd (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Zoë Sparks
Hi Steven,

That's a neat model! I like the strategy of using the channel system, so
that it's easy to group multiple instruments into layers. That didn't
occur to me. It seems nice to be able to group instruments into
"sections" that can be given dynamic (and other) directions as a group,
to avoid duplicating the same instructions across a number of different
instruments.

One thing that I do want to account for is the way a human performer
will subtly vary the loudness of a note based on things like where the
note falls in a measure. This is mainly what's appealing to me about the
systems in programs like Sibelius and Finale. Sibelius, for example, has
a rule-based system for setting an individual note's amplitude that
takes into account not only the dynamic marking, but also the beat the
note falls on, its pitch, etc. to try to emulate the way a human
performer would play the passage. I like this because a passage of notes
that all have the same amplitude can sound dull, but randomly
introducing variations in amplitude doesn't sound much better to me.

What I was thinking of writing was a score-processing program that could
take a score as input like:

i1 0 .25 8.00 "mf"
i1 + .25 8.00 "."
i1 + .25 8.00 "."
i1 + .25 8.00 "."

and output:

i1 0 .25 8.00 .65
i1 + .25 8.00 .64
i1 + .25 8.00 .645
i1 + .25 8.00 .63

or something—those variations in amplitude might be too subtle but
hopefully the idea comes across. The program could take into
consideration the other information about the note in making its
determination. Of course there are other features that would be nice—a
way to scale the output amplitude overall and to make adjustments for
individual notes comes to mind, for instance. But I think that serves as
a basic example.

It might be nice to have something like this that could apply to layers
or sections as in your model, instead of to individual instruments. One
approach I thought of for this was to employ NoteProcessors in blue,
since that way the external program could work per-instrument but blue
could use it to do the score processing for higher-level organizations
of instruments. The only hangup is I don't see an immediate way to make
a NoteProcessor talk to an external program. I know programmatic
possibilities are available via the PythonProcessor—do you think it
would work to use the commands library
(http://www.jython.org/docs/library/commands.html is what I'm looking
at) to pass the score to be processed to an external utility?

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Zoë Sparks
In reply to this post by Michael Gogins-2
> Csound can directly perform musicxml. I wrote this feature. I will see if
> it is up to the job. If so you can write in a scoring program, save your
> piece as xml, and render it with csound.
>
> If it's not good enough you can certainly use MIDI files.

I've actually done this with MIDI, using output from Sibelius, and it
works fine.  The reason I'd like to have a native Csound-oriented system
is that I'm trying to switch over entirely to using free and open-source
software for music production, for a number of personal reasons. The
best notation program of this sort I know of is MuseScore, and although
it works well for preparing scores, its system for setting dynamics is
very simple compared to the popular commercial notation programs. As far
as I can tell, it sets a flat velocity for each note within a dynamic
section. So, I'd like a more complex system to use in this context.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Michael Gogins-2
What about LilyPond?

Regards,
Mike

On Feb 12, 2017 9:56 PM, "Zoë Sparks" <[hidden email]> wrote:
> Csound can directly perform musicxml. I wrote this feature. I will see if
> it is up to the job. If so you can write in a scoring program, save your
> piece as xml, and render it with csound.
>
> If it's not good enough you can certainly use MIDI files.

I've actually done this with MIDI, using output from Sibelius, and it
works fine.  The reason I'd like to have a native Csound-oriented system
is that I'm trying to switch over entirely to using free and open-source
software for music production, for a number of personal reasons. The
best notation program of this sort I know of is MuseScore, and although
it works well for preparing scores, its system for setting dynamics is
very simple compared to the popular commercial notation programs. As far
as I can tell, it sets a flat velocity for each note within a dynamic
section. So, I'd like a more complex system to use in this context.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Zoë Sparks
Hi Mike,

I think LilyPond also applies a flat volume for each dynamic
marking:
http://lilypond.org/doc/v2.18/Documentation/notation/controlling-midi-dynamics.
Although, it seems nice how it handles other markings like
tremelos and trills in the MIDI output too.

Best wishes,
Zoë

Excerpts from Michael Gogins's message of 2017-02-12 22:17:48 -0500:

> What about LilyPond?
>
> Regards,
> Mike
>
> On Feb 12, 2017 9:56 PM, "Zoë Sparks" <[hidden email]> wrote:
>
> > > Csound can directly perform musicxml. I wrote this feature. I will see if
> > > it is up to the job. If so you can write in a scoring program, save your
> > > piece as xml, and render it with csound.
> > >
> > > If it's not good enough you can certainly use MIDI files.
> >
> > I've actually done this with MIDI, using output from Sibelius, and it
> > works fine.  The reason I'd like to have a native Csound-oriented system
> > is that I'm trying to switch over entirely to using free and open-source
> > software for music production, for a number of personal reasons. The
> > best notation program of this sort I know of is MuseScore, and although
> > it works well for preparing scores, its system for setting dynamics is
> > very simple compared to the popular commercial notation programs. As far
> > as I can tell, it sets a flat velocity for each note within a dynamic
> > section. So, I'd like a more complex system to use in this context.
> >
> > Csound mailing list
> > [hidden email]
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> >         https://github.com/csound/csound/issues
> > Discussions of bugs and features can be posted here
> >
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

akjmicro
In reply to this post by Zoë Sparks
Hi Zoë,

This is an interesting AI or "expert systems" type problem: given a symbolic notation for a piece, render something close to an ideal expressively phrased (via dynamics or articulation) audio output.

For what it's worth, I second the idea that the quickest way to do this may actually be to just be a great (or decent) performer and record actual MIDI input with a sequencer, even if under-tempo.

But, I can understand that this isn't always ideal, and I often work in situations myself where that becomes impractical: microtonal compositions where you may have an impractical number of pitches per octave. Although I've not developed any kind of _automatic_ dynamics system for it yet, my "microcsound" program does allow for entering dynamics via '@' directives in its notation system. (You can of course, use microcsound for normal 12-equal composing, in spite of the name). It's close enough in syntax to abcm2ps input (an extension of the abc score language) that in theory, you can translate a microcsound score into "abc" notation if you have decent regex or scripting chops (I've yet to develop a handy tool for this to be an automatic procedure, even though I have done it...and in any event, I'm always doing my expressive massaging of pieces that start life as microcsound scores "by hand", something which takes a while :) ).

Bottom line: I'm not aware of any open-source tools that at least automatically understand common musical contexts like meter, accent, etc. and give a decent starting-point rendering. If you come across any, do share! 

Best,
AKJ

Aaron Krister Johnson
http://www.untwelve.org

On Sun, Feb 12, 2017 at 8:57 PM, Zoë Sparks <[hidden email]> wrote:
> Csound can directly perform musicxml. I wrote this feature. I will see if
> it is up to the job. If so you can write in a scoring program, save your
> piece as xml, and render it with csound.
>
> If it's not good enough you can certainly use MIDI files.

I've actually done this with MIDI, using output from Sibelius, and it
works fine.  The reason I'd like to have a native Csound-oriented system
is that I'm trying to switch over entirely to using free and open-source
software for music production, for a number of personal reasons. The
best notation program of this sort I know of is MuseScore, and although
it works well for preparing scores, its system for setting dynamics is
very simple compared to the popular commercial notation programs. As far
as I can tell, it sets a flat velocity for each note within a dynamic
section. So, I'd like a more complex system to use in this context.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Michael Gogins-2
In reply to this post by Zoë Sparks
More on this.

I have just learned of a Python library for generating expressive
scores, called Abjad, available at http://projectabjad.org/ and
https://github.com/Abjad.

This library contains a facility for exporting PDFs of scores (using
LilyPond) and exporting "high quality" MIDI files.

I installed Abjad on my Ubuntu computer and got it to work with no
problems. I have not tried any complex examples, but it looks like you
can generate scores by programming in Python, and then output the
scores as PDFs, .ly files, or .midi files.

My wife and I are flying to Melbourne, Australia this evening to stay
for two months, but when we are settled there I will be firing up
Abjad and trying to do some reasonably complex generative scores with
expressive tempo and dynamics.

If the MIDI output really is "high quality" when rendered by Csound, I
will stop there. Otherwise I will consider extending the output
formats of Abjad to include Csound .sco or .csd files.

More soon!

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Feb 12, 2017 at 10:33 PM, Zoë Sparks <[hidden email]> wrote:

> Hi Mike,
>
> I think LilyPond also applies a flat volume for each dynamic
> marking:
> http://lilypond.org/doc/v2.18/Documentation/notation/controlling-midi-dynamics.
> Although, it seems nice how it handles other markings like
> tremelos and trills in the MIDI output too.
>
> Best wishes,
> Zoë
>
> Excerpts from Michael Gogins's message of 2017-02-12 22:17:48 -0500:
>> What about LilyPond?
>>
>> Regards,
>> Mike
>>
>> On Feb 12, 2017 9:56 PM, "Zoë Sparks" <[hidden email]> wrote:
>>
>> > > Csound can directly perform musicxml. I wrote this feature. I will see if
>> > > it is up to the job. If so you can write in a scoring program, save your
>> > > piece as xml, and render it with csound.
>> > >
>> > > If it's not good enough you can certainly use MIDI files.
>> >
>> > I've actually done this with MIDI, using output from Sibelius, and it
>> > works fine.  The reason I'd like to have a native Csound-oriented system
>> > is that I'm trying to switch over entirely to using free and open-source
>> > software for music production, for a number of personal reasons. The
>> > best notation program of this sort I know of is MuseScore, and although
>> > it works well for preparing scores, its system for setting dynamics is
>> > very simple compared to the popular commercial notation programs. As far
>> > as I can tell, it sets a flat velocity for each note within a dynamic
>> > section. So, I'd like a more complex system to use in this context.
>> >
>> > Csound mailing list
>> > [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>> >
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

akjmicro
Cool and exciting, Michael! Keep us informed about your progress.

-AKJ

Aaron Krister Johnson
http://www.untwelve.org

On Mon, Feb 13, 2017 at 9:11 AM, Michael Gogins <[hidden email]> wrote:
More on this.

I have just learned of a Python library for generating expressive
scores, called Abjad, available at http://projectabjad.org/ and
https://github.com/Abjad.

This library contains a facility for exporting PDFs of scores (using
LilyPond) and exporting "high quality" MIDI files.

I installed Abjad on my Ubuntu computer and got it to work with no
problems. I have not tried any complex examples, but it looks like you
can generate scores by programming in Python, and then output the
scores as PDFs, .ly files, or .midi files.

My wife and I are flying to Melbourne, Australia this evening to stay
for two months, but when we are settled there I will be firing up
Abjad and trying to do some reasonably complex generative scores with
expressive tempo and dynamics.

If the MIDI output really is "high quality" when rendered by Csound, I
will stop there. Otherwise I will consider extending the output
formats of Abjad to include Csound .sco or .csd files.

More soon!

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Feb 12, 2017 at 10:33 PM, Zoë Sparks <[hidden email]> wrote:
> Hi Mike,
>
> I think LilyPond also applies a flat volume for each dynamic
> marking:
> http://lilypond.org/doc/v2.18/Documentation/notation/controlling-midi-dynamics.
> Although, it seems nice how it handles other markings like
> tremelos and trills in the MIDI output too.
>
> Best wishes,
> Zoë
>
> Excerpts from Michael Gogins's message of 2017-02-12 22:17:48 -0500:
>> What about LilyPond?
>>
>> Regards,
>> Mike
>>
>> On Feb 12, 2017 9:56 PM, "Zoë Sparks" <[hidden email]> wrote:
>>
>> > > Csound can directly perform musicxml. I wrote this feature. I will see if
>> > > it is up to the job. If so you can write in a scoring program, save your
>> > > piece as xml, and render it with csound.
>> > >
>> > > If it's not good enough you can certainly use MIDI files.
>> >
>> > I've actually done this with MIDI, using output from Sibelius, and it
>> > works fine.  The reason I'd like to have a native Csound-oriented system
>> > is that I'm trying to switch over entirely to using free and open-source
>> > software for music production, for a number of personal reasons. The
>> > best notation program of this sort I know of is MuseScore, and although
>> > it works well for preparing scores, its system for setting dynamics is
>> > very simple compared to the popular commercial notation programs. As far
>> > as I can tell, it sets a flat velocity for each note within a dynamic
>> > section. So, I'd like a more complex system to use in this context.
>> >
>> > Csound mailing list
>> > [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>> >
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Zoë Sparks
Yes, this does sound interesting! I can't quite tell what sorts of
things Abjad takes into account when doing its MIDI rendering, just
looking at the docs, but I'm definitely curious. I'm excited to hear
what you turn up! I'll try it out as well and see what happens. It
sounds like a neat system in general, too.

Best,
Zoë

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

confused
you could do some things with randomizers adding/subtracting each time to the amplitude if you just want to switch it up. Usually if you want something to sound more "live" it's not a dynamics issue, its varying the partial weights within the duration and what not. 

/* Joe */

On Mon, Feb 13, 2017 at 4:43 PM, Zoë Sparks <[hidden email]> wrote:
Yes, this does sound interesting! I can't quite tell what sorts of
things Abjad takes into account when doing its MIDI rendering, just
looking at the docs, but I'm definitely curious. I'm excited to hear
what you turn up! I'll try it out as well and see what happens. It
sounds like a neat system in general, too.

Best,
Zoë

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Steven Yi
In reply to this post by Zoë Sparks
Hi Zoe,

Yes, that info points to a need for a more complex model. :)  I use a
simplistic Performer object system myself, and the code looks
something like:

[score] -> [Performer.playNotes()] -> [modified score] -> [Csound instruments]

I write one score, the performer has attributes like stereo spatial
location and amplitude adjustment, and the performer "performs" the
notes by adding in pfields for space and processing of amplitude.  The
performance functions could be defined on a per performer object basis
I think.  It would be there that I would, in my own model, apply
performance adjustments (i.e., add or multiply random, adjust
amp/pitch/etc. based upon where in time the note hits, etc.).  Most of
my pieces in Blue use some form of this model.  (There's an additional
layer called PerformerGroup that can receive score and distribute to
each performer in the group, as well as has it's own group performance
methods that take in values and generates things like Xenakis-like
surfaces using multiple performer objects.)

It would be nice to use something like dynamics too, but I have
largely done just variation using p-fields.  A dynamics system could
be not too tricky to add by using a BlueSynthBuilder instrument and
adding a Knob for dynamics, which would then be automatable on the
timeline.  That'd be an additional control from the standard mixer
fader for the instrument (the former might be used for more of a
compositional view, while the latter used for more a mastering view of
the work).

For my own practice in Blue, I tend to use an initial layer where I
have Python objects that define performer objects and performer
groups. I usually have an additional object to define performance
functions per-piece.  Then through the rest of the score, I use the
objects to perform notes I notate on a per-SoundObject basis.  I
imagine you could also use a NoteProcessor to write performance code
and add it to the object, layer, or score to process at various
levels.  Using an external command processor should work using
jython/python's commands for external process execution, but I think
that might be a bit slow and it would also add a project dependency.

Hope that's useful!
steven





On Sun, Feb 12, 2017 at 9:39 PM, Zoë Sparks <[hidden email]> wrote:

> Hi Steven,
>
> That's a neat model! I like the strategy of using the channel system, so
> that it's easy to group multiple instruments into layers. That didn't
> occur to me. It seems nice to be able to group instruments into
> "sections" that can be given dynamic (and other) directions as a group,
> to avoid duplicating the same instructions across a number of different
> instruments.
>
> One thing that I do want to account for is the way a human performer
> will subtly vary the loudness of a note based on things like where the
> note falls in a measure. This is mainly what's appealing to me about the
> systems in programs like Sibelius and Finale. Sibelius, for example, has
> a rule-based system for setting an individual note's amplitude that
> takes into account not only the dynamic marking, but also the beat the
> note falls on, its pitch, etc. to try to emulate the way a human
> performer would play the passage. I like this because a passage of notes
> that all have the same amplitude can sound dull, but randomly
> introducing variations in amplitude doesn't sound much better to me.
>
> What I was thinking of writing was a score-processing program that could
> take a score as input like:
>
> i1 0 .25 8.00 "mf"
> i1 + .25 8.00 "."
> i1 + .25 8.00 "."
> i1 + .25 8.00 "."
>
> and output:
>
> i1 0 .25 8.00 .65
> i1 + .25 8.00 .64
> i1 + .25 8.00 .645
> i1 + .25 8.00 .63
>
> or something—those variations in amplitude might be too subtle but
> hopefully the idea comes across. The program could take into
> consideration the other information about the note in making its
> determination. Of course there are other features that would be nice—a
> way to scale the output amplitude overall and to make adjustments for
> individual notes comes to mind, for instance. But I think that serves as
> a basic example.
>
> It might be nice to have something like this that could apply to layers
> or sections as in your model, instead of to individual instruments. One
> approach I thought of for this was to employ NoteProcessors in blue,
> since that way the external program could work per-instrument but blue
> could use it to do the score processing for higher-level organizations
> of instruments. The only hangup is I don't see an immediate way to make
> a NoteProcessor talk to an external program. I know programmatic
> possibilities are available via the PythonProcessor—do you think it
> would work to use the commands library
> (http://www.jython.org/docs/library/commands.html is what I'm looking
> at) to pass the score to be processed to an external utility?
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Zoë Sparks
In reply to this post by akjmicro
Hi Aaron,

> This is an interesting AI or "expert systems" type problem: given a
> symbolic notation for a piece, render something close to an ideal
> expressively phrased (via dynamics or articulation) audio output.

I think that's definitely true for the highest-level versions of
software like this. Although I haven't used it, I've heard the latest
version of Finale has a very sophisticated playback system that might be
along these lines. I could probably do fine with a cruder system,
though, since I can always go in and touch up the results afterwards if
needed. If I wanted something for live performance I'd be more
concerned.

The version of Sibelius I have access to has a simpler rule-based
system, or so I've read at least. I've been thinking about writing a
series of test scores to investigate what rules it's using, and then
writing a reasonable emulation of it as a command-line Csound score
processing program. I think if it was a system as complex as you're
describing, that would be impractical; as far as I can tell it's
relatively simple, and works well enough for my needs. It helps that I'm
only thinking about simple dynamic markings—leaving out articulations,
slurs, etc. constricts the problem domain a lot. If it turns out that
Abjad already has this covered, of course, there's no need.

> For what it's worth, I second the idea that the quickest way to do this may
> actually be to just be a great (or decent) performer and record actual MIDI
> input with a sequencer, even if under-tempo.

Definitely, yeah. I'd record my parts myself with a MIDI controller if I
had one, but cash is too tight for me to be able to pick one up. :p That
also takes extra time, so having a system like this would be convenient.

> But, I can understand that this isn't always ideal, and I often work in
> situations myself where that becomes impractical: microtonal compositions
> where you may have an impractical number of pitches per octave.

Yeah, I sometimes dip into territory like this as well, or other
impractical-to-play passages (I'm usually working with 12 pitches per
octave but I don't hold myself to that strictly :p and I'm interested in
semi-random rhythmic ideas and such). That is one nice thing about an
algorithmic approach—it's not limited by physical restrictions,
determinism, etc.

> I've not developed any kind of _automatic_ dynamics system for it yet, my
> "microcsound" program does allow for entering dynamics via '@' directives
> in its notation system. (You can of course, use microcsound for normal
> 12-equal composing, in spite of the name).

Cool software!! I looked over the manual—it seems like it makes
writing in microtonal scales very convenient, and I liked the complex
accidental system. The example /Puhlops and Laugua's Big Adventure/
piece was super fun too—I'm really enjoying the work you have up on
SoundCloud.

Best,
Zoë

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Zoë Sparks
In reply to this post by Steven Yi
Hi Steven,

> A dynamics system could be not too tricky to add by using a
> BlueSynthBuilder instrument and adding a Knob for dynamics, which
> would then be automatable on the timeline.  That'd be an additional
> control from the standard mixer fader for the instrument (the former
> might be used for more of a compositional view, while the latter used
> for more a mastering view of the work).

Oh, I really like that idea! Seems like it would be nice to allow
on-the-fly experimentation.

> Using an external command processor should work using jython/python's
> commands for external process execution, but I think that might be a
> bit slow and it would also add a project dependency.

Hearing you describe this, I'm thinking maybe the best thing to do would
be to create a library that could be used natively from within Blue and
also create a command-line frontend to the library that could be used
independently. That would allow more elegant constructions from within
Blue while preserving the freedom of the library to be used with vanilla
Csound or other Csound frontends.

Thanks for describing your approach with Performer objects! That seems
like a pleasantly flexible way of adding additional dimensions to
scores, groups of scores, etc. It's neat how that approach opens up
straightforward ways to place musical voices "in space" in a wide
variety of ways. I'm thinking a lot about the possilbities that presents
for constructing musical terrains and so on now.

Best,
Zoë

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Michael Gogins-2
In reply to this post by Zoë Sparks
I have experimented with Abjad. It seems to use standard LilyPond MIDI
output. My experiment produced satisfactory note to note dynamics. The
LilyPond documentation indicates that crescendos and decrescendos are
applied across groups of notes. There is no indication of a "swell"
within one note.

I am quite impressed by Abjad in general and will have more to say
regarding that. The results I have seen are quite impressive and Abjad
itself worked "right out of the box." I am working on an example that
uses Csound to render an Abjad composition to audio. I will share this
example when it is complete.

Regards,
Mike



-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Feb 13, 2017 at 2:33 PM, Zoë Sparks <[hidden email]> wrote:

> Hi Mike,
>
> I think LilyPond also applies a flat volume for each dynamic
> marking:
> http://lilypond.org/doc/v2.18/Documentation/notation/controlling-midi-dynamics.
> Although, it seems nice how it handles other markings like
> tremelos and trills in the MIDI output too.
>
> Best wishes,
> Zoë
>
> Excerpts from Michael Gogins's message of 2017-02-12 22:17:48 -0500:
>> What about LilyPond?
>>
>> Regards,
>> Mike
>>
>> On Feb 12, 2017 9:56 PM, "Zoë Sparks" <[hidden email]> wrote:
>>
>> > > Csound can directly perform musicxml. I wrote this feature. I will see if
>> > > it is up to the job. If so you can write in a scoring program, save your
>> > > piece as xml, and render it with csound.
>> > >
>> > > If it's not good enough you can certainly use MIDI files.
>> >
>> > I've actually done this with MIDI, using output from Sibelius, and it
>> > works fine.  The reason I'd like to have a native Csound-oriented system
>> > is that I'm trying to switch over entirely to using free and open-source
>> > software for music production, for a number of personal reasons. The
>> > best notation program of this sort I know of is MuseScore, and although
>> > it works well for preparing scores, its system for setting dynamics is
>> > very simple compared to the popular commercial notation programs. As far
>> > as I can tell, it sets a flat velocity for each note within a dynamic
>> > section. So, I'd like a more complex system to use in this context.
>> >
>> > Csound mailing list
>> > [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>> >
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

Steven Yi
Thanks Michael for sharing your insights. I'm looking forward to the example.

On Mon, Feb 20, 2017 at 12:51 AM, Michael Gogins
<[hidden email]> wrote:

> I have experimented with Abjad. It seems to use standard LilyPond MIDI
> output. My experiment produced satisfactory note to note dynamics. The
> LilyPond documentation indicates that crescendos and decrescendos are
> applied across groups of notes. There is no indication of a "swell"
> within one note.
>
> I am quite impressed by Abjad in general and will have more to say
> regarding that. The results I have seen are quite impressive and Abjad
> itself worked "right out of the box." I am working on an example that
> uses Csound to render an Abjad composition to audio. I will share this
> example when it is complete.
>
> Regards,
> Mike
>
>
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Mon, Feb 13, 2017 at 2:33 PM, Zoë Sparks <[hidden email]> wrote:
>> Hi Mike,
>>
>> I think LilyPond also applies a flat volume for each dynamic
>> marking:
>> http://lilypond.org/doc/v2.18/Documentation/notation/controlling-midi-dynamics.
>> Although, it seems nice how it handles other markings like
>> tremelos and trills in the MIDI output too.
>>
>> Best wishes,
>> Zoë
>>
>> Excerpts from Michael Gogins's message of 2017-02-12 22:17:48 -0500:
>>> What about LilyPond?
>>>
>>> Regards,
>>> Mike
>>>
>>> On Feb 12, 2017 9:56 PM, "Zoë Sparks" <[hidden email]> wrote:
>>>
>>> > > Csound can directly perform musicxml. I wrote this feature. I will see if
>>> > > it is up to the job. If so you can write in a scoring program, save your
>>> > > piece as xml, and render it with csound.
>>> > >
>>> > > If it's not good enough you can certainly use MIDI files.
>>> >
>>> > I've actually done this with MIDI, using output from Sibelius, and it
>>> > works fine.  The reason I'd like to have a native Csound-oriented system
>>> > is that I'm trying to switch over entirely to using free and open-source
>>> > software for music production, for a number of personal reasons. The
>>> > best notation program of this sort I know of is MuseScore, and although
>>> > it works well for preparing scores, its system for setting dynamics is
>>> > very simple compared to the popular commercial notation programs. As far
>>> > as I can tell, it sets a flat velocity for each note within a dynamic
>>> > section. So, I'd like a more complex system to use in this context.
>>> >
>>> > Csound mailing list
>>> > [hidden email]
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> > Send bugs reports to
>>> >         https://github.com/csound/csound/issues
>>> > Discussions of bugs and features can be posted here
>>> >
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] An "expressive" dynamics system

luis jure
In reply to this post by Michael Gogins-2
el 2017-02-20 a las 16:51 Michael Gogins escribió:

> I have experimented with Abjad. It seems to use standard LilyPond MIDI
> output. My experiment produced satisfactory note to note dynamics. The
> LilyPond documentation indicates that crescendos and decrescendos are
> applied across groups of notes. There is no indication of a "swell"
> within one note.

i haven't used lilypond lately, but the last i knew, lilypond couldn't
handle dynamics properly. dynamic markings were treated as *volume*
changes, and not as velocity values, as they should. that means that a
crescendo sounds like the same dynamic with someone turning the volume
knob up. have they improved that? from what i can gather from the latest
version of the manual, apparently not.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
12
Loading...