Lee O'D

NoteOff Issues

Recommended Posts

Received my retrocade synth and papillio pro yesterday - very pleased. Quality of the PCB manufacture is excellent (plus the layout is great - well done!) :-)

 

Maybe I just didn't read the spec carefully enough, but I was expecting 2 x jack outputs (ie one stereo channel) so it was only after wondering why the jacks were stereo (initially I thought perhaps a contact switching dual mono/single stereo jack arrangement) and then after looking at the schematic that I realised that there's two sets of stereo outs! Well done on going above and beyond on the design!!

 

I think i've found an issue with the MIDI input handling (should be an easy fix in the sketch/c libs) - I only had a few minutes last night, will check further but if there's a note-off close to a note-on sometimes it stops sounding on that channel. My keyboard also squrts out active sensing data so perhaps that's an issue - I'll try a different one to check in the next couple of days and also take a look through the code.

 

Many thanks!

 

Lee

Share this post


Link to post
Share on other sites

Lee,

 

I have some issues with the MIDI input handling, resulting in what sounds like CC messages being dropped.  Can you share your findings?

Thanks,

Hans

Share this post


Link to post
Share on other sites

Turns out that the issue is quite simple.. The MIDI note off handler turns off any active notes on each channel regardless of which actual note has turned off!

 

I modified the sketch slightly to enable debug printing and also to print the note numbers for note off... Here's an example of the issue:

 

 

Note Received: 55
Channel Received: 1
In NoteOff: 58
In NoteOff: 55
 
So what should happen is note 55 sounds, it ignores the noteoff for note 58 (as it's a mono channel and should only care about the last note on), and then turn note 55 off.
 
As it currently doesn't care about the note value for the note off, it turns off note 55 at the first note off (58) which leaves you with nothing sounding on the channel.
 
To fix, we need to store the last note on pitch for each channel, and only turn off if the note off matches otherwise ignore..
 
I'm not set up on git etc... but adding this to the sketch fixes the problem:
 
add global variable array somewhere after the includes:
 
byte lastpitch[8];
 
 
change the noteon handler to add the last line here:
 
void HandleNoteOn(byte channel, byte pitch, byte velocity) {
  #ifdef DEBUG
    Serial.print("Note Received: ");
    Serial.println(pitch);
    Serial.print("Channel Received: ");
    Serial.println(channel);
  #endif     
  lastpitch[channel-1]=pitch;
 
 
and change the noteoff handler as follows:
 
void HandleNoteOff(byte channel, byte pitch, byte velocity) {
  #ifdef DEBUG
    Serial.print("In NoteOff: ");
    Serial.println(pitch);
  #endif   
  byte activeChannel = retrocade.getActiveChannel();
  if ( activeChannel != 0 )
    channel = activeChannel;  
  if (lastpitch[channel-1]!=pitch) { return; }
 
 
All plays so much more smoothly and none of the stuttering as the noteoffs turn off anything! :-)
 
 
 

Share this post


Link to post
Share on other sites

Excellent, Hans was kind enough to send me an Ableton track that was not playing correctly and I just sat down to start troubleshooting it. I saw that Lee posted that he was having similar issues and it took me 30 mins or so to figure out how to get Ableton outputting MIDI data. I finally got it working and was just wading through the debugging messages when I refreshed the forum to see if there were any new posts. Voila! There was a solution to the same problem I was troubleshooting! Thank you a bunch, I updated the sketch with your changes and played Hans track, it sounds much better now! There is still a problem with the mod Hihat and Kick playing on track 7 but when I disable track 7 everything sounds like I think it should.

 

I'm going to start working on adding the changes to github and releasing a new bit file. Tomorrow I can probably start working on the kick/hihat problem, I'm sure it just needs to be handled better. Right now the mod file is loaded from SPI Flash or SD card every time you play it, that was working fine with simple things, but when you start playing all channels and processing CC's it slows down too much. I think it will be better if it is loaded into SDRAM once and just triggered to play from SDRAM.

 

Jack.

Share this post


Link to post
Share on other sites

Ok, I just uploaded a new RetroCade bit file that includes Lee's fix:

http://forum.gadgetfactory.net/index.php?/files/file/30-retrocade-synth-bit-file-papilio-pro-lx9/

 

1/9/2013        Version 1.02
        -NoteOff fix from Lee O'D

 

Please be sure to load this bit file to SPI Flash using the Papilio Loader.

 

Thanks,
Jack.

Share this post


Link to post
Share on other sites

Oh, One final note...

 

Hans, I just noticed that the Ableton track you sent me has a couple glitches in it if you leave the RetroCade on the main LCD screen that has the Alien Jellyfish crawling across it. If you move the joystick to the right and select a static LCD screen the glitches go away. Going to have to think about pausing the Jellyfish if there is a song playing... It uses up processing power and I think it is causing CC's to be missed, I suppose we could increase the UART buffer size too...

 

One other thing this brings up, it would be nice to have a CC that resets all settings that could be called at the beginning of a song. Right now when there is a glitch I have to power cycle the board, would be better to have a reset to bring everything back to defaults.

 

Jack.

Share this post


Link to post
Share on other sites

Thanks, Jack!  In fact, with the new firmware and the MOD player disabled, the sound is predictable and clean - now the weakness of my demo score is in full effect, with the glitches having made it somewhat bearable :)

 

If I understand correctly, the LCD and flash interface operate in programmed I/O mode, which would be a good explanation for the problems that these cause.  Going forward, one would probably either want a separate CPU (or special purpose hardware) for each timing critical task, or have a multi tasking kernel with interrupts that allows lengthy I/O to run in the background.  Any thoughts or plans regarding that?

 

Thanks again!  I hope I'll be able to myself up a proper Windows box soon so that I can join in the fun of hardware synthesis myself.  The Mac is just not a viable platform for RetroCade development, as it seems.

 

Cheers,

Hans

Share this post


Link to post
Share on other sites

Excellent, glad I could help - that's a fast release Jack! :-)

 

The only thing I'm not sure about is whether channel 7 (mod) should behave in this way, I'm assuming that this is meant to be polyphonic, right?

 

The fixes make sense on the SID and YM channels though as clearly they are mono...

 

On another note, I read somewhere (sorry still very much catching up on the environment) that POKEY is instantiated in the FPGA but not coded up yet. How can I determine how to access the registers here? I've had a quick nosey around the HDL files, but not yet fully worked out how everything is hanging together (I think it's been 12 years since I did any VHDL or Xilinx work)!

 

Thanks guys

 

Lee

Share this post


Link to post
Share on other sites
On another note, I read somewhere (sorry still very much catching up on the environment) that POKEY is instantiated in the FPGA but not coded up yet. How can I determine how to access the registers here? I've had a quick nosey around the HDL files, but not yet fully worked out how everything is hanging together (I think it's been 12 years since I did any VHDL or Xilinx work)!

 

Thanks guys

 

Lee

 

I put together a POKEY branch that you can play around with, the details are in a new post:

http://forum.gadgetfactory.net/index.php?/topic/1486-pokey-branch-to-play-around-with/

 

Jack.

Share this post


Link to post
Share on other sites

Ok, so finally got my board today after having to pay duties etc. And immediatly ran into a problem. Im using the board with my Akai MPC 1000 and there seems to be something fishy with noteoffs, they dont work at all when I play pads on MPC! Any idea why? My MPC controls all my other synths perfectly fine so I dont believe problem is in that end. But midi note-offs work fine from my computer thru usb-midi device and also work from Microkorg.. any idea what the problem could be? 

Share this post


Link to post
Share on other sites

Hmm when I try to control the mod drum channel (7), I can hear that MPC sends midi note when i hit the drum pad, and also when I release it. So this must cause the problem.. weird thing this definetly doesnt happen with my other synths, like Monotribe or Game Boy.

Share this post


Link to post
Share on other sites
Hello dkstr,

 

Can you load the latest 1.02 bit file it has a fix for the noteoff issue.

 

Thank you,

Jack.

Hi, my Retrocade seems to have 1.02 installed already, at least thats what it says on the screen on the section where it shows the version.

Share this post


Link to post
Share on other sites

Also, my problem seems to be kinda different from the thread starter, it lefts all the notes hanging with MPC so there might be something on the code. I rather have extra note offs than none of them ;)

Share this post


Link to post
Share on other sites

Ok, so probably the best thing to do is see exactly what the synth is sending to figure out what is happening here.

 

You can enable debugging so you can monitor the MIDI messages by doing the following:

  • Open the RetroCade Sketch
  • Find the following line:
//#define DEBUG
  • Change it to:
#define DEBUG

Load the Sketch to the Papilio board and then press the Serial Monitor icon after the sketch is loaded. You should see the MIDI messages that are being transmitted by your keyboard. This should clue us into what is happening.

 

Thanks,

Jack.

Share this post


Link to post
Share on other sites

Ok, will do this tomorrow when I get access to PC / Windows. I assume its not possible to do this with mac?

 

Also, it DOES work if I send midi from MPC -> Macbook -> Retrocade. Very strange since generally Akai MPC 1000 is very stable and reliable midi sequencer.

Thanks.

Share this post


Link to post
Share on other sites

Eh so Im at school trying to install the drivers, even with IT guys support to allow admin rights, I cant get Retrocade packet to install correctly. At the moment theres that arduino-zpuino-src folder on C: and then in Program Files theres Gadget Factory/RetroCade Synth/ but theres only uninstall and bunch of folders. Where can I find the sketch? Is there any any way to get this working on Mac? Getting super frustrated.

Share this post


Link to post
Share on other sites

Is this Windows 7 or Windows 8 you are dealing with?

 

There should be an entry in the start menu to "Edit RetroCade Synth Sketch". There is also a section in the User Guide to walk you through editing the sketch.

 

If you are looking for where the sketch is it is in your Documents folder under Arduino/RetroCade_Sketch. It had to be moved there because of Windows 8. Windows 8 will not allow files to be modified if they are placed in the Program Files folder which really sucks... For the sketch people are going to need to modify it so that meant it had to be moved to the Documents folder.

 

Alvie just recently got ZPUino working on the Mac, so there may be a chance that we could get this running on the Mac. But I do not have a Mac machine or any way to generate a Mac installer. I'm checking with Alvie now to see what the status is. The other option is to maybe run Parallels on the Mac instead of trying to find another machine?

 

Jack.

Share this post


Link to post
Share on other sites

Hmm, I'll test Parallels home, but at least installer crashed with Wine. Im sure the quite complicated security stuff at our school will mess up something, I can see Arduino folder in Documents, but its totally empty.

Share this post


Link to post
Share on other sites

Great

 

We are testing the Mac release right now, I expect it to be releasable by next week.

 

I'll post news once I have them.

Sounds great! I have a show / multimedia thingy coming up soonish and it would be awesome to use Retrocade in my setup, but dont want to drag laptop with me to stage.

Share this post


Link to post
Share on other sites

Ah, MrDisco, I'm sorry about missing that question! It got lost in the Mac question.

 

The Noteoff issue should be fixable for the P1 500K, but at this time I don't know if the patch has been brought into the latest 500K release. I will take a look.

 

Jack.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now