Csound Csound-dev Csound-tekno Search About

[Csnd] Modification to John Ffitch's library for generation of fully integrable MIDI files

Date2012-12-05 16:25
FromAlfonso Peduto
Subject[Csnd] Modification to John Ffitch's library for generation of fully integrable MIDI files
Hi everybody,

my name is Alfonso and I am a new Csound-er based in Boston.
I wanted to share with you a small instance of my my work which I think it might be of interested to anybody captivated in (broadly speaking) computer generated music.

In the "Audio Programming Book" (Richard Boulanger, ed,  MIT press) in chapter 16 of the attached DVD, John Ffitch presents a wonderfully compact and efficient library for generating MIDI files. This opens up endless possibilities for algorithmic compositional processes.

Unfortunately, as presented, the library produces files which not integrable with any modern DAW: trying to import a MIDI file in, say, Logic, Finale, Digital Performer etc.. will prompt to different error messages.



I therefore use for my own work the following modification of the program, which enables fully integrable MIDI files.
in "basic.c" line 140 reads

print_short_be(fout, 0xe728);

replace such with

print_short_be(fout, 0x1e0); 

This will change the time division of the MIDI file from milliseconds to the now standard pulse per quarter note (in this specific case 480).

Of course, now, as the general framework is slightly changed, when coding music one must keep in mind that a quarter note in this specification corresponds to 480, and work in accordance. Specifically when uses the function add_note(pitch, volume instr, when, lenght), both "when" and "lenght" now have to be given in PPQN.



This small change enables full integration with any major present day DAW like Logic, Pro Tools, Cubase, Digital Perfomer as well as Finale and Sibelius.

Hope this might be helpful to somebody!

Best,
 
--
Alfonso Peduto
President, Society of Composers
Berklee College of Music




Date2012-12-05 17:53
FromRory Walsh
SubjectRe: [Csnd] Modification to John Ffitch's library for generation of
> function add_note(pitch, volume instr, when, lenght), both "when" and
> "lenght" now have to be given in PPQN.

Or perhaps the function add_note() should take time values and then
convert them to PPQN so the user doesn't have to think about PPQN at
all. That might simplify things for the end users of the library.
Maybe, I am not familiar with that particular chapter, but it's on my
list of things to get through!

Date2012-12-05 18:36
FromAlfonso Peduto
SubjectRe: [Csnd] Modification to John Ffitch's library for generation of
Yes indeed, that can also be implemented!

In my own library modification I have defined global variables for quarter, eight, whole, eight triplets etc.. durations (in PPQN) so the user can think in terms of musical durations instead of milliseconds.


-- 
Alfonso Peduto
President, Society of Composers
Berklee College of Music



On Wed, Dec 5, 2012 at 12:53 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
> function add_note(pitch, volume instr, when, lenght), both "when" and
> "lenght" now have to be given in PPQN.

Or perhaps the function add_note() should take time values and then
convert them to PPQN so the user doesn't have to think about PPQN at
all. That might simplify things for the end users of the library.
Maybe, I am not familiar with that particular chapter, but it's on my
list of things to get through!


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






Date2013-03-03 03:21
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] Modification to John Ffitch's library for generation of
Alfonso,

Thanks so much for debugging this code and sharing it with all of us.

dr.B.

Dr. Richard Boulanger, Ph.D.   

Professor of Electronic Production and Design

Professional Writing and Music Technology Division

Office @ 161 Mass Ave - 4th Floor

617-747-2485 (office)  774-488-9166 (cell)

http://csounds.com/boulanger     http://csounds.com/mathews

http://boulangerlabs.com    http://csoundforlive.com   http://csounds.com



On Wed, Dec 5, 2012 at 11:25 AM, Alfonso Peduto <apeduto@berklee.edu> wrote:
Hi everybody,

my name is Alfonso and I am a new Csound-er based in Boston.
I wanted to share with you a small instance of my my work which I think it might be of interested to anybody captivated in (broadly speaking) computer generated music.

In the "Audio Programming Book" (Richard Boulanger, ed,  MIT press) in chapter 16 of the attached DVD, John Ffitch presents a wonderfully compact and efficient library for generating MIDI files. This opens up endless possibilities for algorithmic compositional processes.

Unfortunately, as presented, the library produces files which not integrable with any modern DAW: trying to import a MIDI file in, say, Logic, Finale, Digital Performer etc.. will prompt to different error messages.



I therefore use for my own work the following modification of the program, which enables fully integrable MIDI files.
in "basic.c" line 140 reads

print_short_be(fout, 0xe728);

replace such with

print_short_be(fout, 0x1e0); 

This will change the time division of the MIDI file from milliseconds to the now standard pulse per quarter note (in this specific case 480).

Of course, now, as the general framework is slightly changed, when coding music one must keep in mind that a quarter note in this specification corresponds to 480, and work in accordance. Specifically when uses the function add_note(pitch, volume instr, when, lenght), both "when" and "lenght" now have to be given in PPQN.



This small change enables full integration with any major present day DAW like Logic, Pro Tools, Cubase, Digital Perfomer as well as Finale and Sibelius.

Hope this might be helpful to somebody!

Best,
 
--
Alfonso Peduto
President, Society of Composers
Berklee College of Music