kmatheussen / radium

A graphical music editor. A next generation tracker.
http://users.notam02.no/~kjetism/radium/
GNU General Public License v2.0
851 stars 36 forks source link

tools / .rad fileformat parser #720

Closed coderofsalvation closed 8 years ago

coderofsalvation commented 8 years ago

Any pointers on where I could find code which parses the .rad fileformat?

REASON: i would be nice to allow an ecosystem of (commandline/gui) tools which could export/import stuff from/to .rad format.The community could help out in here.

Examples gui:

Examples commandline:

Question: what language is the parser written in?

kmatheussen commented 8 years ago

Radium uses a custom format. Here is the common lisp function for converting a rad file into an s-expression, used by the rad2cmn script in common music notation:

(defun readsong (streem)
  (let ((ret '())
(doloop t))
    (while doloop
      (let ((line (read-line streem NIL)))
(cond ((or (not line)
  (string= "/" line))
      (setf doloop NIL))
     ((string= "\\" line)
      (push (readsong streem) ret))
     ((string= "" line)
      NIL)
     (t
      (push (cond ((digit-char-p (aref line 0))
   (string-to-number line))
  ((alpha-char-p (aref line 0))
   (read-from-string line nil))
  (t line))
    ret)))))
    (nreverse ret)))

Since the above function was written, radium also saves a lot of info into hash maps. There are functions in the file common/hashmap.c for reading and parsing those.

On Fri, Oct 28, 2016 at 10:24 AM, coderofsalvation <notifications@github.com

wrote:

Any pointers on where I could find code which parses the .rad fileformat?

REASON: i would be nice to allow an ecosystem of (commandline/gui) tools which could export/import stuff from/to .rad format.The community could help out in here.

Examples gui:

  • a 'script' machine which watches a given file (which is opened in your favorite texteditor) to call radium functions and/or bind to radium events (just like the pd interface, but in this case it interfaces to a tiny scripting language like https://github.com/Samsung/jerryscript .

Examples commandline:

  • ./midi2rad foo.mid foo.rad
  • ./rad2midi foo.rad foo.mid
  • ./rad2txt foo.rad foo.txt

Question: what language is the parser written in?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kmatheussen/radium/issues/720, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF9pwT0qToAGy2kYcnY8vN3cesMTB70ks5q4bFRgaJpZM4KjMfS .

kmatheussen commented 8 years ago

It's probably simpler to write a python or scheme script that runs in radium, than to parse the .rad files in an external program. The .rad format may change at any moment too.

coderofsalvation commented 8 years ago

ok thanks for pointing this out. Im closing this issue since it's not an issue.