Author Topic: Q 6.2 For Pdaxrom  (Read 2904 times)

agraef

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Q 6.2 For Pdaxrom
« on: October 22, 2005, 05:49:57 pm »
Q is a modern-style functional programming language based on term rewriting. It is an interpreted language with dynamic typing and fairly good library support. If you are looking for a high-level scripting language for your Z, aside from the usual suspects (Perl/Python/Ruby), then you might wish to give it a whirl. It is also useful as an advanced programmable desktop calculator. Please refer to http://q-lang.sourceforge.net/ for more details.

I've set up a little feed with all the needed bits and pieces here. The binaries are for RC11 or later. The feed also includes additional dependencies which are not currently in the official pdaXrom feeds. All packages install into /usr/local. Here is a quick rundown of the packages which are available right now:

- q_6.2_armv5tel.ipk: The core of the interpreter, also includes the standard library, POSIX system interface, as well as the Curl, GDBM, GGI, ImageMagick, Octave, Tcl/Tk and XML/XSLT modules. (At this time, the ODBC and OpenDX modules are not supported in the pdaXrom version.)

- graph_1.4_armv5tel.ipk: Combinatorial graph library and editor. Requires Tcl/Tk.

- q-opengl_1.1_armv5tel.ipk: Q's OpenGL interface. Requires pdaXrom's mesa3d package.

- swig_1.3.22-q_armv5tel.ipk: A SWIG version which has been patched up to add support for Q. Makes it easy to build interfaces between Q and C/C++ libraries.

Please note that, as far as memory sizes on PDAs go, these packages and the dependencies need quite a bit of storage space, so you'll probably want to install them on a memory card.
 
Quick startup guide: After installing the q_6.2_armv5tel.ipk package, you should be able to run the Q interpreter in an xterm or on the console by just typing "q" (or "q filename.q" to run the given Q script). A bunch of sample scripts can be found in /usr/local/share/q/examples. Onboard help is available in the interpreter with the "help" command (this fires up the language manual in the GNU info reader); the manual is also available as HTML and PDF from q-lang.sf.net. Start out with Section 2 ("Getting Started"), that should get you started quickly. If you have emacs installed, you might also wish to install q-mode.el in /usr/local/share/q/etc into your emacs site-lisp directory, and enable Q mode in your .emacs file as described at the beginning of q-mode.el.

Please let me know how it works for you and feel free to post bug reports and other comments to this thread (or use the bug tracker and mailing lists at the q-lang.sf.net site). I'm currently working on porting other parts of Q's multimedia library (the audio interface, in particular), and I started working on an SQLite module to make up for the missing ODBC interface. I'll announce new modules in this thread as they become available for the pdaXrom version.

Enjoy!
Albert Graef

willgan

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • http://
Q 6.2 For Pdaxrom
« Reply #1 on: October 23, 2005, 03:58:11 am »
is it possible for the qmidi to work?
My Current Z...

Zaurus C1000 - Pdaxii13
Using Pdaxrom-builder (SVN) for building packages

agraef

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Q 6.2 For Pdaxrom
« Reply #2 on: October 23, 2005, 01:21:43 pm »
Quote
is it possible for the qmidi to work?
Q-Midi needs Grame's MidiShare, and I haven't ported that yet. It's on my TODO list.

If I get that to work, then there's still the question where to send the MIDI output to. Hmm, I just noticed that the usb-midi kernel module seems to be available in pdaXrom, cool. Has anyone tested that already?
« Last Edit: October 23, 2005, 06:44:37 pm by agraef »

agraef

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Q 6.2 For Pdaxrom
« Reply #3 on: October 23, 2005, 09:37:53 pm »
Ok, I have the Q-Audio module working now. Get it from the feed while it's hot. It requires a few dependencies (portaudio, libsndfile, libsamplerate, fftw) which are also in the feed and should be pulled in automatically when you install the q-audio package.

To try it out, chdir to /usr/local/share/q/examples/audio and run "q audio_examp.q". Then plug in your microphone and enter the following two commands (at the "==>" prompt):

Code: [Select]
==> record 3
<>

==> play _
()

If all is well, this will record 3 seconds of audio and play it back. Of course you only want to do this with short pieces of audio because the entire wave has to fit into main memory. Fortunately, the sample script also has two functions sf_record and sf_play which directly record and play audio files (in any of the formats supported by the libsndfile library):

Code: [Select]
==> sf_record "test.wav" 20
()

==> sf_play "test.wav"
()

There are also the functions scope and sf_scope which play back a wave as with play/sf_play but also display the wave in a GGI window (this requires that you're running under X11, of course).

Code: [Select]
==> sf_scope "test.wav"
Note that sf_scope doesn't work all that well right now, because the audio_examp.q script is just a simplistic example which isn't really optimized for small/slow devices like the Zaurus. I've quickly hacked together an alternative version (attached file audio_examp2.q, gzipped to make the forum software happy), which puts the audio playback, file reader and scope visualization into different threads, so that interested programmers can get an idea of the kind of changes that are needed to make it work. I owe anyone a beer who also fixes up the sample audio_player script included in the package (which doesn't work properly right now because of the same reasons).

Cheers,
Albert
« Last Edit: October 23, 2005, 09:45:09 pm by agraef »

agraef

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Q 6.2 For Pdaxrom
« Reply #4 on: November 13, 2005, 01:17:00 pm »
Release 1.0 of the Q-SQLite module is now available, and I've uploaded a corresponding pdaXrom package to the feed.