MidiMon 1.00, a USB MIDI app
Colin (478) 2433 posts |
Not THE John Williams. You may get another film score out of that keyboard yet. |
Rick Murray (539) 13850 posts |
Nope. The controller is toast. Well, not quite, it sometimes works, but the fault is there not the sensors or the wiring. He said it should be changed if the car is up to, say, three years old… but on one that’s a decade old with 60K on the clock he wouldn’t bother. It doesn’t actually do that much on a car moving at 29mph maximum (legally), so the mechanical brakes will do the job. Been here quite a while (watched a film downloaded from Netflix last night) but it’s a necessity.
Fair enough. I don’t envisage any particular lag, but it would be good to test. It’s worth noting that serial MIDI takes around 320µS per byte, which without running status is just under 1ms per note, about two and a half for a simple chord. That’s why running status was devised. ;) But, hey, I’m all for testing with experiments. A loop in BASIC to echo anything received ought to do the job.
France – England but posher? <ducks> But, yeah, Picard can be financially devastating… |
Colin (478) 2433 posts |
callbacks can have large delays I discovered when testing usb audio. An application has an even bigger delay. I was thinking more sitting on a vector waiting for input and playing with the lowest latency. |
Rick Murray (539) 13850 posts |
Underestimated that slightly. 😨 Still, lots was done. The printout of work fills a page. Now for comfort food… |
John WILLIAMS (8368) 495 posts |
No, the other one. I play guitar. No, not that one either. |
Jean-Michel BRUCK (3009) 362 posts |
We can make a LoopBack with MIDI II) Rhapsody4 has a MIDI Thru functionality (Menu IconBar), this is very practical because it allows you to listen to what you are playing on the keyboard during capture. The difference between the two methods is that the first uses hardware and the other is software. |
John WILLIAMS (8368) 495 posts |
Jean-Michel was kind enough to help me with some of the French language stuff I make available here in the capacity of “proper native French person”! Only relevant in that he is French, Rick lives in France, and I did for a time. And we are all interested in this topic on getting MIDI working! |
Peter Everett (9846) 59 posts |
Took a while to find it, For delay measurement, this is the most extreme test I did, using a couple of From when I was doing silly tests on my USB module. |
Peter Everett (9846) 59 posts |
The above test was done with nothing else going on.
Yes, I found the same. My timing mechanism provides the modules via a callback with the number of millisecond interrupts since the last callback. Fine no problems. I changed the code in the MIDI file player to use “1” instead of number since last call. This would assume that no interrupts had been missed. The player would very noticably slow down when a window was moved around. I concluded that it was easy to get callback delays of more than a millisecond. |
Rick Murray (539) 13850 posts |
Okay, home now. Got myself a big confetti cake that’s a lot of whipped cream. I wanted a cheesecake, but they’re hideously expensive, and Picard was offering a third off of this cake if I used my loyalty card. Anyway, I threw this together… SYS &604E2, 0 TO ; f% IF (f% AND 1) THEN PRINT "MIDI initialise error - is module loaded?" END ENDIF PRINT "Simple MIDI echo"'"================"''"ESC to quit" REPEAT REM Get a command SYS "MIDI_RxCommand", -1 TO d%, t% SYS "MIDI_InqError" TO err% IF ((err% AND 255) = ASC("X")) THEN PRINT '"MIDI device unplugged or not present." END ENDIF REM Pull it apart da% = ( d% AND 255) db% = ((d% >> 8) AND 255) dc% = ((d% >> 16) AND 255) REM Is it a Note On? IF ( ( da% >> 4 ) = 9 ) THEN REM Really a note ON? IF ( dc% > 0 ) THEN REM Yes, so echo it at max volume PRINT "Note "+STR$(db%)+" on" SYS "MIDI_TxNoteOn", db%, 127 : REM Loudest ELSE REM No, velocity is 0 so it's a note OFF PRINT "Note "+STR$(db%)+" off (v=0)" SYS "MIDI_TxNoteOff", db%, 0 ENDIF ENDIF REM Is it a Note Off? IF ( ( da% >> 4 ) = 8 ) THEN REM Yup, so do it PRINT "Note "+STR$(db%)+" off" SYS "MIDI_TxNoteOff", db%, 0 ENDIF REM Repeat Until Bored UNTIL FALSE The reason it blasts out the note at maximum velocity is because my keyboard is touch sensitive, so I can play the note gently, and hear it after doing a round trip through the MIDI module (twice) and some BASIC. There may be delays measured in milliseconds, but to my shonky perception it’s playing as I press the keys. Even bashing lots at once and/or swiping a hand down the length of the keyboard… the only difference between this and the keyboard regular is that there’s no finesse. It’s just behaving like the sensitivity is turned off, there’s no discernable lag. In order to get lag, one must run it in a TaskWindow and drag the window around while playing. But this is inconsequential as by that point the MIDI notes will have already been timestamped so when they are actually received by the app is not important, so long as they’re received in time that the buffer doesn’t overflow. |
Rick Murray (539) 13850 posts |
Didn’t you once have a bloke just down the road also called John Williams? |
Rick Murray (539) 13850 posts |
Okay, here’s version 0.11 of MIDI. It’ll be on my blog soon. https://heyrick.eu/blog/files/midi_011.zip It is functionally equivalent to v0.10d but since RMEnsure doesn’t work like that, and I can’t add extra numbers (like v0.104), I’ve just bumped the number so one can programmatically check for the most recent version (that, you know, works ;) ). It’s about 186K IIRC. Comes with full source (not just the bits that have changed), the Mapper app, the two tests, and the English language copy of the EUPL licence as a PDF. Known bug: MIDI beat timing works with an external clocking source, but there’s still plenty of brokenness around it – probably best to not use at this time. À voir… |
Colin (478) 2433 posts |
Sounded good to me Rick – except for no velocity. Does that mean that the keyboard maker skimped on midi output and didn’t transmit velocity data? |
Steve Pampling (1551) 8172 posts |
“The Leclerc” – Charles has a younger and an older brother, you know1. |
Stuart Swales (8827) 1357 posts |
He also has a MBT |
Colin (478) 2433 posts |
Now I’ve got velocity working in your program it feels a bit delayed – odd. |
Steffen Huber (91) 1953 posts |
I follow this thread with interest (despite having zero interest in MIDI – last time I did anything related was testing ReMIDI and TiMidity…). But I note that we really need some distinction between “keyboard” and “keyboard”, because it confuses me every time I read it :-) like in German “Tastatur” vs. “Klaviatur”. |
Rick Murray (539) 13850 posts |
I did mention, it’s so I can play softly and hear the notes coming back through the computer over anything the
Yeah, it’s a bit awkward in the comments and docs to have to try to remember to specify which keyboard. I tend to refer to the keyboard that makes noises as a piano. When I remember, that is. ;) BTW, it’s clavier and clavier in French. Same problem. |
John WILLIAMS (8368) 495 posts |
Yes – a tiny commune in France having two John Williams’ – bizarre! But off topic! Discovered through mis-delivered packages! But still off topic! |
Colin (478) 2433 posts |
I changed the program to just RXCommand in TXCommand out. Run it single tasking – not too bad – and I can switch instruments from the keyboard – neat. Wonderful things manuals. |
Rick Murray (539) 13850 posts |
Even better things: standards. |
Steve Pampling (1551) 8172 posts |
Yeah, even Apple have a USB C on their charger cable these days. Sadly, it’s on the end that fits into the USB socket on the mains adapter… |
Rick Murray (539) 13850 posts |
A little whoopsie in Rhapsody. MidiSetup → GM → Tones It says: p#58 Trombone which means it doesn’t get listed. |
Jean-Michel BRUCK (3009) 362 posts |
Thanks Rick This morning I have a new test version, it works better, if you have time to test. This works for StepTime and for semiRealTime, to be confirmed. Note: I did a test with the MelIDI demo, the notes are taken into account, but it corresponds to Rhapsody’s StepTime. We can’t save anything anyway. Also with !SysExy (ESP + MidiSupport(ESP) + USBMidi Driver Peter) I was able to recover information (dump) from my exapndeur Roland SC55 and save it, you can also do it it from !SysExy to Roland. This can be useful for saving configurations and reinstalling them. To avoid keyboard confusion, I suggest: I feel that there will be composers following in the footsteps of John Willams the first, second…:-) |
Jean-Michel BRUCK (3009) 362 posts |
@Rick When I load version 0.11 I get error messages. Error : &00800E07 Message: Internal error, no stack for trap handler: Internal error: abort on data transfer at &FC1E01B4, pc = 00008BCC: registers at 0001C640 ** WimpError ** from unknown task Error : &00800E07 Message: Internal error, no stack for trap handler: Internal error: abort on data transfer at &FC1E01B4, pc = 00008BCC: registers at 0001C640 ** Error ** Error : &00000116 Message: SWI &2B returned a bad error pointer 11:39:47.08 ** WimpError ** from unknown task Error : &00000116 Message: SWI &2B returned a bad error pointer I forgot to copy them… after rebooting. I will add them, its done! If no devices are connected at startup, version 0.11 does not give an error message. |