News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_PulkoMandy

WILLY - Soundcard adapter (MIDI and OPL3)

Started by PulkoMandy, 21:36, 12 November 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PulkoMandy

Hello there!


Well, new project in progress in PulkoTronics laboratory!


"Willy" is an adapter to use Serdaco's OPL3LPT and S2P soundcards on Amstrad CPC and Amstrad Plus. It connects to the expansion port and allows you to play MIDI music (with S2P) or OPL3 music (with OPL3LPT).


I put some videos on Twitter (test with random notes for MIDI because there is no player yet, and SA2 player adapted from the CPC-ISA version written by Madram a long time ago): https://twitter.com/pulkomandy/status/1326984861442301962


I will be writing documentation on the card and how to use it during the week-end on Shinra website (shinra.cpcscene.net).


For now there are 9 prototype boards available. I would prefer to give these to developers, music composers, or other people who want to support the device by creating something. Let me know if you think you are in this case. Later on I will make a larger batch of final boards (slightly smaller and simplified PCB as I can remove some useless things I put there to experiment with)


[edit]
More details available on Shinra website

PulkoMandy

Attached a photo of the board in my setup

GUNHED

Great thing! Can you please explain how it works?

How does it compare to the LambdaSpeak III MIDI Interface?

I'm a MIDI novice, so please excuse my beginners questions.  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

XeNoMoRPH

I have seen your videos on twitter, I am a music enthusiast at CPC,  I have hardware like lambaspeak 3 and Playcity, but I am not a developer, I would be interested in having a unit when you release this board to the general public.
your amstrad news source in spanish language : https://auamstrad.es

PulkoMandy

I didn't know the LambdaSpeak did this many things, but from what I can see, it offers input and output to connect other MIDI devices.


The S2P is a bit different, it is a musinc synthetiser in itself. So, no input/output. But, it happens to accept MIDI commands for programming it.


