News:

SMF - Just Installed!

Main Menu

MIDI Thru

Started by phm78, March 23, 2014, 08:42:26 PM

Previous topic - Next topic

phm78

I understand Atmegatron can not operate midi thru?
Philippe from France. :)

paulsoulsby

Hi!
There's no hardware implementation of MIDI thru, but you could simulate it in code. 

Open the source code and go to the MIDI tab.  Scroll down to MIDI_Poll and add Serial.write(incomingByte);.
void MIDI_Poll(){
  byte incomingByte=0;   
  static byte notebyte=0;        //these are all static because there's a small chance that the subroutine is exited before the 2 bytes of MIDI needed for note_on are received.
  static byte velocitybyte=0;
  static byte statusbuffer=0;
  static boolean firstbyte;
  if (Serial.available() > 0) {                    //if there is something in the serial input buffer
    do {
      incomingByte = Serial.read();                // read the incoming byte:
      Serial.write(incomingByte);              //This will simulate MIDI thru out of the MIDI out port
      if (incomingByte>247) {                      // ****this is where MIDI clock stuff is done***


This may slow the synth down significantly though. I think it may be really bad / unusuable when MIDI clock is present.  I'll try and have a play with it over the next few days and see what the results are like.
Paul

phm78

Thank you Paul, it works fine.
Philippe from France. :)

Ben

Hello,

Somehow related to this thread.
I'm new to this board. I don't have the box yet but I'l interested in it mainly as an experimentation platform. I'm thinking of writing my own code.
I'm mainly interested in generative music an plan to use the atmegatron as a midi note generator/sequencer.
I haven't really tried processing yet (some "hello world" code but that's all) but can create midi code in perl and had a look in the fyrd-instruments MCP platform for this but C isn't my cup of tea.
Processing seems a better choice an the Atmegatron would offer me a ready made platform without all the arduino+midi/led/knob/blablabla Hw soldering. ;D
Is it possible? is there already the needed bit to send out midi notes?

Ben

paulsoulsby

Hi Ben,

I actually had a MIDI sequencer/processor idea for some Atmegatron software.  However I've already got so many other software versions lined up, it probably wouldn't happen until later in the year. 

If you wanted to give it a go, that would be great!  I could do an Arduino template, that removed all the audio generation and processing and would leave you with an empty shell to create your own software.  Let me know if that would be useful. 

If you're nervous about using the Arduino software, try Atmel Studio which now has excellent Arduino support. It's a lot more similar to Visual Studio and has lots of nice features like auto-complete. http://www.atmel.com/microsite/atmel_studio6/

Paul

P.S.  You are correct in thinking the MIDI In/Out can be customised to do pretty much whatever you want (as can all the controls).