> I have not been able to figure out the way to dump the output into a midi
file though.

Euterpea has a function called "test" that writes a Music value to a MIDI
file called "test.mid" in the working directory. However, to do this,
Euterpea uses Codec.Midi from the HCodecs library to first create a Midi
value and then write a .mid file. Unfortunately, Codec.Midi seems to have
some bugs in the .mid file conversion, and, as a result, the .mid files are
readable by some programs but not others. If you are on Windows, SynthFont
(free) is usually able to open the files without problems.

-----Donya Quick

On Tue, Mar 5, 2013 at 6:10 AM, CK Kashyap <ck_kash...@yahoo.com> wrote:

> Wow ... it looks much better now!!!
>
> Thank you so much for your feedback Professor Hudak.
>
> I have not been able to figure out the way to dump the output into a midi
> file though.
>
> Regards,
> Kashyap
>
>   ------------------------------
> *From:* "Hudak, Paul" <paul.hu...@yale.edu>
> *To:* CK Kashyap <ck_kash...@yahoo.com>; "haskell-art@lurk.org" <
> haskell-art@lurk.org>
> *Cc:* "Quick, Donya" <donya.qu...@yale.edu>; "Hudak, Paul" <
> paul.hu...@yale.edu>
> *Sent:* Tuesday, March 5, 2013 11:04 AM
> *Subject:* RE: [haskell-art] Review request
>
>   Hi Kashyap. Glad to see someone using Euterpea!  Here are some comments
> that may help you to simplify and clarify your code:
>
>  ·         “Modify (Instrument Percussion) m” can be written “instrument
> Percussion m”.
>  ·         Similarly, “Modify (Phrase [Dyn (Loudness 50)] m” can be
> written “phrase [Dyn (Loudness 50)] m”.
>  ·         When using a percussion instrument, instead of writing, for
> example, “gs 3 en”, you can write “perc PedalHiHat en”, which, although
> longer, is certainly more readable.
>  ·         “line []” is the same as “rest 0”.
>  ·         There is a function “timesM” in Euterpea, so “base n” can be
> eliminated, and you can just write “timesM n base’ ”.
>  ·         There are also function “takeM” and “repeatM”, so that:
> “(line (take (n * 16) (cycle [gs 3 en])))” can be written:
> “takeM (2*n) (repeatM (gs 3 en))”
>  ·         I also wonder if you can take advantage of infinite music
> values in Euterpea.  There is a parallel composition operator (/:=) that
> gives a result with duration equal to the shortest of its two arguments.
> So, for example:
> rhythm = instrument Percussion (repeat (gs 3 en) :=: repeat (c 3 en :+:
> rest en :+: e 3 en :+: rest en))
> … <something similar for base>
> music = (bnr :+: rhythm) /=: (rest 4 :+: t1 :+: t2) /=: base
>
> I haven’t tested any of this, but I hope it’s helpful.
>
> Best wishes,    -Paul
>
> Paul Hudak
> Professor of Computer Science
> Yale University, PO Box 208285
> New Haven, CT 06520-8285, 203-432-1235
>
>  *From:* CK Kashyap [mailto:ck_kash...@yahoo.com]
> *Sent:* Monday, March 04, 2013 7:18 AM
> *To:* haskell-art@lurk.org
> *Subject:* [haskell-art] Review request
>
>  Hi,
>  I tried my hands at composition using Euterpea. It can be found here -
> https://github.com/ckkashyap/LearningPrograms/blob/master/Haskell/haskore/drums.hs
>
>  I'd appreciate it very much if I get some feedback around the level of
> abstraction that I am using.
>
>  Also, I have a quick question on how I could emit a midi file. I am
> using windows.
>
>  Regards,
>  Kashyap
>
>
>
_______________________________________________
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to