[haskell-art] Haskore on Hackage

2008-09-30 Thread Henning Thielemann

I have uploaded a snapshot of Haskore and other sound related
packages by me to Hackage in order to simplify installation. However, the
API's are subject to change, yet.

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskore

http://hackage.haskell.org/packages/archive/recent.html
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Sound
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell audio I/O packages

2008-12-08 Thread Henning Thielemann

On Mon, 8 Dec 2008, John Lato wrote:

 On Fri, Dec 5, 2008 at 4:36 PM, Henning Thielemann
 [EMAIL PROTECTED] wrote:

 Data Types:
 HSoundFile-3 -  custom AudioBuffer class.  Implementations are
 provided for UArr Double, List Double, and StorableVector Double

 StorableVector or StorableVector.Lazy? The latter seems appropriate here.

 I think that StorableVector is the correct choice.  AudioBuffers are
 meant to be read/written strictly, in small chunks.  I could certainly
 try StorableVector.Lazy.  It may in fact be more performance.

StorableVector.Lazy uses chunks. It won't be faster but will require less 
memory for stream operations.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell audio I/O packages

2008-12-09 Thread Henning Thielemann

On Tue, 9 Dec 2008, stefan kersten wrote:

 thanks for posting the code. i'm not very convinced of lazy IO, but i'd
 be very interested in incorporating an iteratee based approach into
 hsndfile.

What are the reasons, you do not like lazy IO? Yes, currently it's a hack 
using unsafeInterleaveIO. But I hope someday one can hide this safely in a 
nice monad. But in general I find lazy stream processing a very elegant 
way of programming. Why else should we use Haskell and not, say OCaml?
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] what do people use for audio output

2009-02-17 Thread Henning Thielemann

On Tue, 17 Feb 2009, John Lato wrote:

 Hi Henning,

 Thanks for replying.  I wasn't aware of the SOX method.

I still use it since in the past it was the method that always worked. 
ALSA or JACK (maybe due to KDE) sometimes did not work for reasons I don't 
know.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] another (non-realtime) sound lib: HOMMAGE

2009-02-24 Thread Henning Thielemann

On Tue, 24 Feb 2009, Daniel van den Eijkel wrote:

 Dear Haskell Artists,

 I'd like to present another another Haskell sound library for
 non-realtime sound production. It's called HOMMAGE (Haskell Offline
 Music Manipulation And Generation EDSL). I developed this library as a
 successor of a student research project I did in 2005.

I like the name. :-)

 When I developed HOMMAGE, I was motivated by the question if it was
 possible to build an EDSL with the look-and-feel of a sequencer-programm
 like Cubase (for example). Performance was never the first goal. My
 experiences so far are:
 - it works pretty fine, but also pretty slow.
 - it sounds good. no clicks or other unwanted artifacts.
 - it is extremely complicated to work with all those types, classes,
 monadic stuff and so on. A good EDSL should consist of 5 monads at most!
 Otherwise, your brain could get damaged...
 - creating music in the modify-compile-run-listen cycle is very, very
 unproductive.

I encountered that too, and found myself arranging melodies in OctaMED in 
the Amiga emulator UAE and then importing them into Haskore. :-) I long 
wanted an editor which gives immediate audio feedback when you press a 
key. Either the computer keyboard or MIDI input should be used as note 
source. But I have not enough experience with an editor and its 
configuration. (NEdit, Emacs, Eclipse?) At least I was able to configure 
NEdit in a way, that you can mark a variable identifier of a Music object 
and then play it via a MIDI file player.

Here are some ideas:
   http://leiffrenzel.de/eclipse/wiki/doku.php?id=eclipsefpfeatures#music
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Announcement: Sox wrapper

2009-04-20 Thread Henning Thielemann

On Mon, 20 Apr 2009, Daniel van den Eijkel wrote:

 This is very cool. Exactly what I was looking for. I tried it out with
 some Hommage examples, but unfortunately it stops playing after about 10
 seconds (at a sampling rate of 44100) and hangs.

That's bad. Maybe a memory leak? Does it work with lists? If yes, then I 
suspect the bug in StorableVector. (Where I'm responsible for, too :-)

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Sox wrapper

2009-04-22 Thread Henning Thielemann

Daniel van den Eijkel schrieb:

 Using forkIO makes no difference. I tried the following code (and some
 variations) but the program still hangs after ca. 40sec at a sampling
 rate11025 and ca. 10 sec at 44100. Maybe I'm doing something wrong. But
 now I need a break before the next attempt, can't hear this saw anymore :-)

 extended write srcOpts dstOpts sampleRate stream = do
mvar - newEmptyMVar
bracket
   (Proc.runInteractiveProcess play
   (Args.decons $ mconcat $
OptPriv.toArguments
  (mconcat $
   srcOpts :
   Option.numberOfChannels
  (Frame.withSignal Frame.numberOfChannels stream) :
   Option.sampleRate sampleRate :
   Option.format (Frame.withSignal Frame.format stream) :
   []) :
Args.pipe :
OptPriv.toArguments dstOpts :
[])
   Nothing Nothing)
   (\(input,output,err,_proc) -
   mapM_ IO.hClose [input, output, err])
   (\(input,_,_,proc) - do
  -- hSetBuffering input (BlockBuffering Nothing)
  -- hSetBinaryMode input True
  forkIO $ do write input stream
  xcode - Proc.waitForProcess proc
  putMVar mvar xcode
  --putStrLn done
  return ()
  readMVar mvar)

Hm, complicated. Did you try the Write module in the same way? Does it
also hang? Did you try to write a file with StorableVector.hPut directly?
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Real Time Audio

2009-04-24 Thread Henning Thielemann


On Fri, 24 Apr 2009, Sriram Durbha wrote:


Hi,
 Is it possible to play a sound in real time, probably through GHCi ?
 eg: could an infinite list of sounds be defined and then played from GHCi ? [ 
This could be
used as the elevator music in the next space elevator :) ]


You just stepped into a current discussion:
  http://lists.lurk.org/pipermail/haskell-art/2009-April/000260.html

For an overview (CoreAudio, PortAudio, DirectSound, Sox, JACK, ALSA), see:
  http://www.haskell.org/haskellwiki/Category:Music___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] Announcement: Real time signal processing for free

2009-04-24 Thread Henning Thielemann

This is what you have long waited for! You have written a lot of signal 
processing code based on lists? You planned to rewrite it to some 
efficient chunky list structure? Better don't do that! The chunk structure 
is usually not what you want. You only use it for efficiency. But it makes 
it almost impossible to write fusion rules that are both correct and 
applicable. Thus I propose to do most things on lists using the functions 
from the stream-fusion package and convert only once to a chunky 
structure, namely at the end of a series of transformations. If the 
operations process the list in one pass from start to end, which is the 
case for most signal processing operations, then fusion will jump in and 
turn everything into a single loop that creates the chunky sequence. 
Sometimes you need to INLINE functions in order to show GHC that there is 
something inside your definitions that can be fused across function 
boundaries. However, for cutting, arranging, and sharing signals, you will 
certainly prefer a chunky sequence as interim data structure.

That's the library you need:
  
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/storablevector-streamfusion

For an example and performance numbers, compile with
$ cabal install -fbuildTests
...
1607 PreInlineUnconditionally
2343 PostInlineUnconditionally
759 UnfoldingDone
96 RuleFired
 12 *#
 2 ++
 8 /##
 2 #
 1 =#
 2 ==#-case
 3 SPEC Main.hPutArray
 12 STREAM stream/unstream fusion
...

stream/unstream is the fusion rule that makes your code fast! The higher 
the count, the better.

$ ./dist/build/speedtest/speedtest
storablevector-from-stream: 0.131797
storablevector-fused: 8.7538002e-2
storablevector: 0.239660999
storablevector-lazy-from-stream: 0.197343
storablevector-lazy-fused: 0.104651
storablevector-lazy: 0.229007
loop-poke: 0.222544002
list-binary-put: 0.111832
list-poke-buffer: 0.146816
list-poke: 0.140776999


  Interestingly, the tests 'storablevector' and 'storablevector-lazy' are 
much slower than their fusion counterparts, although fusion should just 
turn modular code into the same code as in 'storablevector' and 
'storablevector-lazy'. Maybe some strictness tricks in stream-fusion, that 
I do not understand.
  Since my machine has around 1 GHz CPU clock rate, the numbers mean that 
the CPU spends about 100 cycles per sample value, which is quite much for 
my taste. Per sample it must perform a Double multiplication, a pointer 
increment, a conversion from Double to Int16, and finally write that to 
the disk. I thought that today's pipelined, superscalar, what-know-I 
processors can do multiple operations per cycle instead of spending 
multiple cycles per operation as in MC68000 days.

Nonetheless, much fun with playing!
Henning
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Playing a beep

2009-08-03 Thread Henning Thielemann


On Mon, 3 Aug 2009, Håkan Thörngren wrote:


Hi,

I am developing a calculator simulator which can do simple beeps.  The 
simulator figures
out the frequency and duration of the beep and informs a separate thread about 
it. That
thread is then supposed to perform the actual playing of the beep.

So far I have tried to use Synthesizer and I can sometimes get some fragments 
of beeps to
occur, but it  is very erratic and often/soon I tend to get:

interactive: fd:19: hPutBuf: resource vanished (Broken pipe)

after which no beeps occurs.  Probably my thread dies when this happens.


Too bad. I thought Sox would be an easy and portable way. But people 
already reported problems on Windows. Now Mac. I use Linux, where I also 
encountered a bug recently. Maybe a Sox bug? Have you tried 'sox' package 
and included examples alone?


Please see haskell-art archive. We had a discussion about such issues a 
month ago or so.___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Playing a beep

2009-08-08 Thread Henning Thielemann


On Sat, 8 Aug 2009, Håkan Thörngren wrote:


I can report success now with Synthesizer and sox on Mac OS X Intel!  I built a 
sox binary
using MacPorts and it works just fine for the simple things I am doing!


Good news!


The sox I tried first which caused the problems was a prebuilt sox Mac OS X 
binary downloaded
from http://sox.sourceforge.net.


How does the binary from http://sox.sourceforge.net/ differ from your 
custom one?



Now I will head on porting it all to Linux, Mac OS X PowerPC and Windows and 
see how that
turns out.___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] report of a successful installation of haskore-supercollider on a mac

2009-08-29 Thread Henning Thielemann
Jinjing Wang schrieb:
 I just cabal installed haskore-supercollider, and it works perfectly,
 i was even able to play examples using ghci.
 
 Both jack and super-collider are installed on the system, it was an
 extremely pleasant experience.
 
 Here's a question, the sound will fix at a pitch and does not stop
 when the program is terminated ( in both ghci and the air demo bin),
 is there a way to tell the serve to stop?

Haskell is only sending commands to the SuperCollider server.
Terminating a Haskell programm or terminating GHCi does not send
anything to the server to stop the sound. You have to call hsc's 'reset'
function or 'shutUp'.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-17 Thread Henning Thielemann

On Mon, 14 Dec 2009, Patai Gergely wrote:

 Hello all,

 I just uploaded the fruit of a little side project. Hemkay [1] is an
 oldschool module music [2] player that performs all the hard work in
 Haskell.

Cool.
  The most complicated I tried was to import OctaMED printout to Haskore:
   http://darcs.haskell.org/haskore/src/Haskore/Interface/MED/Text.hs
   
http://hackage.haskell.org/packages/archive/haskore/0.1/doc/html/Haskore-Interface-MED-Text.html

 Still, I'd be curious to see how the overall quality of the code could
 be improved. In particular, retrieving and updating record fields is
 somewhat inconvenient. Also, the actual mixing (limited to the mixChunk
 function) is embarrassingly slow, and I wonder how much it could be
 improved without leaving the pure world.

I have a function for mixing sounds at different (relative) start times. I 
feel that it does not get maximum speed in GHC, but is still ready for 
realtime application.
   
http://hackage.haskell.org/packages/archive/synthesizer-core/0.2.1/doc/html/Synthesizer-Storable-Cut.html#v%3Aarrange
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-18 Thread Henning Thielemann
Patai Gergely schrieb:

 I have a function for mixing sounds at different (relative) start times.
 I feel that it does not get maximum speed in GHC, but is still ready for 
 realtime application.

 http://hackage.haskell.org/packages/archive/synthesizer-core/0.2.1/doc/html/Synthesizer-Storable-Cut.html#v%3Aarrange
 And how can you mix that with changing frequencies (effectively
 resampling on the fly)?

I would do resampling (with some of the Interpolation routines) and
mixing in two steps, that is I would prepare (lazy) storable vectors
with the resampled sounds and mix them. Since Haskell is lazy, this is
still somehow on the fly, although one could still wish to eliminate
the interim storable vectors.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] music-related problem

2010-07-04 Thread Henning Thielemann


On Sun, 4 Jul 2010, Michael Mossey wrote:


I can solve a simpler problem which is

-- Given a note with tieNext set, and a list of notes, find
-- the end Loc of the last note in the chain. Only notes
-- with the same pitch as 'firstNote' are considered when looking
-- for the chain of notes.
computeSoundedEnd :: Item - [Item] - Loc
computeSoundedEnd firstNote notes = compSndEnd (pitch firstNote) notes

compSndEnd :: Pitch - [Item] - Loc
compSndEnd _ [] = error tie chain doesn't come to completion
compSndEnd p (n:ns) = if pitch n == p
   then if tieNext n
 then if tiePrior n
   then compSndEnd p ns
   else error illegal tie chain
 else if tiePrior n
   then end n
   else error illegal tie chain
   else compSndEnd p ns

The thing that is hard for me to understand is how, in a functional
paradigm, to update the entire Doc by chasing down every tie and making
all necessary updates.


You will certainly not be able to make use of foldl or foldr, but you may 
use a manual recursion instead. Just like


computeAllEnds :: [Item] - [Item]
computeAllEnds [] = []
computeAllEnds (x:xs) =
   x{loc = computeSoundedEnd x xs} :
   computeAllEnds xs


Cf. the code in Haskell to turn MIDI events into notes with duration:
  
http://code.haskell.org/haskore/revised/core/src/Haskore/Interface/MIDI/Read.lhs
 However, that's a bit more complicated, since it must respect interim 
tempo changes.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] ANN: JackMiniMix-0.1

2010-08-22 Thread Henning Thielemann


On Mon, 23 Aug 2010, Renick Bell wrote:


http://hackage.haskell.org/package/JackMiniMix


interesting


This is my first Haskell library to release. As such, it would be
particularly great to have any feedback regarding mistakes I may have
made.


I think that lower case package names are prefered in order to have 
greater consistency with DEB or RPM package names.


I assume that 'hosc' follows the Package Versioning Policy. In this case 
you might prefer the dependency

  hosc = 0.8   0.9
 in order to ensure that your package can also be built, if 'hosc-0.9' 
changes its API in a way that breaks your package.



How can I get links to documentation on the Hackage page? It generates
nicely with haddock on my local machine, but it would be good if it
were there on Hackage, like so many other libraries.


Hackage generates documentation in intervals. After a day it should be 
generated, but in case any dependent package could not be built on 
hackage, it cannot be built as well. Hackage will then present a log of 
the compilation procedure.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] Mail archives end in March 2010

2010-08-28 Thread Henning Thielemann
Any reason, why the Haskell archive ends in March 2010?
http://lists.lurk.org/pipermail/haskell-art/
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] Generating a video using hps

2010-09-15 Thread Henning Thielemann


Hi Rohan,

I wanted to generate a small animation. First I tried cairo, which is
not quite easy to build. When I saw, that this much resembles PostScript
and also generates PostScript output, I thought I can also program
PostScript directly. To that end I found your package hps easy to use:
Simple installation, Haskell 98, nicely organized. See my code at

http://code.haskell.org/~thielema/firework/src/Credits.hs

Now I found it attractive to feed GhostScript directly with the output
of hps. This way I do no longer generate a temporary postscript file of
several megatons. See the attached patch.

My idea is to generate the whole PostScript string lazily and write it
with a single writeFile call. However in order to reduce restructuring
of your code I just have replaced the IO code by code on a Monoid. That
monoid can be either an Endo monoid that creates the whole string in the
DiffList way, or the monoid can be (IO ()), where mappend = (). I have
only added stringFromPS to the API. If you like it, you may add
stringFromEPS in the same way. The function stringFromPS also allows us
to generate GZipped postscript on the fly.


Regards,
Henning
diff -rN -u old-postscript/Graphics/PS/PS.hs new-postscript/Graphics/PS/PS.hs
--- old-postscript/Graphics/PS/PS.hs	2010-09-14 17:12:20.0 +0200
+++ new-postscript/Graphics/PS/PS.hs	2010-09-14 17:12:21.0 +0200
@@ -1,4 +1,4 @@
-module Graphics.PS.PS (ps, eps) where
+module Graphics.PS.PS (ps, eps, stringFromPS, ) where
 
 import Graphics.PS.Pt
 import qualified Graphics.PS.Matrix as M
@@ -10,6 +10,8 @@
 import qualified Graphics.PS.Image as I
 import Data.List
 import System.IO
+import Data.Monoid (Monoid, mappend, mempty, mconcat, Endo(Endo,appEndo), )
+
 
 data PS = Name String
 | LName String
@@ -181,29 +183,35 @@
 mlist :: M.Matrix - [Double]
 mlist (M.Matrix a b c d e f) = [a,b,c,d,e,f]
 
-bracket :: (String - IO ()) - String - String - [a] - (a - IO ()) - IO ()
+infixl 1 +
+
+(+) :: Monoid m = m - m - m
+(+) = mappend
+
+bracket :: (Monoid m) =
+(String - m) - String - String - [a] - (a - m) - m
 bracket f o c p g =
-let h a = f a  f  
-in h o  mapM_ g p  h c
+let h a = f a + f  
+in h o + mconcat (map g p) + h c
 
 escape :: String - String
 escape = concatMap (\c - if elem c () then ['\\', c] else [c])
 
-put :: (String - IO ()) - PS - IO ()
-put f (Name n) = f n  f  
-put f (LName n) = f /  f n  f  
-put f (Op o) = f o  f \n
-put f (Comment o) = f %  f o  f \n
-put f (Int n) = f (show n)  f  
-put f (Double n) = f (show n)  f  
-put f (String s) = f (  f (escape s)  f ) 
+put :: (Monoid m) = (String - m) - PS - m
+put f (Name n) = f n + f  
+put f (LName n) = f / + f n + f  
+put f (Op o) = f o + f \n
+put f (Comment o) = f % + f o + f \n
+put f (Int n) = f (show n) + f  
+put f (Double n) = f (show n) + f  
+put f (String s) = f ( + f (escape s) + f ) 
 put f (Array a) = bracket f [ ] a (put f)
 put f (Proc p) = bracket f { } p (put f)
 put f (Matrix m) = put f (Array (map Double (mlist m)))
 put f (Dict d) =
 let g = concatMap (\(a,b) - [a,b])
 in bracket f   (g d) (put f)
-put f (Seq a) = mapM_ (put f) a
+put f (Seq a) = mconcat (map (put f) a)
 
 ps' :: (I.Image, Int) - PS
 ps' (p, n) = Seq [page Graphics.PS n,  image p, showPage]
@@ -215,40 +223,51 @@
 
 -- | Write a postscript file.  The list of images are written
 --   one per page.
-ps :: String - P.Paper - [I.Image] - IO ()
-ps f d p = do
-  h - openFile f WriteMode
-  let g = put (hPutStr h)
+ps :: FilePath - P.Paper - [I.Image] - IO ()
+ps f d p =
+  writeFile f (stringFromPS f d p)
+
+stringFromPS :: String - P.Paper - [I.Image] - String
+stringFromPS t d p =
+  let g = put (\s - Endo (s++))
   (P.Paper width height) = paper_ps d
-  mapM_ g [header
-  ,title (Graphics.PS:  ++ f)
-  ,creator Graphics.PS
-  ,languageLevel 2
-  ,pages (length p)
-  ,documentMedia Default width height
-  ,endComments
-  ,prolog]
-  mapM_ g (map ps' (zip p [1..]))
-  mapM_ g [trailer
-  ,eof]
-  hClose h
-
+  in  flip appEndo  $
+  g header +
+  g (title t) +
+  g (creator Graphics.PS) +
+  g (languageLevel 2) +
+  g (pages (length p)) +
+  g (documentMedia Default width height) +
+  g endComments +
+  g prolog +
+  mconcat (map (g . ps') (zip p [1..])) +
+  g trailer +
+  g eof
+
+
+newtype MonadMonoid m = MonadMonoid {appMonadMonoid :: m ()}
+
+instance Monad m = Monoid (MonadMonoid m) where
+   mempty = MonadMonoid (return ())
+   mappend (MonadMonoid a) (MonadMonoid b) =
+  MonadMonoid (a  b)
+   mconcat = MonadMonoid . mapM_ appMonadMonoid
 
 -- | Write an encapsulated postscript file.  The single image
 --   is written.
 eps :: String - P.BBox - I.Image - IO ()
-eps f d p = do
-  h - openFile f WriteMode
-  let g = put (hPutStr h)
-  mapM_ g [headerEps
-  ,title (Graphics.PS:  ++ f)
-  ,creator Graphics.PS
-  ,languageLevel 2

[haskell-art] Announcement: MIDI stream editor

2010-09-23 Thread Henning Thielemann


This is primarily for people who control a software or hardware 
synthesizer by a MIDI keyboard on Linux. I have programmed a little MIDI 
event editor, that allows you to alter MIDI channels, automate MIDI 
controller changes, split keyboard, play patterns according to the set of 
currently pressed keys, switch instrument everytime a key is pressed and 
so on.


I have uploaded it to Hackage:
   http://hackage.haskell.org/package/streamed
 but I think it is of more use to get the darcs repository
   darcs get http://code.haskell.org/~thielema/streamed/ .
 Nonetheless, 'cabal install' will install all imported packages, that are 
necessary for a GHCi session. You should alter the module 
Sound.MIDI.ALSA.Causal according to your wishes and start a GHCi session 
with


streamed$ make ghci

In the module you should replace connectLLVM by connectTimidity and adapt 
connectTimidity to the names of your devices. Then you might try one of 
the examples in the 'case' branches of 'main'.



Good luck!
Henning
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Software Synthesizer mapping ALSA/MIDI events to SuperCollider

2010-11-28 Thread Henning Thielemann


Hi Rohan,

On Sun, 28 Nov 2010, Rohan Drape wrote:


Rohan, I have still a problem: How can I achieve that on releasing a
key the sound is not immediately aborted but enters a release phase?


There are various ways, however normally you'd
do this using the 'gate' input of the 'envGen'
UGen.

I've added 'envASR' and 'envADSR' parameter
constructors (arguments as at sclang) to
demonstrate this, there are trivial examples
in the help files.


Ah I see - a new patch in darcs repository. Thank you! I'll check it.

Btw. in Sound.SC3.UGen.Envelope.Construct.d_dx the pattern match

  d_dx [x,y] = [y - x]

can be omitted. You could write

  d_dx (x:y:r) = y - x : d_dx (y:r)
  d_dx _ = []

or even simpler

  d_dx xs = zipWith (-) (drop 1 xs) xs

.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] sfml-audio

2010-12-06 Thread Henning Thielemann


On Mon, 6 Dec 2010, Sönke Hahn wrote:


I am developing a game in Haskell [1].  For that, I needed a library that
would do the following:

1. Play music files.
2. Play sound files with a low latency (for jumping sounds, etc.)
3. Compile on all targeted platforms (Linux, Windows, Mac OS X) using open
source tools (compilers, etc.)
4. Be available under an open source license for use in both open source and
closed source software.

The library I got working after some research was sfml [2]. So I came up with
(very minimal) bindings to a subset of the audio module from sfml. I put it up
on patch-tag [3]. Any comments welcome.


Isn't SDL intended for this purpose?

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] Lazy cons, Stream-Fusion style?

2011-01-02 Thread Henning Thielemann


On Sun, 2 Jan 2011, Stephen Tetley wrote:


Un-optimized, with a head-strict stream (basically Wouter Swierstra's
Stream with a bang on the element), rendering currently takes minutes
to generate seconds. But as well as the Stream representation, I've
plenty of room to optimize the WAV file generation.


Using stream-fusion:Stream rendered to a low-level list representation you 
get relatively efficient computation. I used my signal generator type and 
StorableVector.Lazy in order to perform this one in real-time:

  http://www.youtube.com/watch?v=KA6DE9jlpSY

(see packages synthesizer-core and synthesizer-alsa)

That is, even interactive realtime processing is possible, but not very 
complex one. It requires very disciplined programming and after a small 
change to your program the GHC optimizer may decide to compile it 
completely different and the program becomes five times slower.


I have also written an overview of what data structures are useful for 
what signal processing purpose:

  
http://hackage.haskell.org/packages/archive/synthesizer/0.2.0.1/doc/html/Synthesizer-Storage.html


Probably I can live without definitions like @ ones = 1 : ones @, I
would like to know whether of not this is impossible with
Stream-Fusion anyway.


The recursive style allows for elegant writing of feedback, solution of 
differential (e.g. oscillation) equations. It's sad, but I think you 
cannot have it with stream-fusion. Maybe in future GHC or JHC get more 
cleverness to eliminate even more lazy values. For feedback with longer 
and constant delay, you might buffer the data in a chunky storable vector 
and then get efficient recursive computation.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] Lazy cons, Stream-Fusion style?

2011-01-04 Thread Henning Thielemann
Hudak, Paul schrieb:

 I just wanted to mention that at Yale we are still working on CCA
 (causal commutative arrows) to get higher performance digital audio.
 Although it may seem objectionable to use arrows at all, it has some
 key advantages.  For example, you can write recursive signals with no
 problem, and they will (theoretically) get optimized as well as
 straight-line code.

In the meantime I am more and more moving to Arrows or Arrow like
structures. On the one hand it is often the more appropriate data
structure since it models exactly the causality of signal processes and
has much less risk for memory leaks (compared to lazy lists). On the
other hand it is sad, that Arrows often need more type tricks in order
to work and that with arrows I am forced more or less to pointfree
style. I like pointfree style for simple chains of operations but I do
not like it for diamond-like graphs, i.e. re-use the result of one
signal process multiple times. For simplifying those situation I have
recently written a package. It allows me to locally pick the output of
an arrow and provide an arrow that gives me easy access to that output
in a later process.

 http://hackage.haskell.org/package/functional-arrow

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] Lazy cons, Stream-Fusion style? (fwd)

2011-01-04 Thread Henning Thielemann


John Lato schrieb:


The other big problem is the name of the z function.  I would like to
call it z-, but that's not an allowed name.  Unfortunately -z is
allowed as an operator name either.  So for now it's backwards for
convenience.


I'd suggest to call it 'delay' since I find it much more descriptive
than the 'z' that refers to the arbitrary variable name chosen for the
'z' transform.


Finally, in a blog post a while back sigfpe mentioned using comonads for
lazy audio.  I spent about 20 minutes on this and although the semantics
are nice, I couldn't figure out a way to get good performance for
recursive functions (iir filters etc.).  Has anyone else tried this?


No, but it was interesting to read and my first encounter with a
practical Comonad.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] [Haskell-cafe] Lazy cons, Stream-Fusion style?

2011-01-04 Thread Henning Thielemann
Hudak, Paul schrieb:

 In the meantime I am more and more moving to Arrows or Arrow like
 structures. On the one hand it is often the more appropriate data
 structure since it models exactly the causality of signal processes and
 has much less risk for memory leaks (compared to lazy lists). On the
 other hand it is sad, that Arrows often need more type tricks in order
 to work and that with arrows I am forced more or less to pointfree
 style.
 
 I almost always use one of the arrow preprocessor syntaxes, which at least 
 give the illusion of not being point-free.
 
 I like pointfree style for simple chains of operations but I do
 not like it for diamond-like graphs, i.e. re-use the result of one
 signal process multiple times.
 
 But this seems easy using arrow syntax -- am I missing something?

I think you cannot translate a functional expression like
   mix x (delay x)
literally to a line of arrow syntax, that is, without introducing a
variable name for the output of (delay x), unless I am missing something.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Lazy cons, Stream-Fusion style?

2011-01-04 Thread Henning Thielemann


On Tue, 4 Jan 2011, Hudak, Paul wrote:


I think you cannot translate a functional expression like
  mix x (delay x)
literally to a line of arrow syntax, that is, without introducing a
variable name for the output of (delay x), unless I am missing something.


You're right, but it seems relatively painless:

y - delay t - x
returnA - x+y

I guess it's just a matter of style.



Of course, in this simple case the problem can be resolved quite easy by 
introducing a new identifier. My point for the general case is: In an 
expression, where signal processes are functions and signals are function 
arguments (like (mix x (delay x))), I need names for signals only when 
they are shared, i.e. used as input to more than one other signal process. 
In the arrow notation I need more temporary identifiers, namely whenever a 
signal process has more than one input that are outputs of more than one 
arrow. This happens quite often in my experience.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Open source hardware synthesizers

2011-01-13 Thread Henning Thielemann


On Thu, 13 Jan 2011, Erik de Castro Lopo wrote:


There is a the FPGA-Synth website and mailing list:

   http://www.fpga.synth.net/

where people are doing synth designs in Verilog or VHDL and programming
them into FLGAs.


Thank you for that hint!


This is actually relatively easy. I've done it a couple of
times. The trick is to do the snooping on Linux (with the
usbmon kernel module) and run the windows software under
Wine or a VM like VirtualBox.


I can start the Windows configure tool with Wine, but when it comes to USB 
communication it crashes. It is documented in Wine, that USB is still not 
well supported. I could not run VirtualBox, too, because it seems to be 
tailored to a Windows file system within a file, but I just want to re-use 
a Windows installed in a separate partition. I read about ways to get 
Windows running from such a partition anyway, but this sounded quite 
fragile to me.



some guess on the control chip in the keyboard
and a lot of time and patience, and an invalid firmware update may leave
the keyboard in an unusable and unalterable state.


If you snoop and reverse engineer the protocol you wouldn't need
to change the firmware, you'd just be doing whatever the windows
program does.


There is some hardwired logic in the keyboard, that prevents e.g. that 
multiple LEDs are active at once, or it resets MIDI transfer channel when 
selecting a patch. I am afraid this needs reprogramming of some internals 
of the keyboard.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Mailing list archive

2011-02-03 Thread Henning Thielemann
alex schrieb:
 On 3 February 2011 19:33, Henning Thielemann
 lemm...@henning-thielemann.de wrote:
 Unfortunately archiving stopped in March 2010. Thus this thread will not be 
 archived, too. :-(
 
 I seem to have fixed the archives:
   http://lists.lurk.org/mailman/private/haskell-art/

Is it intended to restrict the archive to list members?

 Also I notice there seems to be a complete archive here too:
   http://blog.gmane.org/gmane.comp.lang.haskell.art

Good to know that the mails are archived. Nevertheless I like the simple
web pages of mailman.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-03 Thread Henning Thielemann
John Lato schrieb:
 On Thu, Feb 3, 2011 at 6:46 PM, Anton Kholomiov
 anton.kholom...@gmail.com mailto:anton.kholom...@gmail.com wrote:
 
 sorry i've started new thread, it goes here
 
 Hi
 
 I'm making dsl's for music/sound composition. Hope some day i will
 stop making dsls and do some music with them. But haskell makes it
 difficult. With haskell It's too interesting to write dsl than
 things that dsl's suppose to describe.
 
 
 I have this problem too.

+1

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-03 Thread Henning Thielemann
Balazs Komuves schrieb:

 I sometimes make realtime, procedural music videos (it's an old hobby,
 see http://en.wikipedia.org/wiki/Demoscene). In the last few years, I
 have been doing this in Haskell, simply because I enjoy Haskell much more 
 than other
 languages. However, these programs are not at all elegant pure functional
 programs, as they should be, but big ugly hacks thrown together in a
 short time :)
 
 Some examples:
 http://www.youtube.com/watch?v=BMuzdTFwV-A

Like good old demos on good old Amiga! :-)

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-07 Thread Henning Thielemann


On Wed, 2 Feb 2011, alex wrote:


So, why not hit reply and introduce yourself (even if you've posted
already), and reveal your interest in haskell and/or art, whatever
that may be.  I'll do it too, but someone else go first :)


Ok, where to start - at the very beginning? I first tried to make sound
with the ZX Spectrum from 1986 to 1990 with assembly programming, then 
with Amiga, various BASICs and assembly programming, then with a Modula-II

derivative called Cluster until around 2001:
   http://www.assampler.com/

Then I tried Modula-3 on Linux. When I later got to know Haskell, I found 
that I had reinvented lazy evaluation for Assampler. Consequently I moved 
to the original. I wanted to integrate music composition and signal 
processing. I wanted programming features for music arrangement, since the 
many trackers known from Amiga did not offer much structuring and thus 
required a lot of copy and paste. I wanted programming features also for 
signal processing, since the interactive graph editing became cumbersome 
for repetitive signal algorithms like vocoders, although I already added 
some support for them to Assampler.
 At a long weekend in 2004 I put together a song using Haskore and custom 
signal processing functions working on lists:

   http://users.informatik.uni-halle.de/~thielema/Music/winterade/winterade.mp3
 Composing this piece was really crazy, since due to a bug in a SuSE 
upgrade, I could not play sounds. Thus I transfered every rendered stream 
to an Amiga via FTP and played it there.


Starting from this example I wrote more signal processes, tried to make 
them safer, cleaner, more flexible, faster, aware of physical units, 
adaptive to sample rates. I extended Haskore by Paul Hudak, wrote packages 
haskore-realtime, haskore-supercollider, supercollider-midi, event-list, 
midi, midi-alsa, streamed (realtime MIDI event manipulation in ALSA), 
sample-frame, sox, synthesizer-core, synthesizer-dimensional, 
synthesizer-alsa, synthesizer-llvm, extended and maintained storablevector 
(based on Spencer Janssen's work), numeric-prelude (based on Dylan 
Thurston's work), alsa-seq, alsa-pcm (based on Iavor Diatchki's work), 
jack (based on Sönke Hahn's work).


Using plain lists for signal processing I got perfect integration of 
signal processing and music and hours to wait for rendering results. In 
contrast to that, the hsc3 package by Rohan Drape allowed me to get 
realtime sound:

  http://www.youtube.com/watch?v=d2JvOwS26Zg
(YouTube is great in making the audio track sound awful.
 Better follow the links in the video description to the original files.)

Using storablevector, stream-fusion:Stream like signal generators, and 
arrows for causal processes I got eventually realtime sound with plain 
Haskell:

  http://www.youtube.com/watch?v=KA6DE9jlpSY
 Unfortunately this turned out to be really fragile. You can never predict 
what the optimizer will do and you easily get code that is no longer 
realtime. In many times the problem is as follows: If you use a function 
more than one time, then GHC may no longer inline it, and with the 
overhead of a real function call and lost opportunities for unboxing the 
performance drops dramatically. Maybe GHC-7.0 is better in this respect, I 
still have to check that.


2010 I started to use a DSL targeting LLVM JIT.
  http://www.youtube.com/watch?v=GNiAqBTVa6U
  http://www.youtube.com/watch?v=cuzYgJGfMfY
 Performance is excellent, also due to vector unit support (SSE or 
AltiVec), but every release of LLVM surprises me with things that worked 
before and do not work any longer. Integration with Haskell is quite good, 
but it has the usual problems, that every DSL has. In contrast to a 
connection to SuperCollider or CSound, I can feed signal data from Haskell 
to LLVM code and pull it back. I would be very happy to use the same code 
for list based processing, storablevector based processing and LLVM based 
processing by some type class framework. That's not very easy, but I 
already managed to employ some computations both for pure Haskell and LLVM 
processing.
 I also spent a lot of time of hunting memory leaks. It is very easy to 
get them when relying on lazy evaluation. It is even hard or impossible to 
avoid them, even if you know, where they are. I am uncertain whether this 
problem is specific to GHC or whether this is hard and unsolved in 
general. I came to the suspicion that memory leaks are _the_ reason, why 
the garbage collector is considered to be not ready for real-time 
applications: The more memory is orphaned the more has the garbage 
collector to check for liveliness. The typical memory leak works as 
follows:

  let (prefix, suffix) = splitAt largeNumber xs
  in  processA prefix ++ processB suffix
 Although this can be perfectly processed in a streaming manner, sometimes 
GHC does not manage to release the pointer to the beginning of prefix and 
thus prefix is kept until the processing of suffix starts. I wonder 

Re: [haskell-art] Haskell art?

2011-02-15 Thread Henning Thielemann


On Fri, 4 Feb 2011, Stephen Sinclair wrote:


Anyways, due to the field I work in, one subject area I find myself
obsessed with is the seeming conflicts of interest between functional
programming and real-time guarantees (for writing DSP programs, etc).
The former allows more powerful ways to express programs and
modularize logic, but seems to often require methods for abstracting
machine architecture such as garbage collection, which is not
compatible with time determinism.  Avoiding GC seems to require the
use of more restrictive languages like in the case of FAUST, which is
basically a declarative DSP description language.  I'd like to
eventually find just the right balance between time determinism and
general-purpose programming.


FAUST is essentially like Arrow programming in Haskell. I prefer Arrows in 
Haskell because they are stricter. E.g. in FAUST you can plug together 
boxes with non-matching numbers of inputs and outputs and FAUST somehow 
connects them anyway. I suspect I would more like to get an error in such 
cases.


In synthesizer-llvm I programmed DSP arrows that generate LLVM assembly 
code. There is no Garbage Collection going on silently. It should be 
appropriate for tasks with hard time and memory constraints. Actually, 
Haskell with the 'llvm' package is the greatest macro assembler I ever 
used! :-)

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-15 Thread Henning Thielemann


On Sun, 13 Feb 2011, Hudak, Paul wrote:


First, my group has designed a new computer music library that I call
Euterpea (named after Euterpe, the Greek muse of music).  Euterpea has all
of the original functionality of Haskore, plus an arrow-based signal
processing language for doing audio processing and sound synthesis.  It also
has a GUI for creating sliders, pushbuttons, and so on.  Instructions for
downloading Euterpea can be found here:


You also told earlier that you have pure Haskell audio processing code. 
But that is not part of CCA (Commutative Causal Arrows) or Euterpea? (Btw. 
I did not understand why CCA needs both a preprocessor and Template 
Haskell, I thought that one of it should be enough.)



Also, here is a link to some compositions, mostly by my grad student Donya
Quick, all done entirely in Euterpea:

http://haskell.cs.yale.edu/?page_id=279


I very like the examples and I am very curious about the Haskell sources 
that produce those results! Are there samples contained, that are not 
generated in Haskell or is there some arrangement that was not done in 
Haskell?


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] purely functional circular buffers

2011-02-17 Thread Henning Thielemann
John Lato schrieb:

 Does anyone know of a purely functional equivalent to a circular buffer?

It depends on the application you have in mind.
For programming a constant delay of n samples of a lazy list including
feedback,
you can use a lazy list instead of a circular buffer.
For efficiency reasons you can use a chunky StorableVector with chunk
size up to n.
This is like rolling out the circular buffer to an infinite list.

Something simple like

let output :: [Double]
output = mix (input + delay n output)

would work.

  I'm looking for something that supports efficient insertion and lookup,
 and doesn't rely upon mutable data.  I don't want to use mutable data
 because I'd like to embed this in CCA, which to my knowledge doesn't yet
 support Kleisli arrows.

Embedding the above idea into an arrow that emits one output sample per
input sample would not work. Mutable arrays in the ST monad would help,
but this requires that the arrow is built around the ST monad.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] memory leaks

2011-02-18 Thread Henning Thielemann


On Thu, 17 Feb 2011, Evan Laforge wrote:


liveliness. The typical memory leak works as follows:
 let (prefix, suffix) = splitAt largeNumber xs
 in  processA prefix ++ processB suffix
 Although this can be perfectly processed in a streaming manner, sometimes
GHC does not manage to release the pointer to the beginning of prefix and
thus prefix is kept until the processing of suffix starts. I wonder whether


Just out of curiosity, how do you find out when this is happening?


I notice large leaks when the machine starts swapping intensively. I 
detect smaller leaks with 'top'. For even smaller leaks I set a trap using 
runtime options for restricting heap memory:

  synthi +RTS -M8m -RTS
 The program should run with constant memory consumption. If the memory 
consumption increases, then the program stops when the heap overflows. But 
before that happens often ALSA reports buffer underruns faster and faster, 
due to the increasing number of memory pieces that the garbage collector 
has to check.


The fastest way to detect a memory leak is certainly not to play the sound 
at all, but just write it to disk or /dev/null. Then memory leaks hit a 
heap memory restriction very qickly.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-20 Thread Henning Thielemann


On Thu, 17 Feb 2011, Evan Laforge wrote:


However, I've basically given up on that for the moment in favor of
just generating MIDI.  Just composition is already really complicated
without throwing signal processing into the mix.  So I wish you best
of luck on the signal side, maybe when things on both sides mature I
can steal^H^H^H integrate some of that work and finally have the
top-to-bottom solution I dreamed of...


How about import ? :-)


Coincidentally, I also got my start on the Amiga... perhaps early
exposure to trackers let to my dissatisfaction with MIDI and the
typical MIDI sequencer :)  My current project winds up looking vaguely
like a programmable tracker.


I had written some simple conversion from a text presentation of a OctaMED 
module to Haskore. Maybe you find it useful:

  http://code.haskell.org/haskore/revised/core/src/Haskore/Interface/MED/Text.hs

Do you remember the AmigaBasic music demo? It used a music description 
they called MML:

  http://code.haskell.org/haskore/revised/core/src/Haskore/Interface/MML.lhs

I wondered whether it is possible to program Emacs or another programmable 
text editor in a way, that it behaves like a tracker. One could also write 
content in a column oriented style that is valid Haskell code.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-22 Thread Henning Thielemann


On Tue, 22 Feb 2011, Evan Laforge wrote:


I had written some simple conversion from a text presentation of a OctaMED
module to Haskore. Maybe you find it useful:
 http://code.haskell.org/haskore/revised/core/src/Haskore/Interface/MED/Text.hs


Indeed, I very well might.  I have a bunch of music in OctaMED format
that I'd like to extract at some point.  Unfortunately somehow most of
it wound up in SFCD compression which is apparently no longer
decompressable (I read something where the original author said he
lost the source).


I remember long time ago I also analysed that format. It was not too 
complicated, e.g. he encoded the used channels in one line by four bits 
that preceded the notes. However, I think the later simple module format 
with generic powerpacker compression was a good choice.



Oh, wait it looks like it requires an octamed to export as text... I
guess I'd need to go dig into some of the standalone mod players out
there.


Yes, that was the easiest for me, since I did not convert a lot of songs. 
My import is also really simple: Only notes, not even some commands.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-02-23 Thread Henning Thielemann
Stephen Tetley schrieb:
 On 22 February 2011 23:41, Evan Laforge qdun...@gmail.com wrote:

 Can you write 'inst2 pitch = reverse (inst1 pitch)'?
 
 Is 'inst2 pitch = reverse (inst1 pitch)' the backwards instrument? My
 first thought would be this is hard to write in any continuous
 language even functional/FRP.

Since SuperCollider is intended as realtime synthesizer it supports
certainly only causal signal processes, which 'reverse' is not. I do
not think that its internal design of linked nodes and arrays of input
and output buffers can be extended to do something like 'reverse'. If
lazy evaluation in Haskell would work properly, that is reliably without
memory leaks, then you could nicely combine causal processes (via lazy
evaluation) and non-causal processes like reverse (not lazy, but could
work on the same signal representation). Another nice example of
breaking the orchestra-score barrier is the effect of slowing down a
record containing synthesized music.

That said, I think separating causal and non-causal processes is a good
thing anyway, because e.g. feedback can be done reliably (i.e. without
deadlocks) only with causal arrows. However Haskell integrates both
causal processing (via arrows) and non-time restricted evaluation (via
laziness).

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] jack-0.6

2011-02-23 Thread Henning Thielemann


I have updated jack to use midi-0.1.5, removed orphan instances and some 
more cleanup. Edward Amsden added a function for querying the samplerate. 
Can you please check, whether it still works for you:


http://code.haskell.org/jack/
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell art?

2011-03-11 Thread Henning Thielemann
Evan Laforge schrieb:

 This sounds like something I've noticed, and if it's the same thing, I
 agree.  But I disagree that you need to separate orchestra and score
 to get it.  Namely that notes are described hierarchically (e.g.
 phrase1 `then` phrase2 :=: part2 or whatever), but that many musical
 transformations only make sense on a flat stream of notes.  For
 example, decide which note a string would be played on and pick a
 corresponding corresponding base note + bend.  You can't do this
 without a memory of which notes have been played (to know currently
 sounding strings) and maybe a look a little ways into the future (to
 pick between alternatives).  Hierarchical composition has no access
 the previous and next notes, so it winds up having to be a
 postprocessing step on the eventual note output stream, which means
 you have to have something in between the score and the sound.  By why
 be limited to one one instance of this player and a static score -
 player - sound pipeline?

For other examples a hierarchical structure is exactly the right thing:
Think of a filter sweep or a reverb that shall be applied during a
certain time interval to a certain set of instruments, say all
instruments but drums and the melody. You had to filter those events out
of the performance stream and you have to specify the overall duration
of the filter effect, since it cannot be derived from the performance.
The performance stores only start times and durations of individual
events, but it does not store trailing pauses of music sub-trees.

 I'm not totally convinced the integration is valuable, but seeing as
 almost all other systems don't have it, it seems interesting to
 experiment with one that does and see where it leads.  Maybe another
 way of putting it is that different interpretations of abstract
 instructions like legato are not necessarily always along instrument
 (piano vs. violin) lines: it may vary from phrase to phrase, or
 section to section.

I think the hierarchical music structure has its value in being able to
be converted to a lot of back-ends. The Performance structure is good
for MIDI and Csound. The hierarchical structure is better for
SuperCollider and pure Haskell signal processing, because of such
effects like filter sweeps, speed variation at signal level, or
reversing parts of the music. The hierarchical structure can be simply
converted to Performance. I would have thought that the hierarchical
structure is also better for music notation, but the actual
implementations show, that it is not.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] data structure for music (Was: Haskell art?)

2011-03-11 Thread Henning Thielemann


On Fri, 11 Mar 2011, Stephen Tetley wrote:


I still don't understand what Evan's reverse instrument models.

Is it reversing the sound of a note so it is some function wrapping a
unit generator?

Or is it reversing a sequence of notes according to pitch?


I think he means reversing the signal generated by a part of the music, 
since this is a classical example of breaking the music-signal barrier.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Live Performing With Haskell

2011-03-12 Thread Henning Thielemann


On Fri, 11 Mar 2011, aditya siram wrote:


Hi all,
I'd like to get into live coding with Haskell. Can you recommend a
good enviroment? I run Ubuntu Linux. I've looked into Haskore withn
Supercollider but it doesn't seem suited to live performance like
something like Chuck or Impromptu. Is there something like this in the
Haskell space?


Hsc3 works out of the box, if you want to create sounds from GHCi:
http://hackage.haskell.org/package/hsc3

I also like my utility package based on that:
http://hackage.haskell.org/package/supercollider-ht

If you want to edit MIDI streams in a programmatic way, you may try:
http://hackage.haskell.org/package/streamed
  (However you have to adapt the 'connect' commands in 
Sound.MIDI.ALSA.Common to your needs and then choose an example like '2' 
in Sound.MIDI.ALSA.Causal.main and load that into GHCi.)


You can close the chain between ALSA-MIDI and SuperCollider by:
http://hackage.haskell.org/package/supercollider-midi
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Functional view of music?

2011-06-01 Thread Henning Thielemann


On Wed, 1 Jun 2011, Stephen Tetley wrote:


Hello all,

The functional view of images - image as a function from Point -
Colour - is well practised for continuous images - Conal Elliott's
Vertigo and Pan, Jerzy Karczmarczuk's Clastic, plus Pancito,
Chalkboard and more. It's even been used for discrete pictures (i.e.
vector graphics) - Peter Henderson's original picture language, Antony
Courtney's Fruit and my own Wumpus[*].

Is there any prior work considering music functionally, though? - i.e.
a function from Time - Sound


Translating (Point - Colour) to sound, would mean (Time - Displacement), 
right?

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] Haskell live sequencing

2011-11-06 Thread Henning Thielemann

I am happy to present the demonstration of a live sequencer that Johannes 
Waldmann and me are developing for a month now.

   http://www.youtube.com/watch?v=88jK162l6mE

It is similar to composing in Haskore, but it is interactive. The sound in 
the video is generated in real-time by my Haskell-LLVM-synthesizer. The 
sequencer just sends MIDI events via ALSA and can be connected to any MIDI 
device.

You can find repository and bugtracker at:
   http://dfa.imn.htwk-leipzig.de/cgi-bin/gitweb.cgi?p=seq.git;a=tree
   
http://dfa.imn.htwk-leipzig.de/bugzilla/describecomponents.cgi?product=live-sequencer
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell live sequencing

2011-11-08 Thread Henning Thielemann

Bernardo Barros schrieb:

 This is very impressive and promising! Thanks for sharing!

Thank you (and all the others) for your interest!

 How far did you go with llvm-synthesizer concerning more complex sound
 synthesis?

Thanks to LLVM and vector processing there are still a lot of unused CPU
cycles. However during recording of the video I also needed those cycles
for video encoding.

 It sounds like you are trying synthesis techniques like FM, right?

Yes, the repeated pattern is played with a simple percussive FM sound.

 And how about the latency with simple and more complex synthesis?

The latency does not depend on the complexity of the sounds. If the
sounds are too complex, then the sound becomes chopped and the
synthesizer becomes unresponsive independent from how large you choose
the latency. If sounds are simple then latency is still a problem.
However I managed to get latencies around 10 ms what yields a natural
repsonse of the sound to pressed keys.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell live sequencing

2011-11-09 Thread Henning Thielemann

On Tue, 8 Nov 2011, Brent Yorgey wrote:

 On Tue, Nov 08, 2011 at 11:28:24PM +0100, Henning Thielemann wrote:

 This was the most simple to start with and we will extend that:

 http://dfa.imn.htwk-leipzig.de/bugzilla/show_bug.cgi?id=267

 Oh, I see, cool, I thought perhaps there was some technical reason.

 A couple more questions:

  1. Is there a URL that can be used for cloning the git repo (as
  opposed to just downloading a snapshot)?  I couldn't find one.

I am in no ways a git expert. Wasn't the link I posted a full git 
repository? At least
   git clone git://dfa.imn.htwk-leipzig.de/srv/git/seq
  works for me.

If you are interested in cutting edge features - I constantly prepare 
patches that are in my branch at
   http://code.haskell.org/~thielema/livesequencer/
  from where Johannes pulls into the main branch from time to time. (E.g. 
after recording the video I added playing of individual terms from within 
the editor and I added note input via external controllers.)

  2. I got everything to build, but when I follow the instructions in
  the README, it looks as if everything is working (the gui shows that
  it is sending events etc, timidity is running, aconnect shows them
  both) but I get no sound.  Anyone have any ideas of things I should
  check/try?

No idea. Does timidity make a sound if you send events directly to it? 
Does aseqdump show events coming from the live-sequencer?

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Haskell live sequencing

2011-11-10 Thread Henning Thielemann

On Thu, 10 Nov 2011, Heinrich Apfelmus wrote:

 Henning Thielemann wrote:
 On Tue, 8 Nov 2011, Heinrich Apfelmus wrote:

 How do you make sure that a new sequence starts on the beat / interleave
 nicely with what is still playing?

 The trick is to update the program but not the currently processed term.
 Thus the same term can get a new meaning. The advantage is that I can
 break a loop and redirect it to somewhere else, e.g. by changing

 loop1 = append melody loop1 ;

 to

 loop1 = append melody loop2 ;

 but the melody keeps running and is not interrupted. The disadvantage is
 that I cannot break a call to cycle and that after program change, the
 current term may refer to functions that are no longer defined.

 Nice! And that's also why you've implemented a custom functional language?

The language should be just Haskell. Actually the modules can be loaded 
into GHCi. It would be nice have some infrastructure for Haskell 
processing such that we do not need to re-implement GHC in the end.

 I do wonder about the precise semantics of changing expressions 
 in-flight, though. For instance, imagine that the program is performing 
 a time-consuming computation that does not (yet) produce any sound, what 
 will happen if I update the term that is being evaluated? Or will 
 updates only take effect at certain checkpoints, namely whenever a new 
 MIDI note is created and passed to the synthesizer? How do you detect 
 which terms have changed and which haven't?

The music is described by a list of MIDI events and Wait commands. The 
rewrite engine accepts changes of the program after every list item. 
However the current term is not immediately affected by a program change. 
If the current term is

  append melody loop

and a program update changes the meaning of loop, then melody will be 
played as before and only when loop is reached the update to the program 
becomes audible.


 Do you have any formal model of how exactly this works? With a formal
 model, it might be possible to concoct an implementation that can embed
 the DSL into Haskell.

I am afraid from the point of view of formal languages this is an ugly 
hack. You have no referential transparency. E.g. as noted above at time 
point zero the term 'loop' may refer to 'NoteOn 23' and two seconds later 
it may refer to 'PgmChange 42'. The whole matter of sharing and buffering 
of reduced terms is no longer an issue of performance but an issue of the 
semantics. As I said above,

  loop1 = append melody loop1

allows you to continue with 'loop2' after 'loop1' by changing it to

  loop1 = append melody loop2

on the fly, but if you would have written

  loop1 = cycle melody

in the first place, this would not be possible. (Only by changing the 
definition of 'cycle'.)


On the other hand you can consider live editing of the program as a phase 
of development and debugging. You may finally decide to just run the 
program and play the music without any modifications. In this case you 
have a clean referentially transparent language.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] real-time sound synthesis (Was: Haskell live sequencing)

2011-11-16 Thread Henning Thielemann

Hi Bernardo,


On Tue, 15 Nov 2011, Bernardo Barros wrote:

 The whole idea of writing dsp algorithms directly in haskell is very
 interesting. I think it would be much more intuitive to extend synthesis
 systems like this.

That's what I hope for. Currently there still some low-level clutter 
around.

 But there are so many good options like supercollider (and hsc3 for
 instance), that it is very discouraging using a less efficient system
 for real-time.

 You told you could not do much complex synthesis with your system,

Did I tell this? What I wanted to express was, that latency and complexity 
of sounds are two separate issues. I can't reduce latency by reducing 
complexity. But I can handle complex sounds at the same latency as simple 
sounds.

 is this because you don't have a bigger block size?

I can freely choose the block size.

 Or Haskell garbage collector? What is your strategy in this respect?

When I had a problem with the garbage collector I had actually always a 
problem with a space leak. I am now on a good way to eliminate them using 
arrows instead of lazy lists. However I find programming this way more 
complicated.

 There are other systems trying to make decent DSP performance with
 languages other then C. The second version of JSyn is all written in
 pure Java, not c like the first version. That is good! The same language
 for high and low level work,

Yes, that's I achieve with LLVM and Haskell, too.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] real-time sound synthesis (Was: Haskell live sequencing)

2011-11-16 Thread Henning Thielemann

On Tue, 15 Nov 2011, Stephen Sinclair wrote:

 However, there is certainly potential to implement a FAUST-like DSL in
 Haskell.  The trick would be to compile it to machine code in-memory
 in a non-realtime thread and be able to dynamically modify the DSP
 graph by adding and removing blocks without interrupting the audio
 stream.  I believe this could be achieved by atomic pointer swapping
 to new bits of real-time code, but I haven't personally tested the
 idea.

 It's already possible to do similar things using Haskell-LLVM, isn't it?

In terms of Haskell, FAUST is a DSL based on arrows. I also use (causal) 
arrows for LLVM based signal processing.

 Of course swapping sub-blocks in and out of a larger DSP graph implies
 that on some level there is a master mixer or something, which is
 itself a DSP block.  This implies to me that there are multiple levels
 of optimization possible.  If a subblock is swapped out, should its
 parent be recompiled for maximum efficiency?  How do you decide where
 to stop? Maybe some incremental compilation strategy could be used to
 first swap a child and then recompile parents up the chain, eventually
 resulting in the whole graph being recompiled.

In my LLVM software synthesizer I already swap blocks in and out, since 
whenever a key is pressed a new signal generator is started and it is 
stopped and removed when the release phase terminates. The results of all 
signal generators are mixed. However this is hard-coded and does not yet 
use one of the functional reactive programming frameworks.

I considered on-demand compilation, that is compilation of instrument 
specific code once the instrument is used first, but this would yield a 
high latency for the first played tone.

 In any case, another difficulty is maintaining state between
 recompilations.  If a block is swapped out and the parent is
 recompiled, it would be desirable for any state (filter history, etc)
 in the parent not affected by the child to remain intact.  This may
 require some tracking strategy in the compiler, but I see it as a
 possibly surmountable obstacle.

Because of all of these difficulties and because I suspect that the 
benefit is small, I have not tried to do clever recompilation and 
optimization during the musical performance.
  Currently I structure instruments like this:
complexSound (append attackDecay release)
  where each of attackDecay, release, complexSound contains a block of LLVM 
compiled code and Haskell manages routing of the signal chunks.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] umbrella term for flats and sharps

2012-01-16 Thread Henning Thielemann

I have a question for the native English speaking musicians: What is the 
umbrella term for flats and sharps? In German it is Vorzeichen and in 
Dutch it is voortekens, which could be translated to signs. 
Background: MIDI File specification allows to set a key signature and 
represents it by the number of flats or sharps and the mode (major or 
minor), where a negative number measures flats and a positive number 
counts sharps. Is signs a good term for this count or what else is 
reasonable?
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] umbrella term for flats and sharps

2012-01-16 Thread Henning Thielemann

On Mon, 16 Jan 2012, Duncan Mortimer wrote:

 Hi Henning,

 I just learnt that my previous message was incorrect:  I hadn't
 realised that an 'accidental' refers only to notes modified from the
 current tonal context.  Thankyou wikipedia!

This was, what I learned from Wikipedia, too. :-)

 Sorry about that.  I'm not sure what the technically correct English
 term is for the 'number of sharps and flats in the key signature'.
 'Signs' seems reasonable to me.

Ok
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] HaL-7, 2012-07-13, Call for submissions

2012-04-23 Thread Henning Thielemann


Call for submissions and Save the date

for our local Haskell Workshop in Halle/Saale, Germany.

Tutorials, talks, demonstrations ... everything welcome.

Workshop language is German (mainly), and English (by request).

Submission deadline: May, 21, Workshop date: July, 13



Workshop homepage: http://iba-cg.de/hal7.html


The complete call in German:

-

Aufruf zum Einreichen von Beiträgen
und Hinweis zum Vormerken des Termins

Was: Haskell-Treffen HaL-7
Wann: Freitag, 13.07.2012
Wo: Institut für Informatik an der Martin-Luther-Universität in Halle an
der Saale

Wir suchen Vorträge zu Haskell im Besonderen und der funktionalen
Programmierung im Allgemeinen, zum Beispiel zu den Themen

* Neues von Sprache, Bibliotheken, Werkzeugen,
* Anwendungen von Kunst bis Industrie,
* Lehre an Schulen und Hochschulen,

gerne aber auch zu anderen Themen.

Die Beiträge können präsentiert werden als

* Tutorium (60 .. 90 min)
* Vortrag (30 min)
* Demonstration, künstlerische Aufführung

Die Veranstaltungssprache ist Deutsch, in begründeten Ausnahmen
Englisch. Presentations will be given in German but we can switch to
English if requested.

Bitte reichen Sie Kurzfassungen der Beiträge ein (2 bis 4 Seiten), die
dem Programmkomitee eine Einschätzung ermöglichen. Die Kurzfassung soll
mit einer Zusammenfassung (10 Zeilen) beginnen und einem
Literaturverzeichnis enden.

Teilnehmer des Workshops sind Interessenten (keine Erfahrung mit
Haskell/FP), Anfänger (wenig Erfahrung) und Experten. Wir bitten die
Vortragenden, die Zielgruppe des Beitrags anzugeben und die nötigen
Vorkenntnisse zu beschreiben. Bei Tutorien sollen Teilnehmer auf eigenen
Rechnern arbeiten. Bitte beschreiben Sie dazu die vorher zu
installierende Software.

Schicken Sie Beitragsvorschläge als PDF-Dokument bis zum

21.05.2012

per Mail an hal-committee at iba-cg punkt de oder an ein Mitglied des
Programmkomitees.


Programmkomitee

* Henning Thielemann - Univ. Halle (Vorsitzender),

* Petra Hofstedt - BTU Cottbus,
* Alf Richter - iba CG Leipzig,
* Uwe Schmidt - FH Wedel,
* Janis Voigtländer - Univ. Bonn,
* Johannes Waldmann - HTWK Leipzig.



Mit besten Grüßen
Henning Thielemann

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] hosc, rfc

2012-05-25 Thread Henning Thielemann


On Fri, 25 May 2012, Rohan Drape wrote:


Dear List,

I've made some rather basic changes to hosc.

This message is to let people know before it ends up on hackage, and
because I'm interested in any comments.

Through to hosc-0.11 the representation has been:

 data OSC = Message Address [Datum] | Bundle Time [OSC]

At http://slavepianos.org/rd/sw/hosc it is now:

 data Message = Message Address [Datum]
 data Bundle = Bundle Time [Message]
 data Packet = P_Message Message | P_Bundle Bundle
 class OSC o where toPacket :: o - Packet ...

The initial representation followed the OSC specification and allowed
nested bundles.


As far as I understand, people can still use the Packet type, if they 
prefer case analysis to type distinction. However, I think the transition 
would be easier if the names Packet and OSC are swapped and you provide 
smart constructors that emulate the behaviour of old Bundle and Message 
constructor. I think I have never pattern matched on the old OSC 
constructors but I used the Bundle constructor for construction. With OSC 
keeping its semantics, all existing type signatures can remain.



Thus I propose:


 data Message = Message Address [Datum]
 data Bundle = Bundle Time [Message]
 data OSC = OSCMessage Message | OSCBundle Bundle
 message addr dat = OSCMessage (Message addr dat)
 bundle time msgs = OSCBundle (Bundle time msgs)
 class Packet o where toOSC :: o - OSC ...



 I don't think I have used nested bundles - how would the time stamp be 
interpreted? But if people need it then you could provide it by a Bundle 
type with type parameter. Then you could statically enforce a certain 
nesting depth by making the type parameter Message or Bundle, or you can 
do arbitrary nesting by using the OSC type as parameter.



 data Message = Message Address [Datum]
 data Bundle msg = Bundle Time [msg]
 data OSC = OSCMessage Message | OSCBundle (Bundle OSC)
 message addr dat = OSCMessage (Message addr dat)
 bundle time msgs = OSCBundle (Bundle time msgs)
 class Packet o where toOSC :: o - OSC ...



This solution would give you all of the type safety of your new approach 
and easy transition for the people who are used to the old approach.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Lilypond parsing with Haskore

2012-06-30 Thread Henning Thielemann


On Fri, 29 Jun 2012, Corbin Simpson wrote:


I've written a library, called Lye, that compiles a strict subset of
Lilypond to a meta-MIDI format.


Lilypond can generate MIDI files for the notesheets you create.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Audio Processing and Sound Sunthesis in Haskell

2012-07-02 Thread Henning Thielemann


On Sun, 1 Jul 2012, CK Kashyap wrote:


Hi All,
I started reading the paper Audio Processing and Sound Sunthesis in Haskell - 
I was wondering if there is
some place I could download the source code from? I'd appreciate it very much 
if you could point me to the
source. I dont know if it is part of Haskore - but I'd prefer a standalone 
source code so that I could work
with it as I read the paper.


I want to add, that in the meantime we developed a kind of interactive 
Haskore:

   http://hackage.haskell.org/package/live-sequencer

Here is a demonstration of what 'scanl (=:=) empty' means for music:
   http://www.youtube.com/watch?v=sXywCHR9WwE

:-)

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Audio Processing and Sound Sunthesis in Haskell

2012-07-02 Thread Henning Thielemann


On Sun, 1 Jul 2012, CK Kashyap wrote:


Hi All,
I started reading the paper Audio Processing and Sound Sunthesis in Haskell - 
I was wondering if there is
some place I could download the source code from? I'd appreciate it very much 
if you could point me to the
source. I dont know if it is part of Haskore - but I'd prefer a standalone 
source code so that I could work
with it as I read the paper.


I see you meant a different paper than my Audio Processing using 
Haskell. Then my answer was not correct and Paul Hudak may answer 
instead.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] asound not found during Euterpea installation

2012-07-07 Thread Henning Thielemann


On Thu, 5 Jul 2012, CK Kashyap wrote:


Hi all,

I tried to install Euterpea on ubuntu 12.04 and ran into this problem. Can 
someone tell me the exact package
name that I need to install using apt-get to solve this problem?

Resolving dependencies...
Configuring PortMidi-0.1.3...
cabal: Missing dependency on a foreign library:
* Missing C library: asound
This problem can usually be solved by installing the system package that
provides this library (you may need the -dev version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.


apt-get install libasound2-dev


(found with: dpkg --search alsa/pcm.h )

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] asound not found during Euterpea installation

2012-07-08 Thread Henning Thielemann


On Sun, 8 Jul 2012, CK Kashyap wrote:


After this, I tried to do play childSong6 - nothing happened - my sound card 
probably does not support
midi. So I installed timidity and
ran it as follows timidity -iA -Os - I re-ran ghci and found that it still 
did not play the music. So did
a  and generated the midi file. timidity played it beautifully


Are you on Linux? 'play' is part of the SoX package and should only play 
pcm audio files. It may try to play the MIDI data as raw pcm data, though.


As a first test you can play a MIDI file using simply 'timidity file.mid'.

If you run timidity with -iA option, then it is in server mode and may be 
controlled by other programs like an external keyboard, 'pmidi', our 
live-sequencer or some Haskell code from GHCi like reactive-balsa. In 
order to actually control timidity by another program you must connect the 
controlling program and the controlled program either from the 
command-line with 'aconnect' or from a GUI like 'patchage', 'qjackctl', 
'alsa-patch-bay' or 'kaconnect'. With 'pmidi -l' or 'aconnect -o -i' you 
can list servers and clients with their ALSA address.
 I assume that Euterpea uses PortMidi which uses ALSA but in order to be 
portable PortMidi does not integrate so nicely with the ALSA framework. A 
program using PortMidi does not appear as an ALSA client or server, it can 
only directly control other programs. I think the default is that PortMidi 
writes to the Client 'Midi Through'. So you must connect 'Midi Through' to 
TiMidity:


$ aconnect 'Midi Through' TiMidity



I still cannot believe the quality of synthesis  does timidity synthesize 
the instruments or it has
stored samples???


TiMidity is a sampling synthesizer. If you want better samples you may 
install package fluid-soundfont-gm. (For real sound synthesis in Haskell I 
can assist building synthesizer-llvm. :-)


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Starquake music

2012-09-25 Thread Henning Thielemann


On Mon, 24 Sep 2012, David Barbour wrote:


Wonderful work, Henning! Yours is definitely better than the original.
May I suggest another? Try some dungeon music from Legacy of the Wizard.


I don't know this game - have to scan my Speccy ClassiX CD. Another game 
with cool music I remember is in Ping Pong.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] ANN: hsc3-process-0.8 and hsc3-server 0.5

2012-12-20 Thread Henning Thielemann


On Thu, 20 Dec 2012, Miguel Negrao wrote:

Writing long functions or expressions in emacs to be run in ghci is a 
bit difficult because you can’t use the normal indentation rules (at 
least I haven’t figured out how), so one possibility would be to just 
write those functions in a .hs file and load the file to ghci, but every 
time one does that the previous bindings are destroyed and loose access 
to the server that we booted, and any resources on it, so that doesn’t 
work for interaction with a sc server via hsc3-server. Does anyone have 
any tips about this ?


Instead of indentation you might break big expressions into small 
expressions and local functions using 'let'. Would that help? Nonetheless, 
you lose what you wrote if you leave GHCi. (If you are lucky some lines 
are stored if you re-enter GHCi and can be retrieved with cursor-up.)
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] ANN: hsc3-process-0.8 and hsc3-server 0.5

2012-12-20 Thread Henning Thielemann


On Fri, 21 Dec 2012, Rohan Drape wrote:


You can run the 'unlayout' process over outgoing expressions in emacs
using 'shell-command-to-string'.


You can define GHCi commands (those with leading colon) based on Haskell 
functions. Maybe you can create an :unlayout command?


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] port midi

2012-12-27 Thread Henning Thielemann


On Wed, 26 Dec 2012, Balazs Komuves wrote:


I cannot help with portmidi, however, if you don't need Linux compatibility,
the hmidi package (http://hackage.haskell.org/package/hmidi/) works on both
OSX and Windows (and does not have any external dependencies). There are
some simple examples included in the package. Don't forget to use the
--threaded flag when building.


JACK and the Haskell jack package are another option.

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] hsc3-server interactive session was ANN: hsc3-process-0.8 and hsc3-server 0.5

2013-01-04 Thread Henning Thielemann


On Fri, 4 Jan 2013, Miguel Negrao wrote:

I’m happy to report that I’ve found that leksah has a quite nice and 
working interactive ghci pane. It has a window for writing code (a 
scratch buffer), where one can use indentation based rules, and it has 
another pane with all the variables defined so far. To evaluate code one 
either selects a portion of code or puts the cursor on a line and hits 
ctrl-enter.  It feels very interactive.


Thank you for this hint!


If I want to run multiple IO actions in ghci and bind the result to 
“variables” that I can use later, is this the best way ?


(engine,r,send) - do
   engine - MS.new withDefaultSynth
   let send a = MS.execute engine $ exec_ a
   r - MS.execute engine rootNode
   return (engine, r, send)


In GHCi you could just write

Prelude engine - MS.new withDefaultSynth
Prelude let send a = MS.execute engine $ exec_ a
Prelude r - MS.execute engine rootNode


But if you want to bundle all three actions, then your do-block is 
certainly the best way.
___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] special Rate types for hsc3

2013-01-14 Thread Henning Thielemann


Hi Rohan,

I just ran into another instance of using an UGen with a Rate type that it 
does not support. I got the error:


   *** Exception: mk_osc: rate restricted: (KR,[AR],Pulse)

but I thought this could also be solved on the type level.


data AudioRate = AudioRate
data ControlRate = ControlRate

class GenericRate rate where
   toRate :: rate - Rate

instance GenericRate AudioRate where
   toRate AudioRate = AR

instance GenericRate ControlRate where
   toRate ControlRate = KR


impulse :: GenericRate rate = rate - UGen - UGen - UGen

pulse :: AudioRate - UGen - UGen - UGen


Even better would be to make the rate a type parameter of UGen:


impulse ::
   (GenericRate rateFreq, GenericRate rateWidth, GenericRate rate) =
   UGen rateFreq - UGen rateWidth - UGen rate

pulse ::
   (GenericRate rateFreq, GenericRate rateWidth) =
   UGen rateFreq - UGen rateWidth - UGen AudioRate

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] private e-mail archive

2013-01-14 Thread Henning Thielemann


I found that the e-mail archive of haskell-art is now private. Is this 
intended?


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] testing if values can be applied to polymorphic functions

2013-02-07 Thread Henning Thielemann


On Thu, 7 Feb 2013, alex wrote:


Now I have idea for making this more interesting and practical (for
live music-making, if nothing else), and would like to re-write it all
in Haskell.  Testing type compatibility of expressions is foxing me
though.

For example, say I have (++) and [1,2,3].  I then want to see if a
value of type (Num a = [a]) can be applied to a function of type ([a]
- [a] - [a]).


That is, you want to do Haskell type checking in Haskell? I do not 
understand how Typeable could help here. If you are happy with a 
simplified Haskell type system you could try the type checker from the 
Helium project. I have also heard that the Haskell suite shall contain a 
type checker.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] talks concerning Haskell on Linux Audio Conference, May, 9th and 10th

2013-05-09 Thread Henning Thielemann


If you are interested in the two talks at Linux Audio Conference by Renick 
Bell and me you can watch them life and ask questions via IRC at:

  http://lac.linuxaudio.org/2013/stream

They are:
  May,  9th, 15:10  Renick Bell: An Approach to Live Algorithmic Composition 
using Conductive
  May, 10th, 15:10  Henning Thielemann: Live music programming in Haskell


Best,
Henning

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


Re: [haskell-art] Generating sounds in Haskell

2013-09-01 Thread Henning Thielemann


On Sun, 1 Sep 2013, Noah Hall wrote:


Hi all,

I'm currently working on a game where the music is being generated through 
converting the pixels on screen
into musical tones. At the moment, I have a working prototype in Python, 
however, I'm working on converting
it into Haskell. The question I have is are there any recommended texts or open 
source libraries that I
should look at in order to improve the conversion process? I intend on using 
the Data.WAVE module and simply
porting the variance and ADSR envelope algorithms over. Any other suggestions 
regarding creating more
authentic tones would also be appreciated.


Is it important for you to generate particular sounds, or would it be ok 
for you to control a MIDI synthesizer like TiMidity via MIDI?


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] Haskell can sing

2013-12-01 Thread Henning Thielemann


Hi all,

it's again Advent time and I took the opportunity to program another song 
for you. Those who liked last year's songs [1,2,3] may also be interested 
in the new one:

   http://www.youtube.com/watch?v=0EQCgi5qa3E   Alta trinita beata

It employs the great Haskell live sequencer and a new speech synthesizer 
that I developed with Haskell and LLVM. You find additional information in 
the video description.



Best,
Henning


[1] http://www.haskell.org/pipermail/haskell/2012-December/023591.html
[2] http://www.youtube.com/watch?v=-fmxHM69zgI
[3] http://www.youtube.com/watch?v=O5k0wUh0lj8

___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell-art] abstract music from csound et.al. (Was: ANN - csound-expression-3.1.0)

2013-12-13 Thread Henning Thielemann


On Fri, 13 Dec 2013, Evan Laforge wrote:


This is my experience too (though I'm a notation guy, I tried hard
with DAWs but still found them slow and awkward).  And I've never
heard any music out of csound or other text languages that isn't more
or less abstract and sound-designy.  Maybe there is someone out there
that manages to do it, but I haven't heard them.

Music, as always, is largely determined by the tools used to create it.


At the Linux Audio Conference 2013 in Graz someone recommended in his talk 
not to think of audio programs as software but as instruments. For 
programs users request more and more features, whereas for instruments the 
restriction on certain producible sounds is a feature.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell art] HaL-9 - Call for Contributions

2014-04-12 Thread Henning Thielemann
Hi all,

in case you missed the announcement at:
http://www.haskell.org/pipermail/haskell/2014-March/024115.html

I'll forward it to here. Our workshop still lacks some art artifacts 
generated with Haskell.


 Original-Nachricht 

HaL ist ein lokaler Haskell-Workshop mit überregionaler Bedeutung, der
nun bereits das 9. Mal stattfindet. Dieses Jahr laden wir für den 20.
Juni ins Institut für Informatik an der Martin-Luther-Universität
Halle-Wittenberg ein.

Wir suchen Beiträge zu Haskell im Besonderen und der funktionalen
Programmierung im Allgemeinen, aber auch Anknüpfungen an andere
Programmierparadigmen.

Dabei interessieren wir uns unter anderem für die Themenbereiche

 * Neues von Sprache, Bibliotheken, Werkzeugen,
 * Anwendungen von Kunst bis Industrie,
 * Lehre und Forschung an Schulen und Hochschulen.

Die Beiträge können präsentiert werden als

 * Tutorium (etwa 90 min)
 * Vortrag (etwa 30 min)
 * Demonstration, künstlerische Aufführung

Die Veranstaltungssprache ist Deutsch, nach Absprache auch Englisch.
Presentations will be given in German but we can switch to English if
requested.

Bitte reichen Sie Kurzfassungen der Beiträge ein (max. 3 Seiten), die
dem Programmkomitee eine Einschätzung ermöglichen, sowie eine knappe
Zusammenfassung von etwa 100 Wörtern.

Teilnehmer des Workshops sind Interessenten (keine Erfahrung mit Haskell
oder funktionaler Programmierung), Anfänger (wenig Erfahrung) und
Experten. Wir bitten die Vortragenden, die Zielgruppe des Beitrags
anzugeben und die nötigen Vorkenntnisse zu beschreiben. Bei Tutorien
sollen Teilnehmer auf eigenen Rechnern arbeiten. Bitte beschreiben Sie
dazu die vorher zu installierende Software.

Senden Sie die Beitragsvorschläge als PDF-Dokument bis zum

  27. April 2014

an
  hal-commit...@iba-cg.de

Wir werden Ihnen bis zum 9. Mai mitteilen, ob wir Ihren Beitrag in das
Programm aufnehmen.


Für das Organisationsteam
Henning Thielemann


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/7jyItVXjYYVE7UvjRTVa9p

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Haskell art in the media

2014-04-14 Thread Henning Thielemann
Am 14.04.2014 02:49, schrieb Evan Laforge:

 I know the question isn't for me, but I do the same kind of stuff and
 the gc isn't a problem for me because latency is not a problem.  I
 think only time latency is relevant is when you want external input to
 immediately have a reaction.  So basically only if you're creating a
 physical performance instrument and want that ear-to-hand feedback
 cycle.

right

   I'm guessing livecoding doesn't care that much, because while
 you want your change to be reflected soon, it's not critical that it
 happen within 4ms of your hitting enter.  It's probably going to wait
 until the next beat or cycle anyway.

Yes, for our live sequencer we also accept a latency of 0.1 seconds.

 Henning Thielemann's synthesizer work would care about GC though,
 because he's making a real time instrument.  He can speak for himself,
 but I seem to recall he either is very careful to get allocation out
 of the core loop, or he compiles down to allocation-free code via LLVM
 or something.  But I'm guessing that's more for performance on the
 synthesis side than latency.

Right, I am using LLVM mainly for increasing performance. Keeping 
allocations out of the core loop using LLVM would be nice, but there is 
still a lot of Haskell code involved in that loop. This becomes a 
problem with short buffers, like the standard buffer of JACK containing 
only 64 samples, i.e. ~1ms at 48000.

 All that said, I think if you don't allocate unreasonable amounts,
 even major GCs are pretty fast.  I wouldn't worry about it for soft
 real time like music.  You might have to spend some time with the
 profiler and threadscope to work out your lag/drag, is all.

My early problems with the garbage collector were space leaks. The more 
memory the GC has to process the slower it becomes. I used lazy lists 
and it was very easy to produce space leaks and it was very hard to get 
rid of them. Since I switched to causal arrows these problems have gone.


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/4Nuakfn9O1M2c86wRVJNmW

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


[haskell-art] Automated YouTube uploads

2014-05-13 Thread Henning Thielemann
In case I did not announce it before - I wrote a set of two small 
programs that upload videos to YouTube. It is useful in two situations:


1. Upload a list of videos with metadata fetched from a spreadsheet.
2. Upload from a remote machine without a graphical browser.

http://hackage.haskell.org/package/youtube

You need 'curl' to be installed and you need to register for a YouTube 
developer key.


___
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art


[haskell art] Automated YouTube uploads

2014-05-14 Thread Henning Thielemann
In case I did not announce it before - I wrote a set of two small
programs that upload videos to YouTube. It is useful in two situations:

1. Upload a list of videos with metadata fetched from a spreadsheet.
2. Upload from a remote machine without a graphical browser.

http://hackage.haskell.org/package/youtube

You need 'curl' to be installed and you need to register for a YouTube
developer key.


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/3AtsLk1V1i57vEcCDgT25c

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] [haskell-art] Retirement of mailman list - last email

2014-05-15 Thread Henning Thielemann
Am 14.05.2014 12:03, schrieb alex:
 Dear all,

 This is the last email to the haskell-art mailing list, as hosted by mailman.

 To continue receiving messages to haskell-art, make sure you are
 subscribed to the new groupserver forum here:
http://lurk.org/groups/haskell-art/

It seems the new web-site requires javascript in order to see the 
archive of posts. That's a real regression compared to the former setup. :-(


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/3yANtL60DQYLAOLeJZ8eQ6

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] [haskell-art] euterpea realtime? or other realtime audio in haskell

2014-05-15 Thread Henning Thielemann
it seems that my comment got lost ...


Am 14.05.2014 00:44, schrieb Ben Burdette:

 I'm doing a project where incoming values from sensors are to be turned
 into music.  currently I have a haskell program that scans the sensors
 and generates OSC messages as a result.  So far so good.

How about this one:
   https://www.youtube.com/watch?v=om5q_Ror_bo

However, it is not Euterpea but synthesizer-llvm.

See example/Synthesizer/LLVM/LNdW2011.fly as an entry to the code.


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/29RU23RSbvdC5aP64YLt8u

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] [haskell-art] Retirement of mailman list - last email

2014-05-15 Thread Henning Thielemann
Am 15.05.2014 12:27, schrieb Francesco Ariis:

 If you want to follow new topics and posts sans js, you *can* do it via the
 built-in RSS feeds [1] [2] (or alternatively using Gmane [3], which comes with
 two different interfaces)

That's good news.

 [3] http://news.gmane.org/gmane.comp.lang.haskell.art

I added this one to:
https://www.haskell.org/haskellwiki/Haskell_art


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/o3bPH1QzDKAv73QxgUZge

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] haskell dependency management over time

2014-07-01 Thread Henning Thielemann
Am 01.07.2014 17:17, schrieb Al Matthews:

 Hello .. I find Haskell package-management to be a bit of a dark art.

Do you mean management as a maintainer or as a user?

For maintainers I wrote some scripts:
http://hackage.haskell.org/package/cabal-scripts
http://hackage.haskell.org/package/darcs-scripts

However, updating many packages for new major releases of basic packages 
like 'transformers' or new Cabal features or new GHC features, still 
costs lot of time.


As a user I have not tried cabal-dev and friends. I am just using 
'cabal' and since there are so many versions of the packages and GHC 
around, many packages are installed multiple times (in different package 
and GHC versions) on my machine, such that the dependency hell hardly 
occurs.


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/5IaQGgN0fuNugfHYLDkgSk

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] haskell dependency management over time

2014-07-01 Thread Henning Thielemann
Am 01.07.2014 17:27, schrieb Henning Thielemann:

 As a user I have not tried cabal-dev and friends. I am just using
 'cabal' and since there are so many versions of the packages and GHC
 around, many packages are installed multiple times (in different package
 and GHC versions) on my machine, such that the dependency hell hardly
 occurs.

I should add, that installing multiple packages at once with 'cabal 
install' fixes package incompatibilities in many cases.


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/7e0vem43LgDpzKXOaGCmrK

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


[haskell art] group management

2014-08-17 Thread Henning Thielemann
Hi alex,

it seems I am subscribed twice. How can I find out about all my 
subscriptions?


thanks,
Henning

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/77LyF64GuYSCMVr15MEJr1

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Any FP ideas for Tidal?

2014-09-12 Thread Henning Thielemann
Am 12.09.2014 um 11:42 schrieb Alois Cochard:

 The only thing I can tell you is that I use Arrow a lot to map element of a
 tuple, and that is really neat (took me a while though to get the signature
 of the method and map to the instance defined).

 Basically:
 f *** g = \(a, b) - (f a, g a)

 Now that I got this one, I can see the more general abstraction and that
 looks extremely powerful.

This means using (***) for the instance Arrow (-), which is not really 
spectacular. If you want to abstract at all, the Bifunctor class might 
be closer. I have the (***) as mapPair in my utility library:
 
http://hackage.haskell.org/package/utility-ht-0.0.10/docs/Data-Tuple-HT.html


A much more interesting application of Arrows is this: You can express 
causal audio signal processors using Arrows. Fortunately the Arrow 
combinators preserve causality. If you use feedback, a causal signal 
processor warrants that there are no deadlocks. A causal signal 
processor is also required for real-time processing.

See for instance:
http://arxiv.org/abs/1004.4796
http://haskell.cs.yale.edu/?post_type=publicationp=573

http://www.haskell.org/haskellwiki/Causal_Commutative_Arrows


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/5Hdhs1i3KTvq2DDavuexeW

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Any FP ideas for Tidal?

2014-09-12 Thread Henning Thielemann
Am 12.09.2014 um 12:51 schrieb Alois Cochard:

 Sorry if that was not clear, I was not trying to sound spectacular or show
 the most-abstract/idiomatic way to map on a tuple.

I did not expect that. I wanted to say, that if you apply (***) to 
functions you may learn something about functions but not about Arrows. 
At least, you may learn that functions are an instance of Arrow.

 I was trying to help by pointing a simple thing I understood while playing
 with Arrow.


-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/6Y5W4tvtKOBgSH1cyDoWs6

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Any success with haskore-realtime on ghc 7.8.3 ?

2014-10-31 Thread Henning Thielemann

On Fri, 31 Oct 2014, Henning Thielemann wrote:

 On Fri, 31 Oct 2014, RadEd wrote:

 i've been trying to make haskore-realtime (and, in the long run, 
 haskore-supercollider) work in the year 2014 (OS: Arch Linux, 64Bit), but 
 had no success compiling the package so far, even in a sandbox 
 (directory-1.0.0.3 fails to build ...).
 
 Would it be hard to upgrade to recent library versions ? Though i have some 
 knowledge of Haskell as a language, i'm pretty new to the development 
 system ...

 I have updated the packages (up to haskore-supercollider) at Hackage to work 
 at least with GHC-7.4.2. I am continueing with GHC-7.8.3.

I have now updated everything to GHC-7.8.3 and hsc3-0.15.

I may like to play around with supercollider-ht:Sound.SC3.Example.Effect 
and the Air and Morph examples from haskore-supercollider.

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/6aHWMW1qz2yJaGcypTE1cp

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] problem with install csound-expression

2014-11-02 Thread Henning Thielemann

On Sun, 2 Nov 2014, Anton Kholomiov wrote:

 Your version of ghc is too old.

How about specifying 'base =4.6' in the cabal file?

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/7qHxti8yqEtPKMaeadtFXy

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] problem with install csound-expression

2014-11-02 Thread Henning Thielemann

On Sun, 2 Nov 2014, Anton Kholomiov wrote:

 Thanks for the tip. Do you think that it allow the users of the older
 versions of ghc to install without errors?

catchIOError exists since GHC-7.2.

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/2UGkxDnffeOzevQ6yTq5g6

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Music made with Haskell

2014-11-29 Thread Henning Thielemann

On Fri, 28 Nov 2014, Anton Kholomiov wrote:

 I wrote two tracks completely with Haskell.
 You can listen to them on the soundcloud:

 https://soundcloud.com/anton-kho/celtic

 https://soundcloud.com/anton-kho/invisible-ocean

cool, cool, cool

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/6fgv2uceTyWPsIAjdTCg32

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Music made with Haskell

2014-11-29 Thread Henning Thielemann


On Sat, 29 Nov 2014, Francesco Ariis wrote:

 On Fri, Nov 28, 2014 at 12:47:48PM +0400, Anton Kholomiov wrote:
 I wrote two tracks completely with Haskell.
 You can listen to them on the soundcloud:

 I downloaded the zip'd source, but I cannot listen to your track
 on soundcloud (it requires Flash, and Linux doesn't play well
 with Flash).

Web programmers usually invest a lot of effort in making things 
non-functional for a wide range of systems. Soundcloud could provide a 
simple link to an MP3 file, but this is a no-go, since that is not hip in 
any way.

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/6Ne2f5udTuC54BKIPwsHDs

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


[haskell art] music recycling

2014-12-16 Thread Henning Thielemann

Here is a new musical christmas experiment:

I chopped 4 compact disks of children musicals by the German composer and 
all-round musician Reinhard Lakomy [1] into small pieces and re-assembled 
them to match a famous christmas song. As chunks lengths I tried both 
about 1/6s [2] and 1/3s [3]. Generally it holds: The longer the chunks, 
the more you can recognize the origin of the pieces. The shorter the 
chunks, the better is the approximation to the christmas song (and the 
longer takes the computation). If you want to guess the song, then click 
now and ignore the video title. :-)

[1] http://de.wikipedia.org/wiki/Reinhard_Lakomy
[2] https://www.youtube.com/watch?v=aJWp4pkIkQE
[3] https://www.youtube.com/watch?v=jxC5bcwXCyQ


The first collage is blocked in Germany, since YouTube thinks that it is 
too close to the recording of the christmas song. However, no wave from 
the christmas song recording was copied to the collage and honestly, the 
collage sounds very different from that recording!

YouTube believes to recognize the second collage as the Greek version 
Touli Gia To Hristouli. It seems to me that YouTube's recognition 
algorithm exhibits a sense of humor in this case.


You can download the project's code from the darcs repository:

[4] http://code.haskell.org/~thielema/sound-collage/

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/27SkS6ZdMoRhcQnOlC44EC

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] music recycling

2014-12-17 Thread Henning Thielemann

On Tue, 16 Dec 2014, Claude Heiland-Allen wrote:

 On 16/12/14 19:36, Henning Thielemann wrote:
 You can download the project's code from the darcs repository:

 [4] http://code.haskell.org/~thielema/sound-collage/

 needs a newer numeric-prelude than that on Hackage..

The good news is that it actually does not need the newer version of 
numeric-prelude. The bad news is that fft-0.1.8 is required. I have 
uploaded this one and checked with cabal-sandbox that it can be installed 
with all dependencies from Hackage. Cabal-sandbox is really great for 
these kinds of tests!

However, the program is still really rough. Parameters like the chunk size 
are currently hard-wired, option handling is rudimentary (watch 
src/Main.hs) and there is potential for optimizations. Currently the 
program needs many minutes for building a pool of chunks. If you are 
interested in testing the program I am willing to fix these issues.

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/45DwmH7wCLPehz6j0rJ6Ya

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] Euterpea on ghc 7.10.1 ?

2015-04-13 Thread Henning Thielemann

On Mon, 13 Apr 2015, Niklas Reppel wrote:

 Seems to be a problem with CCA (whatever that is), which doesn't
 compile ... any ideas ?

CCA = Causal Commutative Arrow

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/6fNlPMxMc6l2io3AfpJpaj

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] alsa-seq example

2015-05-22 Thread Henning Thielemann

On Fri, 22 May 2015, Miguel Negrão wrote:

 Does anyone have some example code of how to use alsa-seq to get midi events
 from a midi controller.

This should help:
   https://hackage.haskell.org/package/alsa-seq-0.6.0.5/src/examples/dump.hs
-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/7J8abgRYlyLDdaIJRhD0ps

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] alsa-seq example

2015-05-22 Thread Henning Thielemann


On Fri, 22 May 2015, Miguel Negrão wrote:

 On 22-05-2015 12:01, Henning Thielemann wrote:

 On Fri, 22 May 2015, Miguel Negrão wrote:

 Does anyone have some example code of how to use alsa-seq to get midi events
 from a midi controller.

 This should help:
https://hackage.haskell.org/package/alsa-seq-0.6.0.5/src/examples/dump.hs


 Running the code in that file doesn't produce any output after waiting
 for an event: when I move the sliders. I have the controller connected
 and it appears in the list-ports.hs example. I'm I supposed to change
 something in the code to point to the port of my controller ?

Have you connected the controller to the dump example using 'aconnect' or 
'patchage' or the like?

E.g. I have to run:

$ aconnect 'SAMSON Graphite 49' Haskell-Dump


 Is portmidi perhaps easier to use ? I did get that working, but it
 doesn't seem to have any callback interface, it seems I have to poll it,
 and it is a bit low level too.

I have no experience with PortMidi. JACK and the Haskell jack package are 
an alternative.

 It would be nice to have higher level MIDI device layer similar to
 SuperCollider.

There is the midi-alsa package that maps alsa-seq events to events from 
the 'midi' package. Do you consider this higher level? There is also the 
reactive-balsa package that provides functional reactive programming of 
ALSA via tha reactive-banana framework.
-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/KNUwMta2GVsvncKbRnTBz

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] MIDI device ID in alsa-seq

2015-09-23 Thread Henning Thielemann

On Wed, 23 Sep 2015, amin...@gmail.com wrote:

> It may not be called "device ID" in alsa-seq but my question is how 
> to distinguish between midi events that came from different sources.

In Event.T there is a record field called 'source' that has the type 
Address.T:

https://hackage.haskell.org/package/alsa-seq-0.6.0.5/docs/Sound-ALSA-Sequencer-Address.html#t:T

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/1K2jfKKzNEezvXdPxfCeZM

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] MIDI device ID in alsa-seq

2015-09-22 Thread Henning Thielemann

On Mon, 21 Sep 2015, amin...@gmail.com wrote:

> I'm not seeing it. Can you point to the type itself, or the module it's 
> in?

I still do not know what MIDI device ID you mean. Can you please tell me 
the record type and field name you refer to? Is it in the Event module:

https://hackage.haskell.org/package/alsa-seq-0.6.0.5/docs/Sound-ALSA-Sequencer-Event.html

?

You may also inspect the source code.

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/2BOLVGPRVvkjtjqXDL3Psq

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] the library of beautiful instruments implemented in haskell / csound

2015-09-21 Thread Henning Thielemann

On Thu, 17 Sep 2015, Evan Laforge wrote:

> On Wed, Sep 16, 2015 at 12:59 PM, Anton Kholomiov
>  wrote:
>> That's the first piece of music done with csound-expression
>> not by me. I'm very happy to listen to it. I'm biased as an author.
>> and you have managed to do it so quickly!
>
> I was going to say, not only do these music production libraries tend to 
> lack instruments, they also tend to lack actual music.

That's my observation, too. Maybe they are developed for something 
different?

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/4fG8SEx9deEpstiCFva9CH

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] alsa seq queue error

2015-11-21 Thread Henning Thielemann

On Sat, 21 Nov 2015, Paolino wrote:

> Hello Henning, this program crashes with resource temporarily unavailable, as 
> soon as I attach it to a midi consumer.
> 
> I couldn't find an example on how to fix it.

I can reproduce the problem, but I have no idea what your program should 
do if it would work. 'top' reports 100% CPU usage. It looks suspicious to 
me that you send a Queue event to all subscribers. I assume that you must 
send it to Addr.systemTimer, which is what Queue.control does for you. 
Btw. the identifiers in the alsa-seq package are intended for qualified 
imports, as it is demonstrated in the 'examples' directory. Without 
qualification a program becomes pretty incomprehensible. examples/beat.hs 
also shows how to send a QueueStart event.



> import Prelude hiding (show)
> 
> import Sound.ALSA.Sequencer.Address
> import Sound.ALSA.Sequencer.Client
> import Sound.ALSA.Sequencer.Port
> import Sound.ALSA.Sequencer.Event hiding (time)
> import Sound.ALSA.Sequencer.Connect
> import Sound.ALSA.Sequencer.Queue
> import Sound.ALSA.Sequencer
> import Sound.ALSA.Exception 
> import Sound.OSC
> 
> import Control.Concurrent
> 
> 
> midiOutTime  :: String  -- ^ client name
>     -> Time
>     -> IO ThreadId
> midiOutTime name t = do
>   t0 <- time
>   let n = fromIntegral . floor $ t0 / t
>   forkIO $ (`catch` \e -> putStrLn $ "midi_exception: " ++ show e)  $ do
>     withDefault Block $ \h -> do
>     setName (h :: Sound.ALSA.Sequencer.T OutputMode) $ name ++ " 
> time_out"
>     c <- getId h
>     withSimple h "ctrl_in" (caps [capRead, capSubsRead]) 
> typeMidiGeneric $ \p ->
>     let loop n = do
>     sleepThreadUntil $ n * t
>     void $ outputDirect h $ forConnection 
> (toSubscribers (Sound.ALSA.Sequencer.Address.Cons c p))
> $  QueueEv QueueClock Sound.ALSA.Sequencer.Queue.direct
>     loop $ n + 1
>     in loop 1
> 
> main = do
>   midiOutTime "timeout" $ 0.125/6
>   getLine
-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/37rzIJHSGeocyr5n7PvG88

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] ANN: vivid 0.2: SC in Haskell

2016-03-22 Thread Henning Thielemann

On Mon, 21 Mar 2016, Evan Laforge wrote:

> I've long been a bit interested in supercollider, but never really
> even heard any music done with it, or sequencers that can drive it,
> and thus I haven't been too clear on its capabilities beyond "here's a
> tutorial on how to make a Shepard tone" kind of stuff.

I programmed music with SuperCollider via Haskore years ago:
https://www.youtube.com/watch?v=d2JvOwS26Zg

However, I moved to synthesizer-llvm later.

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/Mrd5wqWO2KBjBlKiwj22A

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] [sc-users] Re: ANN: Vivid: SuperCollider + Haskell

2016-03-22 Thread Henning Thielemann

On Mon, 21 Mar 2016, amin...@gmail.com wrote:

> Resurrecting a pretty old thread here, but I think I've found a nice way 
> to crack this problem, which I use in Vivid 0.2 -- thought I'd give a 
> run-down:
>
> If you'll recall, when we last saw our heros they were struggling with 
> the inability to have 3 things in our UGens simultaneously:
>
>  - Default argument values: if we don't use records we need to require all 
> arguments, and so we'd need to e.g. provide a "phase" to every SinOsc
>  - Type-checked arguments: if we use records to represent our values, we 
> can't use "freq" only on the ugens it makes sense on: someone could 
> accidentally give WhiteNoise a freq. We could make them unambiguous, but we 
> also want...
>  - Short argument names: nobody wants to write "sinOscFreq" - they want to 
> write "freq"!

I just watched the interface of vivid and wondered about the scary types. 
I think it would be possible even in Haskell 98 to have something like 
this:

sinOsc :: UGen SinOsc

freq :: (Freq typ) => Float -> UGen typ -> UGen typ
phase :: (Phase typ) => Float -> UGen typ -> UGen typ

class Freq typ where setFreq :: typ -> typ
instance Freq SinOsc where setFreq f args = args {sinOscFreq = f}
instance Phase SinOsc where ...

SinOsc is the record holding the arguments for a sine oscillator.


Then you could write:
phase (pi/2) $ freq 800 sinOsc

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/I5rZKvj6KuAhGvpTSWQV7

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] [sc-users] Re: ANN: Vivid: SuperCollider + Haskell

2016-03-28 Thread Henning Thielemann

On Tue, 22 Mar 2016, amin...@gmail.com wrote:

>   - No required arguments: some UGens don't/can't have a "default" 
> value, but there's nothing preventing the user from calling it without 
> modifying any args

Then you can fall back to regular Haskell function arguments.


>   - It's more work to create a new UGen: you need to create the type of 
> the record with "foo" prefixes on its args, then an instance of that 
> record, and also the Freq, etc instances for each arg. You'll also need 
> a function to convert that particular ugen to something SC understands. 
> My hope is that users can make UGens themselves fairly quickly. Most 
> ugens in vivid are defined in a couple of lines, with a standard 
> "makeUGen" function.

If there is a uniform internal data structure like Binary or String, you 
do not even need a new record type per UGen. If a record is the right 
internal structure you might compose records on the fly from bricks like 
this:
data Freq  more = Freq Double more
data Phase more = Phase Double more
data Empty  = Empty

type Osc = Freq (Phase Empty)

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/2z2Uok4ny6ANjzaUnIywd9

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


Re: [haskell art] SCHelp parser?

2016-04-04 Thread Henning Thielemann

On Mon, 4 Apr 2016, Stephen Tetley wrote:

> If no-one has one already I'd be up for writing one. The new
> developments with Haskell and SuperCollider (your system and Super
> Dirt) are pretty exciting and I've been thinking I ought to get
> involved.

How has Rohan developed his hsc3 help files? Aren't there some scripts 
involved?

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/1nVLDXrCQ7CoO91zkMVf0d

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


  1   2   >