Tuesday, May 26, 2020

Common Lisp Music

I'm starting to compose music again. Here is my debut single if you like classical music:

https://sweetjehosavan.bandzoogle.com/

And I started thinking about CLM, Common Lisp Music, for sound synthesis. Right now I'm using Tandy BASIC for sound synthesis just to help me transcribe what I create with the guitar into sheet music, but maybe CLM is the way to go for future projects. Especially for when my ancient Tandy Model 102 portable computer finally kicks the bucket and does not work anymore. 

Thursday, August 15, 2019

Common Lisp Machine Learning - CLML

I'm back at it again, trying to remember which machines I was able to successfully able to compile the CLML code available at https://github.com/mmaul/clml.git

So far the only node I have been able to compile the code has been at https://tilde.team/~jovan/. So I guess if I want to learn more about CLML this is the machine to do it on.

I also got it to compile on tilde.town. So two nodes to help me learn how to use this software, and the blog space to document it as well! 

Tuesday, September 26, 2017

Latest

The last thing I did Lisp related this month was update Quicklisp on my copy of Armed Bear Common Lisp. Right now I'm using Perl 6 as a calculator. It's hard to come up with a reason to do something in Lisp for me right now. 

Monday, March 21, 2016

Setting up Armed Bear Common Lisp on Windows 10 64-bit

Well it's been a long time since I've done any real playing around with Common Lisp, even though it constantly keeps popping up in my mind. I want to use it, but I just keep getting distracted by all of the other programming languages that are out there.

But last week I spent some time getting more familiar with Armed Bear Common Lisp (ABCL), which I'm happy to find out is still an active project. So I downloaded the latest version from here: https://common-lisp.net/project/armedbear/

I decompressed the file in my DropBox account, so that all my computers can shared the same ABCL setup goodness, and save me a lot of work. I quickly got Quicklisp installed as well from here: https://www.quicklisp.org/beta/ and proceeded to learn how ABCL can call your own hand made Java classes. Then I tried to load some quicklisp packages like Hunchentoot and GSLL, which require foreign objects written in C. A lot of work was needed to get CFFI installed with ABCL. I had to install Maven and get ABCL to find Maven correctly in order for quicklisp to install it correctly.

Oh and I also got the latest Emacs and Slime to work with ABCL using Quicklisp. That was a piece of cake compared to learning how to glue objects coded in various languages together using ABCL. In this blog post I plan to document everything I have accomplished so far with ABCL.


Tuesday, July 21, 2015

Check out Notebook Stories for a chance to win Monologue Notebooks!

Tuesday, July 7, 2015

What happened to clisp?

It seems that the clisp project needs some help. The last update I've seen on their website was in 2010, and when I installed the latest version of LispCabinet at work today I tried to install hunchentoot and parenscript through quicklisp and clisp failed to build it. It's too bad because there are a few book that use clisp for their examples, plus I like how small the package is and how easy it is for me to use it as a command shell in windows.

Thursday, May 7, 2015

Lisp Dreams

I keep dreaming about writing a lisp application which would be the ultimate programming language translator. I try to image the amount of work such a huge undertaking would involve. Tonight I'm going to be learning about the Marpa parser, and I'm really curious to ask if such a parser could be used to finally translate Perl into C or machine code effectively. The use of Lisp has still been very rare in any of the work I do. There was a time when I had so many projects that I wanted to write in lisp, but so far I have been distracted by lower hanging fruit.

A language translator written in lisp would be a handy tool to attack this programming language tower of Babel we have created for ourselves. There must be a smarter way to write language translators. Maybe with neural networks? Would the code examples found on rosettacode.org be good enough to train a neural network to translate programming languages automatically? What about forming a consistent language and library specification format, so that a machine could figure out how to translate any program to another based on it's expanded database of translations?


Wednesday, August 6, 2014

ISO Lisp conversion to Common Lisp

I don't know if anyone has already done this, but I wonder if it is possible to create a library for ISO Lisp so that I can write Common Lisp code.

Tuesday, May 20, 2014

Need to do more lisp stuff.

I haven't done anything with lisp for a long long time now. I keep reading about it, for example working out the examples from "Land of Lisp" and "Realm of Racket", but I haven't done anything of my own for work or fun for a while now. Everything at work has been LabView and Perl and Excel Visual Basic macros. Everything for school has been Java, C, and Matlab. Everything at home has been Perl lately.

Friday, January 4, 2013

Baby steps into making an AIML parser in NewLisp

I have not written in this blog for two years, but that doesn't mean I have not been playing with Lisp every so often. I started working on an AIML parser using the NewLisp language some time ago. Maybe I can make some real progress on it if I start writing about it. The scripts currently just read files and has a routine that helps me generate new AIML categories.

The ALICE brain that I am making can so far generate AIML files by making the user ask what it is learning fro the "PATTERN" tag and what it's response should be for the "THAT" tag. User response is timed, so that in application the time it takes for me to answer certain questions will be more realistic. I am also playing with the idea of a topic context, to aid the AI in making associations between topics in it's database.

Links to the code are provided.

alice.lsp BRAIN.lsp PARSER.lsp DB.lsp

Saturday, February 19, 2011

My first use of lisp on the job.

So my first opportunity to use lisp at work was while designing an electrical contractor plate for a large Gen-II display circuit. The boss told me not to spend too much time on it, since the circuit design would change before we really need to use the plate for electrical tests. So, instead of drawing the location of every contact pad, pin header location, and cutout for the arrays, I decided to write a script to quickly and accurately draw the hardware. The drafting tool I am using is, of course, AutoCAD 2011. I could have used their visual basic add-on to write the script, but going through their visual lisp tutorial was quick enough for me to finish the job in a day. So here is my first little contribution to the lisp world:



;; Current design parameters for a specific circuit layout
;; Runs on AutoCAD 2011 Visual LISP

(setq array-coordinate-list (list '((-201201.0 134712.0) (-111260.0 61650.0))
                '((-97360.5 134710.0) (-7420.0 61650.0))
                '((6479.50 134710.0) (96420.0 61650.0))
                '((110319.5 134710.0) (200260.0 61650.0))
                '((-201200.5 41160.0) (-111260.0 -31900.0))
                '((-97360.75 41160.0) (-7420.0 -31900.0))
                '((6479.25 41160.0) (96420.0 -31900.0))
                '((110319.25 41160.0) (200260.0 -31900.0))
                '((-201200.75 -52390.0) (-111259.75 -125449.75))
                '((-97360.75 -52390.0) (-7420.0 -125450.0))
                '((6479.50 -52390.0) (96419.50 -125449.75))
                '((110319.50 -52390.0) (200260.0 -125450.0))))

(setq contact-pad-list (list '(-113797.50 136778.5)
                '(-9957.5 136778.5)
                '(93882.5 136778.5)
                '(197722.5 136778.5)
                '(-113797.5 43228.5)
                '(-9957.5 43228.5)
                '(93882.5 43228.5)
                '(197722.5 43228.5)
                '(-113797.5 -50321.5)
                '(-9957.5 -50321.5)
                '(93882.5 -50321.5)
                '(197722.5 -50321.5)))

(setq pin-header-list (list '(-226518.0 -178149.0)
                '(-226518.0 -170529.0)
                '(-226518.0 -162909.0)
                '(-226518.0 -155289.0)
                '(-226518.0 -147669.0)
                '(-226518.0 -140049.0)
                '(-226518.0 -132429.0)
                '(-226518.0 -124809.0)
                '(-226518.0 -117189.0)
                '(-226518.0 -109569.0)
                '(-226518.0 -101949.0)
                '(-226518.0 -94329.0)))

(setq radius 317.5)
(setq pad-spaceing 5000.0)
(setq width 470000.0)
(setq height 370000.0)
(setq header-radius 508.0)
(setq header-spaceing 2540.0)

(defun make-panel (width height)
  ;; Current panel width is 470,000.0 um
  ;; Current panel height is 370,000.0 um
  ;; Make sure rectangle is centered on 0,0 in drawing.
  (setq top-left (list (- (/ width 2)) (/ height 2)))
  (setq bottom-right (list (/ width 2) (- (/ height 2))))
  (command "rectangle" top-left bottom-right "")
)

(defun make-array-holes (coordinate-list)
  ;; Parse coordinate list and draw rectangles representing holes in acrylic plate
  (if (/= (length coordinate-list) 0)
    (progn
      (setq pt0 (caar coordinate-list))
      (setq pt1 (cadr (car coordinate-list)))
      (command "rectangle" pt0 pt1 "")
      (make-array-holes (cdr coordinate-list))
    )
  )
)

(defun make-3contact-holes (center-pad-list radius pad-spaceing)
  ;; Parse center-pad-list and draw circles for 3 pin contact scheme
  (if (/= (length center-pad-list) 0)
    (progn
      (setq pt1 (car center-pad-list))
      (setq pt0 (list (- (car pt1) pad-spaceing) (car (cdr pt1))))
      (setq pt2 (list (+ (car pt1) pad-spaceing) (car (cdr pt1))))
      (command "circle" pt0 radius "")
      (command "circle" pt1 radius "")
      (command "circle" pt2 radius "")
      (make-3contact-holes (cdr center-pad-list) radius pad-spaceing)
    )
  )
)

(defun make-pin-headers (pin-header-list radius spacing)
  ;; Draw 3 1015 um hols spaced 2540 um apart, we need twelve of these along the edge of the contactor plate.
  (if (/= (length pin-header-list) 0)
    (progn
      (setq pt1 (car pin-header-list))
      (setq pt0 (list (car pt1) (- (car (cdr pt1)) spacing)))
      (setq pt2 (list (car pt1) (+ (car (cdr pt1)) spacing)))
      (command "circle" pt0 radius "")
      (command "circle" pt1 radius "")
      (command "circle" pt2 radius "")
      (make-pin-headers (cdr pin-header-list) radius spacing)
    )
  )
)

(defun C:draw-contactor-plate ()
    (make-panel width height)
    (make-array-holes array-coordinate-list)
    (make-3contact-holes contact-pad-list radius pad-spaceing)
      (make-pin-headers pin-header-list header-radius header-spaceing)
)


What was interesting to me was that adding "C" before a function makes it accessible from the command line without the lisp syntax. All other functions are accessible to the AutoCAD command line but only as S-expressions.