MIDI and CPC

Started by TFM, 22:57, 26 February 14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LambdaMikel

Quote from: TotO on 12:21, 17 August 19
I'm pretty sure the CPC 6128 can already does some MIDI stuffs using the tape port (looks wired as a MIDI OUT) through the PPI and may be an external buffer with a IN/THRU/OUT adapter.


Interesting idea but impractical and infeasible. Midi comes in at 31250 bauds without buffer the CPC will not be able to do that in software. You could use the Joystck port or printr port which would have the same problems. Afaik nobodY did high speed serial interface purely in software on the CPC side. Serial cards exist for a reason ;-)

TotO

Quote from: LambdaMikel on 20:27, 17 August 19Interesting idea but impractical and infeasible. Midi comes in at 31250 bauds without buffer the CPC will not be able to do that in software. You could use the Joystck port or printr port which would have the same problems. Afaik nobodY did high speed serial interface purely in software on the CPC side. Serial cards exist for a reason ;-)
It is why I'm thinking about MIDI OUT (to a SC-55 in example) by default using the existing tape DIN. And an external buffer for a IN/TRU/OUT adapter. (31250 bauds is 4MHz/128)
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

LambdaMikel

#52
Midi out is more feasible yes. Definitely worth trying. Didn't know that the casette port can be used to program digital output I thought it was analog only.


But if you need extra hardware anyhow then You might rather do it right in the first place.


You would also need an opto isolator/ coupler.

Bryce

#53
For all you MIDI fans out there or anyone considering creating a new MIDI Hardware/Software, you may not have heard, but after just 36 years!!! The MIDI consortium have released a new MIDI 2.0 standard. Do we want to be the first retro scene to have MIDI 2.0 compatibility?
https://techreport.com/news/34433/after-36-years-midi-is-finally-moving-to-2-0/

Bryce.

LambdaMikel

Quote from: Bryce on 10:55, 18 August 19
For all you MIDI fans out there or anyone considering creating a new MIDI Hardware/Software, you may not have heard, but after just 36 years!!! The MIDI consortium have released a new MIDI 2.0 standard. Do we want to be the first retro scene to have MIDI 2.0 compatibility?
https://techreport.com/news/34433/after-36-years-midi-is-finally-moving-to-2-0/

Bryce.
Well, some things are pretty perfect for what they were intended for from the beginning - MIDI is such a case. Even now many people do NOT see a need for MIDI 2 - maybe the CPC will catch up in 36 years. Some of usmight still be around then - and CPCs will live forever  ;)

zhulien

#55
Quote from: LambdaMikel on 20:58, 18 July 19
Does the RAM Music Machine support MIDI in?
Can you play instruments on it via MIDI in?

It has in, through, out, microphone in and speaker out (as it has both ADC and DAC onboard).


Regarding playing instruments via MIDI in, i never tried.  This is my 2nd one actually and this one i don't have the software - i really only used it for the DAC.  In fact, I now have quite a buildup of midi stuff (midi controller / keyboard, piano with midi, msx computers, cpc with ram music machine, lamdaspeak not yet with midi) - of all i really didn't have too much interest until you played cpc with the keyboard, that was the coolest thing so far.  I know msx can do it, but so far I haven't heard anything good out of my msx's - well, really the sound quality is great, but none is my type of music.  I'd rather some of the cool cpc demo musics than things that sound like a general midi from an 80s PC.

LambdaMikel

Really, the ultimate MIDI interface should be made with USIFAC, as it is so much cheaper to produce than LS3. Somebody should try porting my MIDI IN code to USIFAC.



Bryce

The new MIDI standard requires both hardware and software changes.

Bryce.

LambdaMikel

#58
Quote from: Bryce on 21:07, 18 August 19
The new MIDI standard requires both hardware and software changes.

Bryce.
... and new MIDI controllers / synthesizers / ... everything? Seems it is too early to jump on the MIDI 2 train. I don't have any synths that would require it or understand it.

Seems they were desperately seeking for an application / problem to justify MIDI 2:

Quote
In changes more interesting to musicians, the MMA says it is targeting 32-bit precision for effects in MIDI 2.0. For non-musicians, it's difficult to imagine what the utility of such high precision could be, but music theorist and educator
Adam Neely notes that the changes could have great implications for artists working in new styles of music, like microtonal music. He further says that they could also help artists discover new ways of creating music. The new standard will also raise the number of instrument channels from 16 in classic MIDI to 256.

Not sure I am into microtonal music  :)
But hey, there has to be some progress after 36 years. It is great that MIDI lasted that long!!

ComSoft6128

#59
Hi LamdaMikel,

While looking for info on CPC graphics I found this article on the "Foundation Musical Spreadsheet" which may be of interest:

https://archive.org/details/AmstradComputerUser53-0489/page/n37

Cheers,

Peter

LambdaMikel

Quote from: ComSoft6128 on 16:03, 19 August 19
Hi LamdaMikel,

While looking for info on CPC graphics I found this article on the "Foundation Musical Spreadsheet" which may be of interest:

https://archive.org/details/AmstradComputerUser53-0489/page/n37

Cheers,

Peter
Interesting article, thanks for sharing!

Maybe I'll also work a bit in this direction. Would be nice to have a step and real time sequencer with MIDI IN that uses the CPC sound / built-in AY-3-8912 and maybe PlayCity and LambdaSpeak 3 for PCM / Drums.

A MIDI OUT sequencer on the CPC is pretty much useless these days I would claim; if you want to sequence / conntect to external synthesizers, then there is very capable PC and Mac software of course.

LambdaMikel

In the meantime, I have 3channel polyphony for the CPC MIDI IN Synthesizer:


https://youtu.be/QzyooJ6n_CE

Again, apologies for poor synth / keyboard playing, I usually play the Guitar  ;)

zhulien

Quote from: LambdaMikel on 18:45, 18 August 19
Really, the ultimate MIDI interface should be made with USIFAC, as it is so much cheaper to produce than LS3. Somebody should try porting my MIDI IN code to USIFAC.


I think that is not a bad idea, is it possible to make a programming examples for both, but with a focus on the USIFAC but with patches for LambdaSpeak?  I am thinking perhaps for any midi software, if people coded it with USIFAC being the focus, but ensuring compatability with the LambdaSpeak via a config file, then anyone who really wanted a cheap MIDI option would naturally go for USIFAC, but those who do happen to have LambdaSpeak and wanted that as a MIDI option, could just use that?  If we can get programming docs for some of the other CPC MIDI interfaces, then additional patches could be made - Music Machine etc.  It seems there are a few around, would be nice if software on CPC did allow plugin drivers - it's not that hard always.


http://www.cpcwiki.eu/index.php/MIDI


zhulien

Quote from: LambdaMikel on 10:22, 20 August 19
In the meantime, I have 3channel polyphony for the CPC MIDI IN Synthesizer:

Again, apologies for poor synth / keyboard playing, I usually play the Guitar  ;)


Now all you need is a recording facility to banked ram then a way to save them as MIDI files for game developers to make CPC midi music.

LambdaMikel

#64
Quote from: zhulien on 19:29, 20 August 19

I think that is not a bad idea, is it possible to make a programming examples for both, but with a focus on the USIFAC but with patches for LambdaSpeak?  I am thinking perhaps for any midi software, if people coded it with USIFAC being the focus, but ensuring compatability with the LambdaSpeak via a config file, then anyone who really wanted a cheap MIDI option would naturally go for USIFAC, but those who do happen to have LambdaSpeak and wanted that as a MIDI option, could just use that?  If we can get programming docs for some of the other CPC MIDI interfaces, then additional patches could be made - Music Machine etc.  It seems there are a few around, would be nice if software on CPC did allow plugin drivers - it's not that hard always.

http://www.cpcwiki.eu/index.php/MIDI

Great idea! The MAXAM sources for MIDISYN.BAS are online in the LS3 Github, LS300.DSK for anybody that wants to take a look.

For LS3, receiving MIDI IN is pretty simple:
- enable serial mode
- set baud rate to 31250, 8N1
- send 255, 10: this enters the so-called Serial Monitor mode, which is serial input only.
- do the byte processing

In this mode, the CPC constantly polls port &FBEE and checks if a serial byte has been buffered. If yes (1 is found), then receive the next byte from the serial / UART input ring buffer, via out &fbee,<arbitrary>: byte = inp(&fbee): out &fbee, <arbritray>. <Byte> is then a MIDI message byte. And this whole loop / process runs lightning fast, so that real time processing is possible (-> Z80 machine code).

The out's act as "handshake" and synchronization commands. LS3 only decodes one port, &fbee. I believe this is different in USIFAC. This one has 2 ports, one for checking if a byte is available in the buffer, and the other port for requesting / retrieving it. So it might be even easier with USIFAC, but I haven tried yet. It really depends on how fast and robust you can get the MIDI message bytes to the CPC, and dispatch and interpret them there.

Btw, wrt MIDI messages, the biggest surprise was the "Running Status" feature of MIDI. One has to understand that aspect of the protocol thoroughly first in order to get MIDI IN running. This aspect of the procotol isn't really discussed well in many of the MIDI tutorial online. I spend hours trying to figure out why LS3 was skipping / missing bytes from MIDI messages and figured it wasn't fast enough, before I finally realized that it was caused by that 'Running Status' feature of the protocol. I spent a lot of time hunting red herrings there... ::)

zhulien

what is your preferred way to create plugins?  with fixed entry points randomly everywhere, or a small jumpblock at the start? with a version number attached? and... keeping the plugin within a certain memory size?  (but perhaps big enough that if people ran out, they have enough room for bankswitching to put all new plugin in an additional bank)?


i have been thinking of whether a driver ROM type standard could be followed, either ROMbased or RAMbased - but with consistency - if ROMbased, someone could go to the website choose what drivers they want present in the ROM, and the ROM would download ready-built.  This does require relocation (which can be done at ROM build time before the download), or perhaps a 16kb RAM-based ROM?  with a system like AMSDOS that wasn't really designed with drivers in mind beyond BASIC RSXs, but it doesn't mean we can't start somewhere and expand upon it - then end up with an AMSDOS 2 one day.


an example driver...



            dw jumpblock_entry
            db 1 ;version, should only increment if future is no longer backward compatible
                ;and should be reflected in the jumpblock entries available
            db 0 ;minor version, just for tracking
            text 'Midi Interface Device',0 ; device name
            db 10 ; 10 = midi device, 0 = ram device, 1 = rom device, 2 = trackdisc device, 3 = mass storage, 4 = serial etc...


<anything in here>


jumpblock_entry: dw init_device
            dw open_device
            dw close_device
            dw blah_device


<anything in here>


init_device:
open_device:
close_device:
blah_device:


XeNoMoRPH

@LambdaMikel
Can you do the sequencer effect so ... from the external instrument keyboard is played from a midi file in the amstrad?
your amstrad news source in spanish language : https://auamstrad.es

LambdaMikel

Quote from: zhulien on 13:00, 21 August 19
what is your preferred way to create plugins?  with fixed entry points randomly everywhere, or a small jumpblock at the start? with a version number attached? and... keeping the plugin within a certain memory size?  (but perhaps big enough that if people ran out, they have enough room for bankswitching to put all new plugin in an additional bank)?


Good questions... have no answers yet. For now, I am just going to try my MIDI code with USIfAC... after that experiment I'll have a better idea.

LambdaMikel

#68
Quote from: XeNoMoRPH on 16:48, 21 August 19
@LambdaMikel
Can you do the sequencer effect so ... from the external instrument keyboard is played from a midi file in the amstrad?


MIDI out is definitely possible. Currently I only have a MIDI out BASIC demo program that playsrandom notes. It would be interesting to implement a MIDI file player for the CPC. The format is involved though. I guess I would rather work on a hybrid solution:
- converter: a Python program uses one of the MIDI file processing libraries there and creates a simple binary file for the CPC
- CPC MIDI player: the CPC MIDI player plays the (simplified) converted version

MIDI IN, record and playback should be easy as well, maybe with a simple track / pattern sequence in MC. It should also offer quantization of course.

LambdaMikel



LambdaMikel

Play your LS3 SP0256-AL2 with USIfAC MIDI IN


https://youtu.be/MVEXi7fGHyc

LambdaMikel

One with MIDI SOFT THROUGH (-> MIDI OUT) implemented in assembler:


https://youtu.be/6QqvawZSxjA


LambdaMikel

#73
Since this is the MIDI thread - a new inexpensive (55 €) MIDI interface for the CPC: CPC Speak&SID.
Demo of a SID + AY soundchip MIDI IN synthesizer - the MIDI messages received from the Speak&SID UART are translated into AY + SID sounds by the CPC, running a machine code program (MAXAM + Speak&SID sources available):


https://youtu.be/4esnHlCg138

GUNHED

http://futureos.de --> Get the revolutionary FutureOS (Update: 2022.03.09)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod