MIDI, Music, Audio
Bernard Boase (169) 208 posts |
Sorry to be imprecise. On both ARMX6 OS 5.29 (21-Dec-2022) and Pi 400 OS 5.29 (14-Feb-2023) Rhapsody4 loops during load, repeating in a central viewport until Alt-Brk: So those two errors are identical save only for the position of BASIC in the ROMs. I haven’t been able to elicit again the error about the Tones file (sorry, not directory). At one point it reported not finding file Tones via an incomplete pathname …!Rhapsody4.MidiSetup.MidiDevice.Tones in which MidiDevice was just ‘#’. I’ll leave that one for now until I actually connect a MIDI device when I hope that file Yamaha-PSR.Tones might be the basis for a Tones file to work with a Yamaha PSS-580. |
Bernard Boase (169) 208 posts |
@Jean-Michel — That is very good to know. I’m sure the loading error I describe can be easily solved. |
Peter Everett (9846) 59 posts |
I also cannot get Rhapsody4 to work on my Pi4. It fails with one of the following errors, File ‘SDFS::RISOSpi.$.Apps.Rhapsody4.!Rhapsody4.MidiSetup.#.Tones’ not found at line 6524 or Internal error: abort on data transfer at &FC1ACA08 at line 68 The abort needs an Alt-Break to stop. Running/quitting applications or creating/quitting big ram discs can sometimes change the error from one to the The version I have is Rhap4_220906/zip. I thought it was my setup but it seems Bernard has had similar problems. I stopped all my extra stuff booting on startup, but it makes no difference. My reason for wanting to get this working is that I’ve been playing with MidiSupport and have created a minimal version for the Pi4 (and the associated MidiMan and drivers), and the more things I can test it with the better. |
David Pitt (9872) 363 posts |
+=2. I cannot get it to run on either the Titanium or RPi1, the errors are as described above. |
Jean-Michel BRUCK (3009) 359 posts |
Hi all, @Peter I tried to build USB drivers for MIDISupport, but I lack information. The goal is to have both an external device, and ESP’s MidiSynth (and now your module). Note The ESP apps are in the possession of ROOL, free of rights, if I’m not mistaken. I will prepare Rhapsody4, and upload it today. |
Jean-Michel BRUCK (3009) 359 posts |
Done, thanks for testing. |
David Pitt (9872) 363 posts |
It’s good here now, thanks. |
Peter Everett (9846) 59 posts |
Thats great, it now works fine thanks. Regarding MidiSupport, I bought ESP’s Synth Plus with midisupport and Rhapsody4, and a MidiMax II card back in 2000. It all worked fine on my RiscPC and the software still works fine on the replacement RPCEmu. However, none of it works on the Pi. The ESP source code is all with ROOL but only the MidiPlay module is accessible the rest is “closed”. MidiSupport module. There’s no hardware driver support and I’m sure it’s not a full implementation as I only have limited details but it works. What it really needs is a USBMidi driver module. I’ve written a dummy driver module with just the driver in. All it needs some kind soul to add the USB part of their MIDIUSB module to it! I haven’t got round to having a go myself yet. I will upload a snapshot of it all. It will take a few days to tidy it up but I’ll post here when I’m done. |
Jean-Michel BRUCK (3009) 359 posts |
Nice,
I would be interested , I have already made successful attempts in USB (Audio recording).
Thanks |
Peter Everett (9846) 59 posts |
I’ve uploaded a snapshot of my midi support system. It’s based on how the 26bit version I have works, plus information from Lenny’s archived website for the 32bit version, and the MIDISupport Functional Spec issue 7 dated 1 Mar 2003. I’ve currently only tested it on my PI4 and many things may not work properly. There’s more information in the ReadMe within the zip. |
Jean-Michel BRUCK (3009) 359 posts |
Thanks Peter, I will take a look, ESP’s work should not be lost and MIDISupport adds possibilities. |
Peter Everett (9846) 59 posts |
I’ve done about all I can with my PI version of ESP’s Midi Support system and All the driver modules need some sort of timing and I had been using the system The USB module copes with composite devices where the Midi interface might not For delay measurement, this is the most extreme test I did, using a couple of DigitalCD -> MPlay -> MidiSupport -> USBMidi(port 0) -> h/w midi adapter 1 -> (first 32.5k serial link) -> h/w midi adapter 2 -> USBMidi(port 1) -> MidiSupport -> USBMidi(port 1) -> h/w midi adapter 2 -> (second 32.5k serial link) -> h/w midi adapter 1 -> USBMidi(port 0) -> MidiSupport -> MidiSynth Round trip delay from the MPlay module to the MidiSynth module is 3ms, 2 of For the 2 loop test, I also passed the second serial link into a Roland JV1080 |
Rick Murray (539) 13840 posts |
When it rains, it pours, right? ;) https://heyrick.eu/blog/files/usbmidi010.zip (~201KiB) Loads of fixes and enhancements by Ian Stanley…
I wish to take a moment here to thank Dave and Ian for their enhancements to by MIDI code. We now have useful MIDI drivers for RISC OS that work well with Rhapsody4 on a variety of RISC OS 5 systems. If you have a simple MIDI setup (a keyboard/synth and something like Rhapsody4), this is the simplest solution. Just drop the module into !System.500.Modules.MIDI and ensure it’s loaded before you start Rhapsody4 (JLB’s versions do this) or, god help you, Maestro. MIDI will just magically work, but note that both programs may need additional setting up in order to make best use of MIDI. For more complex setups or to replace an existing ESP multi-part system, Peter’s post above may be of interest. I’m pleased to see a renewed interest in using MIDI with RISC OS. |
Rick Murray (539) 13840 posts |
For Rhapsody4, the MIDI setup is kind of complex. At the very least, for a generic MIDI device, the last four lines of Setup should say: #1/1-9,11-16 :"GM" #1/10 :"GMDrumKit" #2/1-9,11-16 :"GM" #2/10 :"GMDrumKit" This defines a General MIDI device on ports 1 and 2, with standard voices on all channels (1-16) except channel 10 which is the drumkit. This is normal. Before you try customising to your specific hardware, ensure it works as a standard MIDI device. |
Peter Everett (9846) 59 posts |
Well I’d just like say thank you Rick and to Dave and Colin for all your work on usb midi and all the posts on the subject over the years. I really was a great help. And as you say, when it finally stops pouring down with rain, 3 buses turn up. |
Paolo Fabio Zaino (28) 1882 posts |
That’s a lot of great news/updates all together, thanks everyone involved! Awesome work! :) |
Colin Ferris (399) 1814 posts |
Is there such a thing as a USB stick – Midi sync generator with sound out? |
Steve Pampling (1551) 8170 posts |
I keep half expecting one of the innovative pi-in-a-box suppliers to create a “hat” to do that. |
Rick Murray (539) 13840 posts |
Why a hat? You just need something that can read in the MIDI data and then push it out to a synth chip. The VS1053 (IIRC) has a MIDI mode. Of course, the reason why these things don’t exist is twofold: Firstly, most other systems have ways of playing MIDI natively. Android can directly play .mid files, for example. Secondly, a simple synth like that would sound crap. Like a toy keyboard from the 80s. Slightly better is a wavetable synth. Then we’ll start to head into samples of actual instruments (with varying degrees of realism 1). What differentiates a €15 chip from a €200 keyboard from a €2,000 keyboard is, in large part, the quality of the reproduction. 1 I think my keyboard has partial samples, the grand piano seems to have slight differences in the audio in groups of an octave, so I think each octave has a base sample that is sped up progressively until the next octave. Other instruments (like honky tonk) might work by modifying the grand piano. I think the onboard ROM is 2MB, that doesn’t sound enough for full samples of some 500 instruments. |
Clive Semmens (2335) 3276 posts |
ROFL – no indeed. Some pretty impressive data compression tricks to do that, whose expansion would probably need >2MB of code…
A whole octave is a bit much to do that with, although even a real piano has a step change or two in sound where the number of strings per key changes. |
Paolo Fabio Zaino (28) 1882 posts |
Like this? Or better this: https://www.koopinstruments.com/information/raspberry-pi-midi-synthesizer Or any Roland Canvas Synth (they are very small, half a rack, easy to keep on a desk) But, before the discussion goes nuts (like in another topic), I agree with Rick, why a hat? There are so many great sounding synths of all sizes (so no lack of space is not a good excuse to justify a hat!), some of which is very cheap as well (so no, price also does not justify a hat), and having their own MIDI unit means you can combine multiple of them to have even more amazing results (not all synth have the best sound quality for all instrument’s sound). So why a hat? What does it brings in terms of value? (genuine question from a musician. I am askign because I keep seeing this thing about a synth hat for the Pi) |
Rick Murray (539) 13840 posts |
Looks like the ROM might be 8MiB (found a service manual).
Trade offs. You want better than an octave range per sample, buy a more expensive model. ;)
A basic actual keyboard costs €200-300, with MIDI inputs this can double up as a synth plus you can enjoy it without the computer just messing around playing stuff (or randomly prodding the keys, in my case :( ). Just get one with touch sensitivity, it really does make a difference to how it feels and sounds.
There’s this, but it’s not what is being asked for. Because, really, given the price, turns out that it’s far simpler to accept MIDI data and get the Pi to perform the synthesis in software rather than bolt on some hardware that might end up costing rather more than the Pi itself. Nobody needs a hardware hat to play MIDI on RISC OS. We just need a halfway competent software player. |
Peter Everett (9846) 59 posts |
A few years ago I wrote a command line program to read DLS sound font files and export the waves. This is what it gave for the Roland Sound Canvas file gm.dls used by the microsoft build in synth. It’s a big list so I’ve just picked a few instruments. ----------------- DLS File Reader v0.1 Mar 26 2021 ----------------- File: gm.dls Size: 3440660 bytes Instruments: 235 Version: 1.0.16.2 Waves: 495 Comment: 960920 ver. 1.00.16 Copyright: Copyright 1996 Roland Corporation U.S. Engineer: Roland Corporation Name: GS sound set (16 bit) Software: dls_cnv v0.27y Subject: 226 melodic + 9 drum instruments [---Patch---] Ins BHi BLo Prg Rgn Name (Instrument,Bank Hi,Bank Lo,Program,Number of Regions) --- --- --- --- --- ---- 0 [ 0, 0, 0] 10 Piano 1 Rgn Klo Khi Wav Name (Region,Key Lo,Key Hi,Wave number) --- --- --- --- ---- 0 0 38 289 PIANO36 1 39 43 290 PIANO41 2 44 50 291 PIANO48 3 51 59 292 PIANO56 4 60 67 293 PIANO64 5 68 74 294 PIANO73 6 75 81 295 PIANO78 7 82 88 296 PIANO84 8 89 97 297 PIANO92 9 98 127 298 PIANOA3 72 [ 0, 0, 36] 4 Slap Bass 1 Rgn Klo Khi Wav Name --- --- --- --- ---- 0 0 38 372 SLPBS31 1 39 67 373 SLPBS43 2 68 104 374 SLPBS84 3 105 127 403 STLGT84B 174 [ 0, 0,114] 2 Steel Drums Rgn Klo Khi Wav Name --- --- --- --- ---- 0 0 106 397 STLDR72 1 107 127 191 HARP_96A Each instument has a number of “regions” and each region covers a number of keys with a wave number in the wave pool. Waves are quite often used for a number of instruments especially at the high end where there are less harmonics, so less differences. Drum kits are a single instrument with a single key region for each percussive part. 226 [ 0, 0, 0] 61 Kit: Standard Rgn Klo Khi Wav Name --- --- --- --- ---- 0 27 27 196 HI_Q_60 1 28 28 371 SLAP_60 2 29 29 381 SPUSH60 3 30 30 380 SPULL60 4 31 31 396 STICK64 5 32 32 93 CLICK60 6 33 33 359 SIDE_60 7 34 34 233 METRO60 8 35 35 220 KICK264 9 36 36 376 SOLKK60A 10 37 37 359 SIDE_60 11 38 38 161 FATSD60A 12 39 39 193 HCLAP60 13 40 40 474 T_SNR60A 14 41 41 444 TOM__60 15 42 42 83 CHH__60A I’ve not listed the whole kit. If a key is not within any region for an instrument, no sound is produced. Each region has a set of “Articulation” parameters that tell the synth how to play the wave, which bit can be repeated, filtering, modulation etc. I think SF2 sound font files are similar. |
Jean-Michel BRUCK (3009) 359 posts |
Bonjour, @Pete,Your MIDI module is MIDI_GM compatible I think, otherwise it would be easy to add the definitions in the MIDISupport directory. I built a few years ago a control interface for my expander (which still works very well: a Roland MGS64). I updated it with mute and solo functions.(My first ToolBox application ) ESP MIDIsynth. |
Peter Everett (9846) 59 posts |
@Jean-Michel, Thanks for the update.
Yes my MidiSynth is GM compatible, the sound set built into the module code is the GM1 standard, 1 bank of melodic instruments and 1 drum kit. It supports up to 127 banks and 127 drum kits. I will include a patch list next time.
I take it you mean my midisupport system, going into a midi port then routed to a usb midi port? If so it means your app works with my midi module and my usb module works with your expander which is great. Recently I have spent so much time writing code that I’ve had no time to improve existing and create additional sounds. I do have a sound set with extra banks and many extra instruments that I’d been playing with a few years ago and the plan is to stop fiddling with midisupport and hopefully bug fixing for a while and get back to sound creation. After all that’s what has always interested me. As for ESP’s MIDIsynth, I would guess the best way forward is to port something. My synth is not a wavetable synth so could never use DLS or any sound font format files. |