RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Announcements →

USB MIDI v0.08

Subscribe to USB MIDI v0.08 5 posts, 4 voices

 
Mar 18, 2023 8:02pm
Avatar Rick Murray (539) 12383 posts

I’ve made numerous changes and bug fixes, and more importantly updated the user guide to match the module (finally!).

You can get the binary from: https://heyrick.eu/blog/files/usbmidi008.zip (~140K)

There is no source available. Yes, I know it’s EUPL but it’s now 9pm and I’m hungry… another day.

Here’s what’s changed:

0.08 2023/03/18

  • Changed MIDI_InqBufferSize to correctly return the count of free bytes in the receive buffer, rather than the buffer size.
  • Fixed MIDI_SetChannel to be able to support all four ports.
    The original Acorn API says: “If the selected MIDI port is not installed, then it is undefined which port this and other SWIs will use instead. Use MIDI_Init to find the maximum port number installed, and never exceed it.”
    Since we are using USB and it could be possible to have port 1 and no port 0, and since leaving the status “undefined” is a lazy and dumb thing to do, this module simply verifies the chosen MIDI device is available and if not, then the currently selected MIDI channel will NOT be changed.
  • Note: The default initial setting is 0 (channel 1 on port 0) even if no MIDI devices are connected. This is because the channel needs to be set to something.
  • Added MIDI_Remap SWI. This doesn’t do anything (it will return an error) but is added to allow for future functionality with port mapping to not be a part of the MIDI_Options SWI, which should be for controlling the behaviour of the module as a whole.
  • Changed MIDI_Options as follows:
    R0 = If 0, then use the millisecond timer (if available)
    If 1, then fake millisecond timing using the 100Hz ticker
    R1 = Bitmap of which ports to apply delay to for cheap serial adaptors.
    Bit 0 = port 0 … bit 3 = port 3.
    In both cases, using -1 on entry will report the current setting without changing anything.
  • MIDI_InqSongPositionPointer now also sets bit 3 if in Fast Clock mode; and now correctly flags whether we’re using internal timing (Fast Clock mode) or external timing (not Fast Clock, with MIDI clock events and the clock active – following MIDI_Start).
  • Fixed MIDI_TxCommand to return the number of scheduler slots available.
  • MIDI_Init bit 3 can now be used to purge the scheduler buffer.
  • Changed MIDI_USBInfo to be more useful. Refer to documentation.
    For helping make a tidier list of MIDI devices, the SWI returns the USB ID number (such as “USB15”) and the device Product name.
  • The non-FastClock timing is wrong. It looks like we might need to multiply the MIDI clock ticks by six, and then use Sound_QBeat to break this into bars and microbeats, with bars incrementing in the upper 16 bits and microbeats in the lower 16 bits.
    The module currently just returns the number of clock ticks received. Does anybody or anything use the beat timing, or is it all based upon the system clocks?
  • Added some things to *MidiUSBDebug.
  • Updated user guide for current version of MIDI module, so it isn’t a mere eight years out of date.
 
Mar 19, 2023 3:38am
Avatar Lauren Etc. (8147) 11 posts

Good job Rick! I’ve already incorporated the fixed MIDI_InqBufferSize and the product names into what I was working on. Haven’t gotten to using much of the other features yet though. Thanks a bundle :)

 
Mar 19, 2023 4:21pm
Avatar Rick Murray (539) 12383 posts

Archives, sources, document files…

https://heyrick.eu/blog/index.php?diary=20230319

 
Mar 20, 2023 8:48am
Avatar Jean-Michel BRUCK (3009) 160 posts

Thanks Rick for this version the updated guide and your blog.
Rhapsody4 is happy :-)

I need to fix the keyboard note input problem in real time…

 
Mar 21, 2023 9:33pm
Avatar Paolo Fabio Zaino (28) 1368 posts

Nice, thanks Rick! :)

Reply

To post replies, please first log in.

Forums → Announcements →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Announce and discuss new hardware and software releases.

Voices

  • Rick Murray (539)
  • Lauren Etc. (8147)
  • Jean-Michel BRUCK (3009)
  • Paolo Fabio Zaino (28)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys