Forum unknown
· Programming
Hi Speed Serial I/O
11 messages in this thread
Have you tried increasing the size of the serial driver's receive buffer ? I
don't have my RKM here and I can't remember the call offhand but if you still
have problems I can look it up. Also your loop is a
one-character-per-iteration loop. If you know you are going to receive more
than one character, you should request more than one in your read request.
Well, as stated before I don't have my RKMs yet (the dealer sold out the
first day they came in; we're both trying to hold out for 1.2 at this point).
I was hoping against hope that the "static char ser_dat[n];" was setting the
buffer size, but from your comment I guess not. If you'd care to pass along
the tweek for changing the buffer size I'll certainly try it. But… it
needs to be an "exact" C statement, as I can't refer to my RKMs.
As to reading more than one character, I'd love to, but am not sure how.
Seem to remember a comment from the thread on slow screen I/O that
CMD_QUERY() could be used, but I don't know how. Again, I'd be indebted if
you could fill me in.
Maybe what I should say is: DOES ANYONE HAVE AN OLD SET OF RKMS THEY WOULD
BE WILLING TO LEND/RENT ME UNTIL MINE COME IN? That'd solve most of my
problems. 8)
Look forward to hearing from you. Thanks for the assistance.
Rick: Give me a call at (608) 256-3646 days, 257-3954 nights. I have my old
RKM I could lend you, but I only have your P.O. box number address, and I
need your REAL address, so I can mail it via a REAL postal service, like UPS.
HAHAHOHOHEHE…
"REAL postal service", eh? I dunno, nothing will ever beat Easyplex or Email
in general if you ask me. All others pale by comparison. (Now if we could
just figure out how to Email parcels… 8)
Okay, will try to catch you this evening. Thanks.
HAHAHOHOHEHE…
"REAL postal service", eh? I dunno, nothing will ever beat Easyplex or Email
in general if you ask me. All others pale by comparison. (Now if we could
just figure out how to Email parcels… 8)
Okay, will try to catch you this evening. Thanks.
Rick: Give me a call at (608) 256-3646 days, 257-3954 nights. I have my old
RKM I could lend you, but I only have your P.O. box number address, and I
need your REAL address, so I can mail it via a REAL postal service, like UPS.
Assuming you've opened the port with something like error =
OpenDevice(SERIALNAME,0,&IOSer,0); and IOSer is a struct IOExtSer, you can
find the fields of this structure in the <devices/serial.h> file. You read
the status of the port with: (Whoops, I've just seen a field with the same
name as the structure, change the struct IOExtSer to IORser)
IORser.IOSer.io_Command = SDCMDQUERY;
error = DoIO(&IORser);
You can then change different parmeters with the SDCMD_SETPARAMS command. To
change the buffer size try:
IORser.io_ReadLen = 6000; /* rx buffer */
IORser.io_WriteLen = 1000; /* tx buffer */
IORser.IOSer.io_Command = SDCMD_SETPARAMS;
error = DoIO(&IORser);
To read more than one character, set the IORser.IOSer.io_Length to the number
of characters you want before the BeginIO() call.
As to the RKM, I've got a spare v1.0 copy you could borrow but as I'm in
Ireland, it would probably be quick to wait for your dealer to sort it out.
By the way, did you mention that you're doing this for a MIDI program? If
so, could you advise me on what kind of features should be built into a MIDI
keyboard for the Amiga. I'm thinking of making one and don't know if it is
sufficient to just send key-down and key-up messages.
Hi, it's me again. I tried what you suggested. Strange results.
Since I don't have my RKMs I stole little chunks of code from here and there
and patched them together for the framework. I went home last night and
pulled up the listing and thought "Ha, that's why I didn't see the IO buffer
size; its set to 8 and I thought that was the bit length of the word!".
Being ever cautious, however, I just upped it to 16 rather than 6000,
figuring it would move the point at which I lost data back slightly.
The result was bizarre. The data I got had absolutely no relationship with
reality and I've yet to discern a pattern. I began wondering if that really
WAS word length, and if I had told it to get 16 bit words.
Anyway, I sucked down the tutorial on Serial I/O from DL7: and am going to
study that for a while before I ask for further help. It would be easier for
people to assist me if I could ask the right questions and understand the
answers, no? 8)
As to a MIDI keyboard, are you considering manufacturing, or is this a hacker
version for yourself? I'll assume hacker…
I don't see any reason why you _HAVE_ to do anything but Note On/Note Off. In
fact, if the program and instruments you will be driving understand that
velocity zero means note off (most do), you can send Note On only.
Additions I'd suggest: Pitchbend and Modulation wheels. Will require an
A/D, but they're not to difficult.
Key Velocity. This'd be trickier. You'd need a double buss velocity
keyboard; that is, the second buss needs to make a short distance after the
first buss. There are other ways to measure it, but this is a non-trivial
exercise. If you can figure out how to do it, go for it, it can't be beat.
Nondedicated controllers. Unless you're going to do it all in hardware
you'll have a CPU on board, so might as well take advantage of it. Put a
couple of switches on the keyboard so you can select programs or some such.
Would be really nice if you could assign what message each switch sends.
AfterTouch. This is fairly trivial if you've got the A/D for the pitchbend
wheel.
MIDI channel select. This is probably a luxury if you'll always be going
direct to your Ami.
Hope this gives you some ideas. But what it comes down to is this: I don't
think you really need anything but Note On/Note Off.
Let me know what you're working on and how it goes, eh?
Hi, it's me again. I tried what you suggested. Strange results.
Since I don't have my RKMs I stole little chunks of code from here and there
and patched them together for the framework. I went home last night and
pulled up the listing and thought "Ha, that's why I didn't see the IO buffer
size; its set to 8 and I thought that was the bit length of the word!".
Being ever cautious, however, I just upped it to 16 rather than 6000,
figuring it would move the point at which I lost data back slightly.
The result was bizarre. The data I got had absolutely no relationship with
reality and I've yet to discern a pattern. I began wondering if that really
WAS word length, and if I had told it to get 16 bit words.
Anyway, I sucked down the tutorial on Serial I/O from DL7: and am going to
study that for a while before I ask for further help. It would be easier for
people to assist me if I could ask the right questions and understand the
answers, no? 8)
As to a MIDI keyboard, are you considering manufacturing, or is this a hacker
version for yourself? I'll assume hacker…
I don't see any reason why you _HAVE_ to do anything but Note On/Note Off. In
fact, if the program and instruments you will be driving understand that
velocity zero means note off (most do), you can send Note On only.
Additions I'd suggest: Pitchbend and Modulation wheels. Will require an
A/D, but they're not to difficult.
Key Velocity. This'd be trickier. You'd need a double buss velocity
keyboard; that is, the second buss needs to make a short distance after the
first buss. There are other ways to measure it, but this is a non-trivial
exercise. If you can figure out how to do it, go for it, it can't be beat.
Nondedicated controllers. Unless you're going to do it all in hardware
you'll have a CPU on board, so might as well take advantage of it. Put a
couple of switches on the keyboard so you can select programs or some such.
Would be really nice if you could assign what message each switch sends.
AfterTouch. This is fairly trivial if you've got the A/D for the pitchbend
wheel.
MIDI channel select. This is probably a luxury if you'll always be going
direct to your Ami.
Hope this gives you some ideas. But what it comes down to is this: I don't
think you really need anything but Note On/Note Off.
Let me know what you're working on and how it goes, eh?
Assuming you've opened the port with something like error =
OpenDevice(SERIALNAME,0,&IOSer,0); and IOSer is a struct IOExtSer, you can
find the fields of this structure in the <devices/serial.h> file. You read
the status of the port with: (Whoops, I've just seen a field with the same
name as the structure, change the struct IOExtSer to IORser)
IORser.IOSer.io_Command = SDCMDQUERY;
error = DoIO(&IORser);
You can then change different parmeters with the SDCMD_SETPARAMS command. To
change the buffer size try:
IORser.io_ReadLen = 6000; /* rx buffer */
IORser.io_WriteLen = 1000; /* tx buffer */
IORser.IOSer.io_Command = SDCMD_SETPARAMS;
error = DoIO(&IORser);
To read more than one character, set the IORser.IOSer.io_Length to the number
of characters you want before the BeginIO() call.
As to the RKM, I've got a spare v1.0 copy you could borrow but as I'm in
Ireland, it would probably be quick to wait for your dealer to sort it out.
By the way, did you mention that you're doing this for a MIDI program? If
so, could you advise me on what kind of features should be built into a MIDI
keyboard for the Amiga. I'm thinking of making one and don't know if it is
sufficient to just send key-down and key-up messages.
Well, as stated before I don't have my RKMs yet (the dealer sold out the
first day they came in; we're both trying to hold out for 1.2 at this point).
I was hoping against hope that the "static char ser_dat[n];" was setting the
buffer size, but from your comment I guess not. If you'd care to pass along
the tweek for changing the buffer size I'll certainly try it. But… it
needs to be an "exact" C statement, as I can't refer to my RKMs.
As to reading more than one character, I'd love to, but am not sure how.
Seem to remember a comment from the thread on slow screen I/O that
CMD_QUERY() could be used, but I don't know how. Again, I'd be indebted if
you could fill me in.
Maybe what I should say is: DOES ANYONE HAVE AN OLD SET OF RKMS THEY WOULD
BE WILLING TO LEND/RENT ME UNTIL MINE COME IN? That'd solve most of my
problems. 8)
Look forward to hearing from you. Thanks for the assistance.