For example, in the demo program I send "note on" commands, which are made of 3 bytes: the first ranges from 90 to 9F and tells which "channel" the note is played on. The second is the note number (0 to 127, covering a bit more than a standard piano range), and "velocity" (also from 0 to 127, controls the volume and possibly other parameters of the sound). By default all channels have a piano sound, but they can be reconfigured to any instrument from the "general midi" list (https://en.wikipedia.org/wiki/General_MIDI) with a "program change" command. There are also some special effects (reverb, chorus, ...) available.


With Willy, you need an S2P module: https://www.serdashop.com/S2P


To do the same with LambdaSpeak 3, you would need a Dreamblaster S2 with the traditional MIDI connectors: https://www.serdashop.com/Webwinkel-Product-198933047/Dreamblaster-S2-General-MIDI-Module-Bundle.html (same chip, different interfacing)

TotO

The DreamBlaster 2 is a really expensive adapter for what it does. Probably better to release your own adapter or include it into your Willy Design as it is around 5€ parts to do it compared to 80€ + extra shipping fees.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

VintageAdvantage

#6
Quote from: PulkoMandy on 08:22, 13 November 20I didn't know the LambdaSpeak did this many things, but from what I can see, it offers input and output to connect other MIDI devices.
There was also a simple MC program that plays the AY-3-8912 in the CPC via LambdaSpeak's MIDI IN.

And then there is Speak&SID, which allows you to play the on-board SID chip via MIDI IN (and the AY-3-8912 chip in the CPC). But the software is very primitive (even though it supports polyphonic NOTE ON / OFF messages).


https://youtu.be/4esnHlCg138

PulkoMandy

Quote from: TotO on 08:25, 13 November 20
The DreamBlaster 2 is a really expensive adapter for what it does. Probably better to release your own adapter or include it into your Willy Design as it is around 5€ parts to do it compared to 80€ + extra shipping fees.


I am not using the Dreamblaster X2 (which costs 80€) but the S2P. It costs only 35€: https://www.serdashop.com/S2P


And, no, I am not trying to solder QFN chips like this by hand. If you think it's a better option, you can do it. As usual I'll publish the schematics and you can reuse the same IO ports for compatibility. You know it well, the problem is not the price of the components but the time spent assembling and debugging the hardware... I think 35€ is acceptable.

VintageAdvantage

#8
Just to suggest a few other options for MIDI synthesizers to be controlled via CPC:

- any CPC Serial Interface / UART that can do MIDI BAUD RATE @ 8N1 - 31250 bps (USIfAC, ...) can do MIDI OUT (i.e., send MIDI commands to a MIDI instrument from the CPC).

- if you want to connect the CPC to a standard MIDI instrument with DIN MIDI, you only need an additional MIDI breakout board, for example

https://www.tindie.com/products/ubldit/midi-breakout-board-ez/

- even without MIDI DIN breakout board, there are a few inexpensive boards that can be controlled directly via UART TTL / TX line, for example, you could connect this one directly to TX of USIfAC (or LambdaSpeak 3 or Speak&SID or ...)

https://www.adafruit.com/product/1381?gclid=Cj0KCQiA-rj9BRCAARIsANB_4ABUSDITsW6lihukWx3lqL6oWVfHyB0aLxGxLRyEnH1ZwfS_K4cJmrUaAo2FEALw_wcB

64 polyphonic GM MIDI

- there is also the SAM chip which comes on a breakout board as well, with and without MIDI DIN socket

So, MIDI OUT from the CPC is possible with a number of options. MIDI IN (into the CPC) is much harder.

IMHO, the cheapest option to realize a 64 polyphonic GM MIDI synthesizer for the CPC is hence to use USIfAC (the old one) and the Adafruit board above for 25 $. That's all you need. And Software to be written on the CPC....

XeNoMoRPH

This video, I think I have already shared it on more occasions, I recorded it a long time ago, using the Symbiface III Hardware, you can play midi files of type 0:


https://vimeo.com/478823877
your amstrad news source in spanish language : https://auamstrad.es

TotO

Quote from: PulkoMandy on 09:30, 13 November 20You know it well, the problem is not the price of the components but the time spent assembling and debugging the hardware... I think 35€ is acceptable.
I'm mainly speaking about the fact that your board could include the MIDI interface to not use extra hardware, considering that you are using the S2P to prototype your own sound card around the OPL3.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

TotO

Quote from: PulkoMandy on 09:30, 13 November 20I am not trying to solder QFN chips like this by hand. If you think it's a better option, you can do it.
Yes, there is a better option and I have already done it: Adding a Wave Blaster connector to your OPL3 sound board to allow peoples to add an optional Dream Blaster wavetable on it if they want.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

PulkoMandy

I am using the S2P because it has a parallel interface. The Willy is 3 74HCTxx chips for address decoding and that's it. For a waveblaster interface I would first need to have a serial port, then send its output to the waveblaster device. And on the other side I would need to get the audio out of it and provide some analog stuff to route it to a jack connector. Here, none of this is needed. You just get direct access to the chips (the S2 or the OPL3, depending on what you connect).


The S2P is not used in OPL3 mode. You get an OPL3LPT from Serdaco, connect it to Willy, and that's it. Again, just 3 74HCTxx chips to provide address decoding, and I can reuse all the work of Serdaco to connect the OPL3, the DAC, the analog stage for audio output (which I have no knowledge about and don't want to dig into). So I have a solution that is simple and quick to assemble.


It makes my job very simple here. Maybe you should give me some time to write and publish the documentation before commenting about the design of the card and how to improve it?




TotO

OK, I though the "parallel to expansion address decoder" was only for the prototyping purpose and not the final product.
Sure, if you do not have the MIDI signal, you can't do more than using the S2P board for what it is. I understand.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

VintageAdvantage

#14
Quote from: PulkoMandy on 10:32, 13 November 20
I am using the S2P because it has a parallel interface.
Why would you do that? All that is required, really, is a TTL Rx-Tx (UART Send/Receive) line. Why not do it with a proper serial interface and standard MIDI? I understand that the device you are using has a parallel port... but is there an advantage to using a parallel port rather than the $ 25 GM MIDI synthesizer via UART from Adafruit above? That one could be hooked up directly to USIfAC.

EDIT: I will post a video of my USIfAC +

https://learn.adafruit.com/adafruit-music-maker-featherwing/midi-synth
CPCGM Midi Synty (~ 30 $ costs). 

PulkoMandy

If you use standard MIDI baudrate of 31520 baud you may be limited in how fast you can push the data to the device (it depends if your serial interface has a buffer to make up for it). With a parallel interface there is no such limitation, you can just send the datas as fast as the z80 is able to. I think it is also a little easier to program this way.


The other thing is my interface can be used with both the S2M (for MIDI) or the OPL3LPT (for OPL3 / Adlib music). For the latter there is no serial port option and that is what I was initially interested in. It just happens that an extra jumper to change a setting made the same interface usable for both OPL3 and S2P, so, I just added it.


It is also a lot more compact, no extra wires and interfaces with separate power supplies on my desk. Everythink seats neatly on the MotherX4 board.

VintageAdvantage

Another thing to point out for folks who like to use the Serial Interface to the SAM2695 (which is the chip used by PulkoMandy) here:

There are SAM2695 boards that have a MIDI DIN on board such as the

https://www.profusionplc.com/parts/sam2695-ek

Or

https://moderndevice.com/product/fluxamasynth-shield/
https://www.serdashop.com/waveblaster

These don't require a parallel port and can be directly connected already to any existing CPC serial interface that does MIDI baud rate.




VintageAdvantage

#17
Quote from: PulkoMandy on 17:32, 13 November 20If you use standard MIDI baudrate of 31520 baud you may be limited in how fast you can push the data to the device (it depends if your serial interface has a buffer to make up for it). With a parallel interface there is no such limitation, you can just send the datas as fast as the z80 is able to. I think it is also a little easier to program this way.

Yes, but Standard MIDI should be fast enough for anything MIDI ... I am only commenting on the MIDI aspect. Are you also sending audio / MP3 / OGG samples as well?  So I doubt that you need anything faster than standard MIDI. (That's not a mass storage device, is it?)

Wrt 5V power supply, you should be able to power USIfAC + soundboard from the CPC 5V.
Quote
It is also a lot more compact, no extra wires and interfaces with separate power supplies on my desk. Everythink seats neatly on the MotherX4 board.
I doubt that this is the case - parallel interface is kind of bulky... serial only require 1 wire / line ;-)

So if you want the SAM2695, then the
https://www.serdashop.com/waveblaster
would do + USIfAC one TX -> RX wire + 5V... I don't think you can get more minimal than that.

The SAM2695 is the better choice, but for cheap CPC GM MIDI only, the VS1053 + USIfAC is also a good choice, I only wanted to mention it for folks that don't want to wait ;-)

I do think that your project is interesting though (see my like above), don't get me wrong! I only wanted to point out some other options as well. And I would have chosen other "components", but it's your project, not mine :-)

PulkoMandy

Quote from: VintageAdvantage on 17:40, 13 November 20
Yes, but Standard MIDI should be fast enough for anything MIDI ... I am only commenting on the MIDI aspect. Are you also sending audio / MP3 / OGG samples as well?  So I doubt that you need anything faster than standard MIDI. (That's not a mass storage device, is it?)


It depends what you want to do. If the goal is just to play MIDI files and do nothing else, yes, fine. If the goal is, for example, to use this in a game, you want the sound player code to be quite fast and able to send a complete MIDI frame in a time as short as possible when it is called. And in a complex MIDI file there can be a few dozen bytes to send in some frames, at 3 bytes per note without having any program changes or other special effects it goes up quite fast.


So it depends on the buffers available in the usifac, can it store all these bytes so that the Z80 can continue and do something else? Or will the Z80 be desperately waiting for space in the serial port buffer?


Also I'm reading the USIFAC forum thread and I see that it puts the CPC into wait while doing things. So, OUT instructions to send data there will already take more time than usual. This interface doesn't, so your Z80 keeps running at full speed while you use it.

VintageAdvantage

#19
Quote from: PulkoMandy on 18:58, 13 November 20

It depends what you want to do. If the goal is just to play MIDI files and do nothing else, yes, fine. If the goal is, for example, to use this in a game, you want the sound player code to be quite fast and able to send a complete MIDI frame in a time as short as possible when it is called. And in a complex MIDI file there can be a few dozen bytes to send in some frames, at 3 bytes per note without having any program changes or other special effects it goes up quite fast.


So it depends on the buffers available in the usifac, can it store all these bytes so that the Z80 can continue and do something else? Or will the Z80 be desperately waiting for space in the serial port buffer?


Also I'm reading the USIFAC forum thread and I see that it puts the CPC into wait while doing things. So, OUT instructions to send data there will already take more time than usual. This interface doesn't, so your Z80 keeps running at full speed while you use it.
MIDI doesn't require that much bandwith... the MIDI standard and baud rate was established in 1983. It is and was fast enough for MIDI note data, otherwise we would have seen a successor much sooner ;-)

I mean, we had all this before - remember Doom and GM adapters? In 1994, I had a Yamaha TG 33 GM MIDI Module connected to my PC via SoundBlaster MIDI Out.   YOu can play whole polyphonic 64 channel symphonies with that standard MIDI bandwidth.

Not my video, but this is how it sounded for MIDI Doom PC in 1993 ;-)


https://youtu.be/tT_dUpSYwZU

I doubt that CPC games will need something better. This is what you can and could do with standard GM MIDI.

I think its great if the CPC adopts GM for MIDI . Like the PCs did in the 90s.

And if you don't like USIfAC for waitstates, then use Speak&SID or LambdaSpeak 3 that doesn't need waitstates for serial... it doesn't really matter which of the dozend CPC serial interface cards you are using as long as they are doing 31250 bps.

Here is an example: MIDI IN via LambdaSpeak 3 from the Microkorg keyboard (no sound from there, only for MIDI input), then sound from the CPC via AY-3-8912, and then also MIDI OUT of the MIDI IN notes (= MIDI THROUGH) via LambdaSpeak 3 to the Yamaha QY100 sound module. So this is MIDI OUT to a GM module via LambdaSpeak 3. Of course MIDI OUT could also be programmed (even from BASIC) to play the Yamaha QY100. In fact, the MIDI IN -> MIDI OUT is performed by the CPC MC program, not by the hardware.


https://youtu.be/6QqvawZSxjA

I must say, given the availability of these old "90s GM expanders" (for 50 $ on Ebay), I would probably just get one of these instead of a modern "mini MIDI GM breakout card". But then you need proper MIDI DIN.

VintageAdvantage

And, btw, the BAUD rate of the SAM2695 is 31250 BPS TTL MIDI max anyhow, so you can't go faster than this no matter if you are using a serial or parallel interface to the CPC.

PulkoMandy

I am not using the serial mode but the parallel mode of the SAM. That's the point, there is no baudrate involved here. I can send bytes as fast as I want with OUT instructions and don't need to wait between each byte to make sure I don't overflow a slow serial link.


It's not a matter of the number of bytes you can send, but of sending them quite fast in a single burst, and then use the remaining CPU time to do other things. Yes, it will not allow me to play better music, in most cases. It will allow me to play the same music, using less CPU time so I can do something else at the same time.

VintageAdvantage

#22
Quote from: PulkoMandy on 19:46, 13 November 20I am not using the serial mode but the parallel mode of the SAM. That's the point, there is no baudrate involved here. I can send bytes as fast as I want with OUT instructions and don't need to wait between each byte to make sure I don't overflow a slow serial link.

So you are saying that you need to send MIDI message with more than 31250 BPS ~ 3.8 KB/second because standard MIDI is not fast enough for your applications... hmm... Curious to see games taking advantage of that. Need a big memory expansion then for that "HighDef" sound.

Sorry, I don't buy that argument. The CPC interface to the serial card is also parallel. Buffer overflow (in the serial card) shouldn't even happen with standard MIDI...

Skunkfish

Does WILLY stand for anything?
An expanding array of hardware available at www.cpcstore.co.uk (and issue 4 of CPC Fanzine!)

VintageAdvantage

After all, it doesn't really matter if parallel or serial... I was just curious about the rationale.
Fine.

If you can get software devlopers lined up to support the product, I will buy one for sure! I'd love to have a GM MIDI sound module for the CPC :)

Powered by SMFPacks Menu Editor Mod