Vectrex32 and Max MSP

Started by troff, April 07, 2020, 10:00:37 PM

Previous topic - Next topic

troff

Does anyone know if it's possible to send data from max MSP to the Vectrex 32?

If so does anyone have any example code?

Thanks everyone!

Vectrex32

I haven't heard of anyone working on this. I know nothing about max MSP but I would think the first step is to export AY-3-8910 commands from it. Is it able to do that?

If so, you would need some JMOS ("just a matter of software") to convert that into BASIC.

- Bob

jaymzjulian

Quote from: Troff on April 07, 2020, 10:00:37 PM
Does anyone know if it's possible to send data from max MSP to the Vectrex 32?

If so does anyone have any example code?

Thanks everyone!

Do you mean to send the data in realtime, or in batch in order to create a standalone vectrex replayable thing? 

My initial thought around realtime was to using the usb-serial connection from the pc to the vectrex (I've used https://projectgus.github.io/hairless-midiserial/ to do this before), though I'm not sure there is a way from gsbasic to do that right now - Bob should be able to answer that one.  But from there it should be reasonably doable to turn that stuff into sound commands on the vx32 side.  If the way to interface to serial exists, I should be able to put together a quick demo code for that pretty quickly.

On the "I have AY/YM music made in max that I have made in max/msp, and want to replay that on the vectrex" variant of this question, if you can log it to a YM file (which is just a register dump, so i'd expect any tool that does YM music should do so), you can convert that a compressed form with https://github.com/cdepecker/YMCruncher , and then use the ayc player that's over on the code swap forum.  (YM files, while seperatly compressed, are compressed with lha which is a pain to decompress in realtime in basic)

On the "I am using max to create animations, not music" variant of this question, you'd need something to convert the vector output - most MSP vector tools i've seen use some varient of ilda commands, which could be interpreted, but my information is about 10 years out of date on that (I last used max myself in 2004 ;))

Vectrex32

Quote from: jaymzjulian on April 08, 2020, 05:46:49 PM
My initial thought around realtime was to using the usb-serial connection from the pc to the vectrex (I've used https://projectgus.github.io/hairless-midiserial/ to do this before), though I'm not sure there is a way from gsbasic to do that right now - Bob should be able to answer that one.

A BASIC program can read from the USB serial port using file I/O and Stdin. See the section in the Vectrex32 manual titled "File I/O" (section 7.12 in the version 1.23 manual).

- Bob

troff

Thanks, I was thinking of starting off with something very simple, like have max MSP send a few ASCII characters via the usb, like maybe rs232 or something. And have the Vectrex32 listen for the data then do something like display something on the Vectrex screen.

Figured I'd start there and work up.

Any ideas to a newcomer to Vectrex32 as to how to set up a program that monitors the USB port as if it was a rs232 comm port?


troff

Thanks Bob, your reply came in as I was typing. I will look in to it.

jaymzjulian

Quote from: Troff on April 08, 2020, 06:23:08 PM
Thanks, I was thinking of starting off with something very simple, like have max MSP send a few ASCII characters via the usb, like maybe rs232 or something. And have the Vectrex32 listen for the data then do something like display something on the Vectrex screen.

Figured I'd start there and work up.

Any ideas to a newcomer to Vectrex32 as to how to set up a program that monitors the USB port as if it was a rs232 comm port?

simple case:


controls = WaitForFrame(JoystickNone, Controller2, JoystickNone)
while controls[1,3] = 0
  controls = WaitForFrame(JoystickNone, Controller2, JoystickNone)
  print "reading stdin"
  str = fgetc(Stdin)
  call clearscreen()
  call TextSprite(str)
  print "read "+str
endwhile


I did a have a few issues:
a) from my windows+teraterm, fgets actually blocked forever, ratehr than coming back on a newline - hence using fgetc
b) it will only draw _when_ it's sent data - the fgetc function _will_ block.  but that's also okay, maybe....

in any case, this should at least get you started

jaymzjulian

One more piece of advice on this - I'l actually doing some experimenting with serial today (implmenting a v.st vector protocol parser, so i can play star wars ;)), and I found of course, that two people not being able to be on the serial at once was a problem.  particularly, you can't debug ;).

I did find a tool around this though, which is i installed a driver that lets me share a serial port between two applications - https://www.eltima.com/article/share-com-port-between-apps/ .  others might have a better solution though!

jaymzjulian

Another sample: https://github.com/jaymzjulian/vectrex32_vstemu - this implements the v.st vector generator protocol over serialusb.  I can run the processing demos with it, but i'm still trying to build vectormame.  I'll post a video if i ever manage to make that part work..... dunno if the serial will be usefully fast enough, but i guess we'll see!

I'm using https://github.com/geoffmeyers/interceptty to watch the serial instead now - so i load in my terminal, disconnect that, then run ./interceptty -e 13 -l -f char /dev/ttyS3 to see any output the v32 gives me when I messed up my code (I always messed up my code ;))