ANN: Haskore tutorial (programming music using Haskell)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ANN: Haskore tutorial (programming music using Haskell)

Jinjing Wang
Hi there,

Here's the project link:

http://github.com/nfjinjing/haskore-guide/tree/master/doc/index.markdown

I found Haskore pretty fun :) so I'm documenting it while learning it.
Please don't hesitate to give suggestions / corrections.

Questions:

* How much music theory should be there ? ( I'm gonna learn those anyway )
* What kind of examples would be cool ?

regards,

jinjing
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Haskore tutorial (programming music using Haskell)

Henning Thielemann


On Tue, 5 Aug 2008, jinjing wrote:

> Here's the project link:
>
> http://github.com/nfjinjing/haskore-guide/tree/master/doc/index.markdown

Would you like to post this to
   [hidden email]
 as well?
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Haskore tutorial (programming music using Haskell)

José Pedro Magalhães
In reply to this post by Jinjing Wang
Hi Jinjing,

I remember having written a report on Haskore some years ago, together with a classmate. I think that the example of transformations in twelve-tone technique (see [1]) is one that looks very nice in Haskore due to its simplicity. It's also simple to present to people who do not know music theory, but are (minimally) mathematically inclined.


Cheers,
Pedro

[1] http://en.wikipedia.org/wiki/Twelve-tone_technique#Tone_row

On Tue, Aug 5, 2008 at 10:59, jinjing <[hidden email]> wrote:
Hi there,

Here's the project link:

http://github.com/nfjinjing/haskore-guide/tree/master/doc/index.markdown

I found Haskore pretty fun :) so I'm documenting it while learning it.
Please don't hesitate to give suggestions / corrections.

Questions:

* How much music theory should be there ? ( I'm gonna learn those anyway )
* What kind of examples would be cool ?

regards,

jinjing
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Haskore tutorial (programming music using Haskell)

Henk-Jan van Tuyl
In reply to this post by Jinjing Wang
On Tue, 05 Aug 2008 10:59:10 +0200, jinjing <[hidden email]> wrote:

> Hi there,
>
> Here's the project link:
>
> http://github.com/nfjinjing/haskore-guide/tree/master/doc/index.markdown
>
> I found Haskore pretty fun :) so I'm documenting it while learning it.
> Please don't hesitate to give suggestions / corrections.
>


About the installation section: I think beginners will be grateful if you  
write down the full "darcs get" commands and explain the --global  
parameter of the "cabal install" command.

There are two more packages that need to be downloaded:
  - package hosc depends on package binary
  - package haskore depends on package unix

Windows users will be grateful if you tell them that Haskore cannot be  
built on Windows, because of the dependance on the unix package. It would  
have saved me a lot of time if I knew that beforehand.



For the people interested in porting Haskore to Windows I'll describe what  
I have done so far:

src\Haskore\Basic\Timer\Posix.hs:
System.Posix.Unistd.usleep replaced by Control.Concurrent.threadDelay
(of course, the name of the file is not correct after this; better put the  
timer function in another file)


File Haskore.cabal:
removed "unix" from section "Build-depends"

Added to cabal file:
    if os(windows)
         cpp-options: -DWIN32

Added to src\Haskore\Interface\CSound\Play.lhs:
> {-# OPTIONS -cpp #-}

and around the signal handling part and the line
> import qualified System.Posix.Signals as Signals
:

#ifndef WIN32
...
#endif


Same treatment for src/Haskore/Interface/MIDI/Play.lhs

Finally I discovered that in the file
   src/Haskore/Interface/SuperCollider/Channel/Env.hs
environment variables are set and that there is no setEnv or putEnv for  
Windows.
GCC knows the function setenv(), but that function does not work as  
expected (on Windows); once the program terminates, the created  
environment variable has dissapeared. After I discovered that, I decided  
it would be too much yak shaving for me to go on. To solve this problem,  
on would either create an improved setenv() function, or redesign Haskore  
to pass the information some other way (and of course the program(s) that  
read this information).


--
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Haskore tutorial (programming music using Haskell)

Jinjing Wang
Thanks Henk-Jan van Tuyl,

It's been updated/changed accordingly.

jinjing

On Fri, Aug 8, 2008 at 1:42 AM, Henk-Jan van Tuyl <[hidden email]> wrote:

> On Tue, 05 Aug 2008 10:59:10 +0200, jinjing <[hidden email]> wrote:
>
>> Hi there,
>>
>> Here's the project link:
>>
>> http://github.com/nfjinjing/haskore-guide/tree/master/doc/index.markdown
>>
>> I found Haskore pretty fun :) so I'm documenting it while learning it.
>> Please don't hesitate to give suggestions / corrections.
>>
>
>
> About the installation section: I think beginners will be grateful if you
> write down the full "darcs get" commands and explain the --global parameter
> of the "cabal install" command.
>
> There are two more packages that need to be downloaded:
>  - package hosc depends on package binary
>  - package haskore depends on package unix
>
> Windows users will be grateful if you tell them that Haskore cannot be built
> on Windows, because of the dependance on the unix package. It would have
> saved me a lot of time if I knew that beforehand.
>
>
>
> For the people interested in porting Haskore to Windows I'll describe what I
> have done so far:
>
> src\Haskore\Basic\Timer\Posix.hs:
> System.Posix.Unistd.usleep replaced by Control.Concurrent.threadDelay
> (of course, the name of the file is not correct after this; better put the
> timer function in another file)
>
>
> File Haskore.cabal:
> removed "unix" from section "Build-depends"
>
> Added to cabal file:
>   if os(windows)
>        cpp-options: -DWIN32
>
> Added to src\Haskore\Interface\CSound\Play.lhs:
>>
>> {-# OPTIONS -cpp #-}
>
> and around the signal handling part and the line
>>
>> import qualified System.Posix.Signals as Signals
>
> :
>
> #ifndef WIN32
> ...
> #endif
>
>
> Same treatment for src/Haskore/Interface/MIDI/Play.lhs
>
> Finally I discovered that in the file
>  src/Haskore/Interface/SuperCollider/Channel/Env.hs
> environment variables are set and that there is no setEnv or putEnv for
> Windows.
> GCC knows the function setenv(), but that function does not work as expected
> (on Windows); once the program terminates, the created environment variable
> has dissapeared. After I discovered that, I decided it would be too much yak
> shaving for me to go on. To solve this problem, on would either create an
> improved setenv() function, or redesign Haskore to pass the information some
> other way (and of course the program(s) that read this information).
>
>
> --
> Met vriendelijke groet,
> Henk-Jan van Tuyl
>
>
> --
> http://functor.bamikanarie.com
> http://Van.Tuyl.eu/
> --
>
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Haskore tutorial (programming music using Haskell)

Henning Thielemann
In reply to this post by Henk-Jan van Tuyl

On Thu, 7 Aug 2008, Henk-Jan van Tuyl wrote:

> On Tue, 05 Aug 2008 10:59:10 +0200, jinjing <[hidden email]> wrote:
>
> > Hi there,
> >
> > Here's the project link:
> >
> > http://github.com/nfjinjing/haskore-guide/tree/master/doc/index.markdown
> >
> > I found Haskore pretty fun :) so I'm documenting it while learning it.
> > Please don't hesitate to give suggestions / corrections.
> >
>
>
> About the installation section: I think beginners will be grateful if you
> write down the full "darcs get" commands and explain the --global
> parameter of the "cabal install" command.
>
> There are two more packages that need to be downloaded:
>   - package hosc depends on package binary
>   - package haskore depends on package unix
>
> Windows users will be grateful if you tell them that Haskore cannot be
> built on Windows, because of the dependance on the unix package. It would
> have saved me a lot of time if I knew that beforehand.

'unix' is only one of the dependencies, that is there due to Haskore's
monolithic nature. I see you have found the offending places yourself. As
a first hack you can hide them with Cabal flags and CPP, as you did, but
in the long run, there should be small packages that allow the user to
install the things that work for him.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe