Jump to content

Looking for teacher / coach in Lisp Programming with Opusmodus


Recommended Posts

Hi all,

 

I've had some excellent classes with Stephane related to Parametric Composition using Opusmodus. I had hoped that with my professional background as a programmer I would be able to get up-and-running quickly but I find myself struggling too much. Not so much with the Common Lisp language itself (have found some books that really help me a lot) but more with the workflow and Common Lisp technical issues that prevent me from using the main part of my time studying Lisp.

 

Those issues are:

 

- TDD (Test Driven Development). I'm used to do TDD and continuous testing on the .NET platform using NCrunch. I'm also used to do testing on unit, integration and functional level. Would like to get some help choosing the right Common Lisp testing framework as well as on setting it up.

- Package Management: I'm used to Nuget based package management (.NET platform). Need help to have a good understanding of Quicklisp/ASDF as well as how to integrate libraries that are not available through package managers.

- Guidance in creating own functions. Good understanding of Opusmodus specific types and wether to use them or to avoid them. What I mean is related to the basic fundamental question: is it wise to "lock in" to the Opusmodus product when writing my own functions and using the Opusmodus function library. Or should I consider Opusmodus more like a rich Common Lisp IDE (MIDI playback and music score integration) but base my own function as much as possible on standard Common Lisp functions.

- Good understanding of OMN "under the hood". What is it exactly that I'm using when I write OMN pitches, velocities etc.

- When to use a functional approach and when to use an object oriented approach

- How to structure your project

 

I would also like to find someone to do some periodic reviewing and refactoring of my own code in order to learn to write good Common Lisp code.

 

Please let me know who is able to help me on this wonderful journey!

 

Big hug,

 

Wim Dijkgraaf

 

p.s. the books I'm using right now are:

- Practical Common Lisp (Peter Seibel)

- Let over Lambda (Doug Hoyte)

- On Lisp (Paul Graham)

Link to comment
Share on other sites

> Package Management

 

Simple answer: use a separate package for a larger code project, and use ASDF, http://www.cliki.net/asdf

There are online tutorials available, and for your kind of projects so far you do not need much.

 

> TDD (Test Driven Development)

 

With a REPL-based development this is less of an issue, as you may have noticed already.  If you really want to, there are various unit test etc. environments available for Common Lisp. I never consistently used any.

http://www.cliki.net/test framework

http://www.mozartreina.com/unit-tests-lisp.html

 

> is it wise to "lock in" to the Opusmodus product when writing my own functions

 

Good question. I would tend not to. Just ported a little library to Opusmodus that I once created for a plain Common Lisp project, and later used with PWGL. All I had to do was getting rid of some recent PWGL-specific extensions in the ASDF file...

 

On the other hand, if some system drastically would simplify your work and thus save you development time, then that would be different. I would be pragmatic.

 

> When to use a functional approach and when to use an object oriented approach

 

This is not an either-or decision. With a multi-paradigm language, including Lisp, you can combine such paradigms. For example, you can have higher-order functions processing objects.

 

Anyway, I avoid state-based programming and side effects when possible, and if state is necessary then I try to encapsulate it locally so that towards the outside the program still appears stateless. In such a context, objects are then just some convenient data abstraction with method dispatch and a potentially hierarchic data "type" tree.

 

Nevertheless, do not underestimate the convenience of simple data types like nested lists. With these you can directly see the results of your computations, while with objects you usually need some form of accessor to see certain detail.

 

> p.s. the books I'm using right now are:

 

Here is another recommendation showing more advanced Common Lisp programming in action

- Norvig, P. (1992) Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp. Morgen Kaufmann Publishers.
 
This book uses Scheme instead of Common Lisp, but helps to learn fundamental concepts how to organise code.
- Abelson, H. et al. (1985) Structure and Interpretation of Computer Programs. Cambridge, MA: MIT Press.
 
For a more advanced understanding of CLOS
User-level:
- Keene, S. E. (1989) Object-Oriented Programming in Common Lisp: A Programmer’s Guide to CLOS. Addison-Wesley.
Looking under the hood:
- Kiczales, G. et al. (1991) The Art of the Metaobject Protocol. MIT Press.
 
 
> How to structure your project
 
There are no hard rule on this, but perhaps a few rules of thumb, like you try to avoid repetitions in code by abstractions, or that you may try to simplify your programs by extending your programming language. The above books make help.  
 
Best,
Torsten
Link to comment
Share on other sites

Thanks Torsten for this helpful and thorough reply.

 

Concerning testing, I took the most practical approach and started using the macros from the Practical Common Lisp book (Peter Seibel); a testing framework based on 4 macros. For now that does the job.

 

The "lock in" is still at the back of my mind. My personal opinion is that Opusmodus should focus on delivering a perfect IDE for composers. OMN and the Opusmodus IDE should be helpful to be more productive, have excellent score facilities, do fantastic MIDI playback, have an outstanding Live Coding environment etc. but the main musical functions should be available in a Common Lisp open source project, to my personal opinion. This way, the compositions we create will always "work" independent of the composition environment and the community around the musical functions we use would be even larger and potentially even more interesting. But that's another discussion ... 

 

Thanks for the additional book list too. Will be an interesting journey :-)

 

Big hug, Wim Dijkgraaf

 

 

 

Link to comment
Share on other sites

Finally it is the question whether you want to generate music with the help of blackboxes/tools (whether open source or OM)... or you want to think, to reflect and to program your own ideas, and not to take what tools can easily generate (in this case you are not/less "independent"). with LISP (coding almost everything for myself) and OM for MIDI and SCORE it works for me... i think it's not a question of open source or not...

Link to comment
Share on other sites

Hi AM, 

 

Yes, I can see that the clear division of OM as ICE (Integrated Composition Environment) and for MIDI playback and SCORE reading/layout/printing but keeping the rest of the functions as independent as possible could be a nice approach for users who know to do Lisp programming (like you and hopefully me too in short term, and many more on this forum).

 

The Opusmodus function library is a fantastic resource too, but if such a library would be available in the public domain / open source I would prefer to use that instead of a product specific library. Not a big deal though ... just some thoughts while I'm learning a new way to compose.

 

Big hug

 

 

Link to comment
Share on other sites

Finally it is the question whether you want to generate music with the help of blackboxes/tools (whether open source or OM)... or you want to think, to reflect and to program your own ideas, and not to take what tools can easily generate (in this case you are not/less "independent").

 

Actually, I don't see this necessarily as an either-or. As someone who spend many years developing a composition system from scratch on my own I would say that -- if your main goal is actually composing and not developing -- then you should welcome the tools that are useful for your purposes, and not necessarily trying to stay "pure". For own functions I would try to avoid any dependency on software not freely available, but not for a composition project.

 

Best,

Torsten

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy