Author Topic: WILLY - Soundcard adapter (MIDI and OPL3)  (Read 4545 times)

0 Members and 2 Guests are viewing this topic.

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
WILLY - Soundcard adapter (MIDI and OPL3)
« on: 22:36, 12 November 20 »
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
« Last Edit: 22:27, 13 November 20 by PulkoMandy »

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #1 on: 22:58, 12 November 20 »
Attached a photo of the board in my setup

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.709
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1270
  • Likes Given: 2966
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #2 on: 23:15, 12 November 20 »
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: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline XeNoMoRPH

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.052
  • Country: es
  • " ... in space no one , can hear you scream ... "
    • https://auamstrad.es/
  • Liked: 2401
  • Likes Given: 1683
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #3 on: 09:12, 13 November 20 »
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

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #4 on: 09:22, 13 November 20 »
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)

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.971
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 3070
  • Likes Given: 1858
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #5 on: 09: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.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #6 on: 10:14, 13 November 20 »
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.
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
« Last Edit: 10:16, 13 November 20 by VintageAdvantage »

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #7 on: 10:30, 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.

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #8 on: 10:36, 13 November 20 »
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....
« Last Edit: 10:41, 13 November 20 by VintageAdvantage »

Offline XeNoMoRPH

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.052
  • Country: es
  • " ... in space no one , can hear you scream ... "
    • https://auamstrad.es/
  • Liked: 2401
  • Likes Given: 1683
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #9 on: 11:14, 13 November 20 »
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

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.971
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 3070
  • Likes Given: 1858
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #10 on: 11:17, 13 November 20 »
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.
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)

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.971
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 3070
  • Likes Given: 1858
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #11 on: 11:25, 13 November 20 »
I 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)

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #12 on: 11:32, 13 November 20 »
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?




Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.971
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 3070
  • Likes Given: 1858
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #13 on: 11:50, 13 November 20 »
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)

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #14 on: 18:18, 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). 
« Last Edit: 18:26, 13 November 20 by VintageAdvantage »

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #15 on: 18:32, 13 November 20 »
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.

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #16 on: 18:37, 13 November 20 »
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.




Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #17 on: 18:40, 13 November 20 »
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.

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 :-)
« Last Edit: 19:42, 13 November 20 by VintageAdvantage »

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #18 on: 19:58, 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.

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #19 on: 20:21, 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.
« Last Edit: 20:43, 13 November 20 by VintageAdvantage »

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #20 on: 20:38, 13 November 20 »
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.

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 448
  • Country: fr
  • Liked: 370
  • Likes Given: 6
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #21 on: 20:46, 13 November 20 »
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.

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #22 on: 20:53, 13 November 20 »
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.

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...
« Last Edit: 20:56, 13 November 20 by VintageAdvantage »

Offline Skunkfish

  • Supporter
  • 6128 Plus
  • *
  • Posts: 704
  • Country: gb
  • Editor of Colour Personal Computing
    • CPCSTORE.CO.UK - Dedicated to the Amstrad CPC
  • Liked: 522
  • Likes Given: 1394
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #23 on: 20:56, 13 November 20 »
Does WILLY stand for anything?
An expanding array of hardware available at www.cpcstore.co.uk (and issue 3 of CPC Fanzine!)

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: WILLY - Soundcard adapter (MIDI and OPL3)
« Reply #24 on: 21:09, 13 November 20 »
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 :)