Author Topic: MIDI Thru  (Read 5570 times)

phm78

  • Newbie
  • *
  • Posts: 3
    • View Profile
MIDI Thru
« on: March 23, 2014, 08:42:26 PM »
I understand Atmegatron can not operate midi thru?
Philippe from France. :)

paulsoulsby

  • Administrator
  • Full Member
  • *****
  • Posts: 228
    • View Profile
Re: MIDI Thru
« Reply #1 on: March 24, 2014, 10:28:13 AM »
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);.
Code: [Select]
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

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MIDI Thru
« Reply #2 on: March 24, 2014, 06:53:40 PM »
Thank you Paul, it works fine.
Philippe from France. :)

Ben

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: MIDI Thru
« Reply #3 on: May 09, 2014, 08:19:55 AM »
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

  • Administrator
  • Full Member
  • *****
  • Posts: 228
    • View Profile
Re: MIDI Thru
« Reply #4 on: May 10, 2014, 12:34:16 PM »
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).