Jump to content

Recommended Posts

OM got into this state where ^-cmd-1 doesn't result in any sound or any score appearing. Maybe I don't understand how this is supposed to be used but I'm unable to play or view any score including those in the "stages" examples.

Oh I just had to restart it. I noticed also that the Listener prompt disappeared. Maybe that has something to do with it.

 

Link to post
Share on other sites
11 hours ago, opmo said:

'Last Score' means last compiled score or snippet.

 

I suggest you take a lesson or two with Stephane to speedup the learning curve.

Can he explain how to use Emacs with OM? What I'm wondering about is how to run a file in Emacs so it becomes the last score. In OM, it's easy to evaluate or execute the current file, but there doesn't seem to be an equivalent command in Emacs.

Link to post
Share on other sites
15 hours ago, AM said:

have a look here...?

 

 

 

I understand this in general, or I should say I'm moving through the stages and comprehending them as I go (up to stage 9) but the issue was that OM got into a bad state somehow and stopped working. Or more specifically "audition and notation" stopped working. Also the listener wasn't showing any commands. I just had to restart it.

Link to post
Share on other sites

Hi Stephane,

Thanks for your help so far. It's great to hear you are using Emacs. I used it for 25 years before switching to Visual Studio Code so I'd like to dust off some of those skills. I even wrote Emacs Lisp, a good preparation I think for learning Common Lisp.

 

But what I'm trying to figure out right now is how to run or execute an Emacs buffer so that it becomes the last score. In OM if you just select Audition and Notation it will evaluate/compile/run the current file, but I can't find the equivalent in Emacs slime.

Mike

Link to post
Share on other sites

Stephane, I read all that and have the REPL running in Emacs, I just can't find any documentation on what command to give the REPL to load/compile/run a file. I even used Emacs completion to test every command I could think of that started "audition", "opusmodus" etc. with no clear answers. When I use C-c o l, it auditions and notates the last score run inside OM, but I want it to do that with files in Emacs

 

 

Link to post
Share on other sites

Okay, I'll give up using Emacs for now. A related question is, is there documentation on what can be done with the Listener window? Is that just for echoing the results of commands run from the menu or are there additional commands that can be run in the Listener? I tried typing the same commands in the Listener that I see echoed there and nothing happened.

 

Thanks,

Mike

 

Link to post
Share on other sites

Okay, I figured out that the Listener window is a LISP REPL and I've gotten it working with some CL stuff from a tutorial. I think that when it wasn't working before was when I was inside a stack trace or hadn't completed typing a command or something like that.

 

EDIT: and I just figured that using (load-file "filename") in the REPL makes it into the current score for C-c o l to work on it.

 

EDIT 2: working with a Common Lisp tutorial is helping me to understand fundamentals. I think it's good to do alongside the OM tutorials.

Link to post
Share on other sites
  • opmo changed the title to Score audition and notation

> running in Emacs, I just can't find any documentation on what command to give the REPL to load/compile/run a file

Are you using Slime? If you just open a Lisp file in Emacs without having a connection to a Lisp compiler, then Emacs acts as a mere text editor. In order to turn it into an IDE that is connected to a compiler and REPL etc., you need to use some interface for a Lisp compiler. For Common Lisp, Slime is recommended for that. 

 

Attached is some code that defines how to let Emacs Slime and CCL of Opusmodus talk to each other. Of course, it requires you to install Slime first (which you can do via the Emacs packages system, as far as I remember, if it is not already part of your Emacs installation, as it is, e.g., for Aquamacs). The most important part here AFAIK is to start swank, which is the Common Lisp side of the Emacs Slime interface. I have this file put into my Extensions folder, to have this connection set up when I start Opusmodus. 

 

Then, start Opusmodus and start Emacs. After that, you have to start Slime in Emacs and tell it to which Common Lisp compiler to connect (it works with many Lisp implementations). I do that via the following. I guess you know what M-x stands for. 😅

 

M-x slime-connect
;; You will be asked for a host (Slime can use a networked computer)
host: 127.0.0.1
;; You will be asked for a port. 
Port: 4005

 

After that, you will be greeted by a REPL, and some friendly message in the mini buffer, like "Connected. Are we consing yet?" (some Lisp hacker humour, https://stackoverflow.com/questions/2256261/why-is-consing-in-lisp-slow ). You can type Lisp expressions directly in the REPL, but you usually want to execute individual code blocks or whole files from a source buffer. After you did the above, Emacs should show a Slime menu, where you can check the standard shortcuts for how to evaluate code etc.

 

Have fun. 🙂

 

Torsten

The mentioned attachment... 

opusmodus-setup.lisp

Link to post
Share on other sites

Hi Torsten,

I got a lot of this working. My issue at the time I wrote that was that I wanted to know how to load, compile, or execute a lisp file. I could see that the OM menu allows me to audition/notate the "last score" but since I didn't know how to load/compile/execute a Lisp file I didn't know how to make a specific file into the last score.

 

I since discovered the C-c C-l shortcut which loads a lisp file and make its variables available in the REPL. After C-c C-l on a file it appears to become the last score, so C-c o l works on it.

 

I realized that I just need to work through some Emacs/Slime/Common Lisp tutorials - I mean general Lisp tutorials, not OM-specific stuff. Which is going to be helpful for learning OM anyway, especially if I want to do anything beyond the provided OM functions.

 

Mike

 

Link to post
Share on other sites

C-c C-l shortcut which loads a lisp file and make its variables available in the REPL

Beyond that, you can also (re)-evaluate at any time just individual expressions or definitions (not necessarily a whole file or even a whole program) and that way make your whole development process rather interactive. I use the shortcut for evaluating the last expression (before the point/cursor), C-x C-e, much more often than the one for loading a file. 

 

> general Lisp tutorials

As a Python developer, this might be helpful for you, even though it is written originally for the opposite "direction" of learning. 

https://norvig.com/python-lisp.html 

 

Best,

Torsten

 

Link to post
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