Re: [haskell art] Any FP ideas for Tidal?
Hey Hans, On 19 October 2014 23:49, Hans Höglund wrote: > Sorry for a very late reply. I second most of what has already been written > and also strongly recommend you to go back and read the pioneering work of > Paul Hudak (already mentioned by himself) and Conal Elliott (esp. the > Reactive package) which was extremely influential for me in terms of thinking > about musical time. . Yes I have cited both fine scholars during the development of tidal and will continue drawing from these. There is something to be said for thinking outside the standard midi/piano model though, at least with the kind of music I like to make. > I can't help but notice there is quite a bit of overlapping between the > recent "score" libraries (including tidal, music-score, and active). For > example, we all define a type representing a time span but all give it > different names (Arc, Span and Era respectively). Maybe in time we will move > on to some more standardized vocabulary. Yes 'span' is perhaps the most immediately understandable word. I used 'arc' due to Tidal's focus on cyclic time. > I noticed the event list Tidal generates for each cycle is isomorphic to my > score representation – so a Tidal patterns is a score in the reader monad > (function of the "current" span). This suggest that one could device a more > elaborate pattern language – perhaps using GADTs as suggested above, and then > compile this into (Span -> [Event a]), i.e. your current model. That would > give you the same power, but more possibilities of deconstructing or > reasoning about the patterns before rendering into functions. Not that there > is anything wrong with functions – they are just not decomposable. I don't think I've felt the need to decompose a Tidal pattern, although I don't doubt there are useful applications for doing so.. > Again, I don't think the relationship between between our score-based > languages and classical FRP (events and behaviors) has been fully examined. > This is in part what I hope to continue doing in music-score. I'd be very interested in such an analysis. I'm not even sure whether to claim anything about the novelty of Tidal's representation. Someone once suggested it was.. cheers alex -- http://yaxu.org/ -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/3PKJ0J1337mP2lVYzks24M To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Hi Alex, Sorry for a very late reply. I second most of what has already been written and also strongly recommend you to go back and read the pioneering work of Paul Hudak (already mentioned by himself) and Conal Elliott (esp. the Reactive package) which was extremely influential for me in terms of thinking about musical time. I can't help but notice there is quite a bit of overlapping between the recent "score" libraries (including tidal, music-score, and active). For example, we all define a type representing a time span but all give it different names (Arc, Span and Era respectively). Maybe in time we will move on to some more standardized vocabulary. I noticed the event list Tidal generates for each cycle is isomorphic to my score representation – so a Tidal patterns is a score in the reader monad (function of the "current" span). This suggest that one could device a more elaborate pattern language – perhaps using GADTs as suggested above, and then compile this into (Span -> [Event a]), i.e. your current model. That would give you the same power, but more possibilities of deconstructing or reasoning about the patterns before rendering into functions. Not that there is anything wrong with functions – they are just not decomposable. Again, I don't think the relationship between between our score-based languages and classical FRP (events and behaviors) has been fully examined. This is in part what I hope to continue doing in music-score. Cheers, Hans -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/30FgGONkRMUFmAxyOnSybB To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Thanks Balazs, was good to meet you too! I've got some kind of feel for lenses from this video, thanks. SPJ is a master at teaching, a bit frustrating not to be able to see his laser pointer but hey :) On the whole, Tidal is not big on data structures, as patterns are all about composed functions. However I do represent patterns of synth messages as patterns of hashes, and then have a set of functions for updating each element in the hash. In retrospect I think I ended up doing it this way due to frustrations with field accessors, and think lenses could really help with this.. Apart from having tidier innards I think the advantage would be being able to easily manipulate patterns of synth parameters within existing patterns of synth messages (the latter just being a collection of the former). This could be a big win, looking forward to experimenting when I have some time! Cheers alex On 12 September 2014 16:33, Balazs Komuves wrote: > Hi Alex, > > Lenses on the first sight allow one to reach deep inside some data > structure. The simplest use case of it is to manipulate individual fields > of a record. If the type of a field is another record, or maybe even more > layers, this quickly becomes very messy with the "traditional" approach; on > the other hand lenses composes nicely. However, this is just scratching the > surface! > > For example you can also have different views of the same thing. A standard > example when you have a Celsius lens and a Fahrenheit lens into something > which is a temperature. You can now both read and write or apply functions > either in Celsius or Fahrenheit, and it will always be consistent! I > imagine this feature could be useful in Tidal, if you somehow have > different views of the same pattern or something like that (I'm not > familiar with Tidal, so just guessing here). Or if a part of a pattern is > another smaller pattern, you can "reach in'. > > Unfortunately, the modern formulation of lenses is rather heavy on the math > side (this is the cost of the elegance and some of the power behind it), so > it can be hard especially at first. I would recommend Simon Peyton-Jones' > lecture on it, he is very good explaining it! The video used to be freely > available, but now it seems you have to register or something, > unfortunately... Anyway, here is the link: > https://skillsmatter.com/skillscasts/4251-lenses-compositional-data-access-and-manipulation#video > > Arrows are used a lot for reactive programming and sound, but I think they > may be less useful for Tidal, probably. In essence, they can be used to > describe abstract circuits (rather similar to electric circuits). > > Balazs > > ps. It was very nice to meet you at the livecoding evening after FARM! > > > > On Fri, Sep 12, 2014 at 11:32 AM, alex wrote: > >> Hi all, >> >> I had a great time at FARM last week, but felt like I missed an >> opportunity to ask a question at the end of my talk (paper available >> here: http://dl.acm.org/citation.cfm?id=2633647).. >> >> Haskell has been a really great host language for Tidal >> (http://yaxu.org/tidal). I've found Haskell's Applicative type and its >> syntax extremely useful, and ghc's string overloading hack helps with >> tersity.. As I'm entirely self-taught as far as Haskell and FP is >> concerned, I'm wondering if there's something I'm missing.. For >> example I read about arrows and lenses but don't have any grasp of >> what they are. Any advice for area of Haskell I could look into? I >> just have a feeling that there could be something lurking, just out of >> reach.. >> >> cheers >> >> alex >> >> -- >> >> Read the whole topic here: Haskell Art: >> http://lurk.org/r/topic/3GANxU3pGq3XWV861sQBYk >> >> To leave Haskell Art, email haskell-...@group.lurk.org with the following >> email subject: unsubscribe >> > > -- > > Read the whole topic here: Haskell Art: > http://lurk.org/r/topic/3tJg3LMdW7Ptr3e2LG3yoM > > To leave Haskell Art, email haskell-...@group.lurk.org with the following > email subject: unsubscribe -- http://yaxu.org/ -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/LESzpO0c9hIhS0AGnH9Dq To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
hello alex, no suggestions for tidal, which seems to be going along just fine! but perhaps worth noting briefly that the "Generalised algebraic datatype" work is very nice. as it says on the packet, you can write a 'typed' "sub-language" almost for free. which in one case did save a lot of confusion here. i think i'm mentioning this because it was something i'd thought was "too hard" and with the appropriate "language extension" it's not. so in case you've ever wondered the same... best, rohan -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/267tXENkXBGrXhAbIL0NSQ To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Hi Alex, Lenses on the first sight allow one to reach deep inside some data structure. The simplest use case of it is to manipulate individual fields of a record. If the type of a field is another record, or maybe even more layers, this quickly becomes very messy with the "traditional" approach; on the other hand lenses composes nicely. However, this is just scratching the surface! For example you can also have different views of the same thing. A standard example when you have a Celsius lens and a Fahrenheit lens into something which is a temperature. You can now both read and write or apply functions either in Celsius or Fahrenheit, and it will always be consistent! I imagine this feature could be useful in Tidal, if you somehow have different views of the same pattern or something like that (I'm not familiar with Tidal, so just guessing here). Or if a part of a pattern is another smaller pattern, you can "reach in'. Unfortunately, the modern formulation of lenses is rather heavy on the math side (this is the cost of the elegance and some of the power behind it), so it can be hard especially at first. I would recommend Simon Peyton-Jones' lecture on it, he is very good explaining it! The video used to be freely available, but now it seems you have to register or something, unfortunately... Anyway, here is the link: https://skillsmatter.com/skillscasts/4251-lenses-compositional-data-access-and-manipulation#video Arrows are used a lot for reactive programming and sound, but I think they may be less useful for Tidal, probably. In essence, they can be used to describe abstract circuits (rather similar to electric circuits). Balazs ps. It was very nice to meet you at the livecoding evening after FARM! On Fri, Sep 12, 2014 at 11:32 AM, alex wrote: > Hi all, > > I had a great time at FARM last week, but felt like I missed an > opportunity to ask a question at the end of my talk (paper available > here: http://dl.acm.org/citation.cfm?id=2633647).. > > Haskell has been a really great host language for Tidal > (http://yaxu.org/tidal). I've found Haskell's Applicative type and its > syntax extremely useful, and ghc's string overloading hack helps with > tersity.. As I'm entirely self-taught as far as Haskell and FP is > concerned, I'm wondering if there's something I'm missing.. For > example I read about arrows and lenses but don't have any grasp of > what they are. Any advice for area of Haskell I could look into? I > just have a feeling that there could be something lurking, just out of > reach.. > > cheers > > alex > > -- > > Read the whole topic here: Haskell Art: > http://lurk.org/r/topic/3GANxU3pGq3XWV861sQBYk > > To leave Haskell Art, email haskell-...@group.lurk.org with the following > email subject: unsubscribe > -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/3tJg3LMdW7Ptr3e2LG3yoM To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Thanks Alois and Henning, Maybe there could be some nicer ways of representing and manipulating the different parameters of synth messages in here.. cheers alex On 12 September 2014 13:38, Henning Thielemann wrote: > 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 -- http://yaxu.org/ -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/67LD64tWLX4nWFpfy43r7s To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Hi Paul, On 12 September 2014 15:44, Hudak, Paul wrote: > Hi Alex. You might want to look at Euterpea (as described in my book, The > Haskell School of Music, or HSoM), which uses arrows both: > > · as a foundation for our GUI (which we call MUI – Musical User > Interface), including reactive behaviors (like MIDI), and > · as the basis for sound synthesis and audio processing. Thanks, I'll take a look! > But I also wonder if you could benefit from reading about more standard uses > of Haskell, such as maps and folds and higher-order functions and lazy > evaluation and infinite data structures and type classes and so on. I have made good use of all of these in Tidal (although have largely eschewed lazy lists), although always happy to learn how it could be improved. alex -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/7ctyKmVbMuoqUyRZwojgh2 To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Hi Alex. You might want to look at Euterpea (as described in my book, The Haskell School of Music, or HSoM), which uses arrows both: · as a foundation for our GUI (which we call MUI – Musical User Interface), including reactive behaviors (like MIDI), and · as the basis for sound synthesis and audio processing. But I also wonder if you could benefit from reading about more standard uses of Haskell, such as maps and folds and higher-order functions and lazy evaluation and infinite data structures and type classes and so on. Such programming techniques are also described in HSoM in the context of music, which I presume is your main interest. You can find more here: http://haskell.cs.yale.edu/?post_type=publication&p=112 Best, -Paul -Original Message- From: haskell-...@group.lurk.org [mailto:haskell-...@group.lurk.org] On Behalf Of alex Sent: Friday, September 12, 2014 5:32 AM To: haskell-...@group.lurk.org Subject: [haskell art] Any FP ideas for Tidal? Hi all, I had a great time at FARM last week, but felt like I missed an opportunity to ask a question at the end of my talk (paper available here: http://dl.acm.org/citation.cfm?id=2633647).. Haskell has been a really great host language for Tidal (http://yaxu.org/tidal). I've found Haskell's Applicative type and its syntax extremely useful, and ghc's string overloading hack helps with tersity.. As I'm entirely self-taught as far as Haskell and FP is concerned, I'm wondering if there's something I'm missing.. For example I read about arrows and lenses but don't have any grasp of what they are. Any advice for area of Haskell I could look into? I just have a feeling that there could be something lurking, just out of reach.. cheers alex -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/3GANxU3pGq3XWV861sQBYk To leave Haskell Art, email haskell-...@group.lurk.org<mailto:haskell-...@group.lurk.org> with the following email subject: unsubscribe -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/1uZIi0lmYF73Y7EEbXeWTx To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
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 FP ideas for Tidal?
As we are on lenses-like stuff. I was trying to get my head around the profunctor model that Edward Kmett is getting into, I found that link which helped me: http://r6research.livejournal.com/27476.html In case you still wondering in which context it's useful, in addition to Henning explaination you might appreciate that SO question: http://stackoverflow.com/questions/10788261/what-are-lenses-used-useful-for Might be helpful for you as well Alex Cheers On 12 September 2014 11:55, Henning Thielemann < schlepp...@henning-thielemann.de> wrote: > Am 12.09.2014 um 11:32 schrieb alex: > > > Haskell has been a really great host language for Tidal > > (http://yaxu.org/tidal). I've found Haskell's Applicative type and its > > syntax extremely useful, and ghc's string overloading hack helps with > > tersity.. As I'm entirely self-taught as far as Haskell and FP is > > concerned, I'm wondering if there's something I'm missing.. For > > example I read about arrows and lenses but don't have any grasp of > > what they are. > > I can't say much about the competitors lenses and fclabels, but > data-accessor provides a type (Accessor a b), which gives you read and > write(!) access to record fields. In contrast to that, you can use the > plain record field name only for read access. Like you can combine two > field names to nested records e.g. (fieldA . fieldB), you can combine > accessors. > > And guess, Accessor is an instance of Category (but not of Arrow, > because 'arr' is missing). > > The package also gives a short introduction: > http://hackage.haskell.org/package/data-accessor > > > -- > > Read the whole topic here: Haskell Art: > http://lurk.org/r/topic/5IFUibhl6PIamJVliGXelg > > To leave Haskell Art, email haskell-...@group.lurk.org with the following > email subject: unsubscribe > -- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/3eVLDmLCobKmEmhsbrKs8l To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
Am 12.09.2014 um 11:32 schrieb alex: > Haskell has been a really great host language for Tidal > (http://yaxu.org/tidal). I've found Haskell's Applicative type and its > syntax extremely useful, and ghc's string overloading hack helps with > tersity.. As I'm entirely self-taught as far as Haskell and FP is > concerned, I'm wondering if there's something I'm missing.. For > example I read about arrows and lenses but don't have any grasp of > what they are. I can't say much about the competitors lenses and fclabels, but data-accessor provides a type (Accessor a b), which gives you read and write(!) access to record fields. In contrast to that, you can use the plain record field name only for read access. Like you can combine two field names to nested records e.g. (fieldA . fieldB), you can combine accessors. And guess, Accessor is an instance of Category (but not of Arrow, because 'arr' is missing). The package also gives a short introduction: http://hackage.haskell.org/package/data-accessor -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/5IFUibhl6PIamJVliGXelg To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
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 was trying to help by pointing a simple thing I understood while playing with Arrow. Thanks for the links. On 12 September 2014 11:41, Henning Thielemann < schlepp...@henning-thielemann.de> wrote: > 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=publication&p=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 > -- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/37ImgsRl7XCstOrhIVrVO9 To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
Re: [haskell art] Any FP ideas for Tidal?
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=publication&p=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?
Hi alex, 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. Hope that help! Cheers Alois http://hackage.haskell.org/package/base-4.7.0.0/docs/Control-Arrow.html On 12 September 2014 10:32, alex wrote: > Hi all, > > I had a great time at FARM last week, but felt like I missed an > opportunity to ask a question at the end of my talk (paper available > here: http://dl.acm.org/citation.cfm?id=2633647).. > > Haskell has been a really great host language for Tidal > (http://yaxu.org/tidal). I've found Haskell's Applicative type and its > syntax extremely useful, and ghc's string overloading hack helps with > tersity.. As I'm entirely self-taught as far as Haskell and FP is > concerned, I'm wondering if there's something I'm missing.. For > example I read about arrows and lenses but don't have any grasp of > what they are. Any advice for area of Haskell I could look into? I > just have a feeling that there could be something lurking, just out of > reach.. > > cheers > > alex > > -- > > Read the whole topic here: Haskell Art: > http://lurk.org/r/topic/3GANxU3pGq3XWV861sQBYk > > To leave Haskell Art, email haskell-...@group.lurk.org with the following > email subject: unsubscribe > -- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/1tuIqrOrnZNGlcWc4iQaok To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe
[haskell art] Any FP ideas for Tidal?
Hi all, I had a great time at FARM last week, but felt like I missed an opportunity to ask a question at the end of my talk (paper available here: http://dl.acm.org/citation.cfm?id=2633647).. Haskell has been a really great host language for Tidal (http://yaxu.org/tidal). I've found Haskell's Applicative type and its syntax extremely useful, and ghc's string overloading hack helps with tersity.. As I'm entirely self-taught as far as Haskell and FP is concerned, I'm wondering if there's something I'm missing.. For example I read about arrows and lenses but don't have any grasp of what they are. Any advice for area of Haskell I could look into? I just have a feeling that there could be something lurking, just out of reach.. cheers alex -- Read the whole topic here: Haskell Art: http://lurk.org/r/topic/3GANxU3pGq3XWV861sQBYk To leave Haskell Art, email haskell-...@group.lurk.org with the following email subject: unsubscribe