Duggle

How to Offset and Scale an Analog Input

50 posts in this topic

I tried it and it works well. perfectly.

Share this post


Link to post
Share on other sites

You need to route the MIDIbox KB  to midi-ox then (via midi yoke) to your host. 

Then you will be able to see (in midi-ox) what the host is receiving (that it cannot handle).

Share this post


Link to post
Share on other sites

is already installed on my computer midi ox. but I do not know how to use it.

Share this post


Link to post
Share on other sites

I built Ainser 20pot for midio128 v3 for my varranger and always nervous, very sensitive.

post-11336-0-15366500-1366921741_thumb.j

Share this post


Link to post
Share on other sites

Hello DUGGLE! I connected MIDIBOX KB, via MIDI-OX. What should I see abnormal?

thank!

Share this post


Link to post
Share on other sites

Use the "midi socket" looking icon to bring up a dialog to route the midi. 

It is straight forward to create a "midi through" connection from one port to another. (Look at help or other resources if this is not clear- it is easy)

So you have KB connected to a midi in, and a yoke port as out.

Now bring up a monitor window to see the data flowing from in to out.

Start your host program and set it's midi-in to the yoke port.

Try the modwheel from the keyboard that works o.k then try KB all the time looking at the midi in, or out monitor (the midi in and out monitor should show exactly the same).

I'm guessing that there are extra midi events going to the host or maybe the same controller events going at a much faster rate that is screwing up your host.

BTW; what is your host program?

Share this post


Link to post
Share on other sites

my host is Varranger www.varranger.com

I tried with midi-ox, it all seems ok inputs and outputs. do not know anymore what to do.
as you say and too fast for my varranger.

thank you!

Edited by folly

Share this post


Link to post
Share on other sites

hi Duggle

you are my hope for this project. I would not throw it all away. because I have spent time and money to build this project.
thank!

Share this post


Link to post
Share on other sites

Carefully state the experiments you perform with all relevant conditions. Then for each case, describe the results.

 

You need to quantify your results, words like "nervous" and even "very sensitive" are vague and not helpful. Also your posts and communications are way too "terse"!

 

(I know english is not your first language, it does not matter if you communicate faulty english, you need to explain yourself more fully (e.g use more words, carefully explain yourself), otherwise you will simply appear lazy, and this does not inspire others to help you.)

 

Do an experiment by moving the modwheel from max to min over 1 second, then count the events generated (look at the timestamps in MIOS Studio beside each event) then compare (i.e repeat the experiment with the "good" master keyboard. Determine (ie measure) what the differences are.       

Do the same experiment with midi-ox monitoring the values being sent from both keyboards to vArranger. There will be a difference. Tell us precisely what you discover.

 

Once you have replicated the "faulty" result  (i.e. vArranger loses sync) and understand why this is happening (e.g event rate too high; midi buffer overflow) and can replicate the problem from a device or source other than MIDIbox  KB. Then you can head over to vArranger Forum and report what you have discovered with some authority. Because you've quantified the conditions, the vArranger authors will be able to replicate the problem and fix the software.

Share this post


Link to post
Share on other sites

If the timestamps are in miliseconds, then you performed the sweeps, about over the the same time period  (300 to 400ms), right?

Then the MIDIbox KB is outputing much higher resolution (normally this is considered a good thing!).

Can you see that the KB is outputing events at a rate of nearly 10X that of the Korg. I don't see a problem with KB as such.

 

Have you tried other hosts? (there are plenty of free one's out there)

I suspect vArranger could do with some improvement. You should post to their forum, or otherwise contact the developers.

 

If you find that you discover similar (or rather equivalent)  problems on other hosts, then maybe put in a feature request with TK for some kind of  "data thinning" option. It's likely he wont do it for KB but he might for the Keyboard option of MIDIbox NG which uses the same hardware plus an sdcard.

Share this post


Link to post
Share on other sites

Hi Doggle!

Today I tried a pitch bender Doepher. even with this my Varranger works well.
I realized that my varranger can not handle so many midi events in such a short time. I will talk with the manufacturer of varranger of this problem so let's see what will tell.
I have not had the opportunity to try a different hosts. Today I will try with one-man band.
Thanks Doggle.Doggle Thanks for your availability.

Share this post


Link to post
Share on other sites

Hi Folly,

I can see where the MidiBox unit is trying to be very efficient and output as many events as it can for a finer granularity between CC events.  But when this is done every 1-2ms, it can overwhelm the standard Midi interface.  On a Theatre organ that has been retrofitted with Midi, the swell pedal is used to control the volume of the organ and this behavior shown in the  "Midibox kb ... txt" file would certainly be an issue.  I have heard of people having issues with delays of half a second while playing keys on the keyboard while trying to express a few playing notes by pumping the swell pedal.  The best way to fix this problem is to add software that only outputs the changes every 15ms.  Skipping CC values isn't always a bad thing. 

Share this post


Link to post
Share on other sites

Hi kpete.

Then we must pray to the creator of midibox kb that solves this problem if possible.

Share this post


Link to post
Share on other sites

Have you written to vArranger forum or Support yet?

Share this post


Link to post
Share on other sites

 Hello Duggle!

I have not written to varranger because I tried it with another host (LIVESTYLER).
even with this we have the problem. 

Please TK to do some modification of software MIIDIBOX KB?

Share this post


Link to post
Share on other sites

You might try changing the code yourself.  Here is something that might work for your case.  I haven't tested it out on the real hardware.  It might not be up to standards per TK but you never know.

 

u32    appLastAinValue[66] = {      /* -1 indicates value is sent */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,  
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,  
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,  
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,  
-1, -1 };
 
void APP_AIN_NotifyChange(u32 pin, u32 pin_value)
{
  // -> keyboard
  if(pin >= 66)
    KEYBOARD_AIN_NotifyChange(pin, pin_value);
  else
     appLastAinValue[pin] = pin_value;     // store value to be outputed later.

#if 0
  MIOS32_MIDI_SendCC(DEFAULT, Chn1, 0x10 + pin, pin_value >> 5);
#endif
}

//////////////////////////////////////////////////////////////////////////////
// This task is called periodically each mS to check for keyboard MIDI events
/////////////////////////////////////////////////////////////////////////////
static void TASK_Period_1mS(void *pvParameters)
{
  portTickType xLastExecutionTime;
  u8	i;
  u32	AinTimer = 0;

  // Initialise the xLastExecutionTime variable on task entry
  xLastExecutionTime = xTaskGetTickCount();

  while( 1 ) {
    vTaskDelayUntil(&xLastExecutionTime, 1 / portTICK_RATE_MS);

    // skip delay gap if we had to wait for more than 5 ticks to avoid
    // unnecessary repeats until xLastExecutionTime reached xTaskGetTickCount() again
    portTickType xCurrentTickCount = xTaskGetTickCount();
    if( xLastExecutionTime < (xCurrentTickCount-5) )
      xLastExecutionTime = xCurrentTickCount;

    // -> keyboard handler
    KEYBOARD_Periodic_1mS();
	
    if(AinTimer++ > 16)        // check if its been at least 16ms since last change.
    {
        for(i=0; i<66; i++)
        {
            if(appLastAinValue[i] == -1)    // if value has been sent
                continue;
        
            KEYBOARD_AIN_NotifyChange(i, appLastAinValue[i]);    // output last saved value
            appLastAinValue[i] = -1;        // Set -1 indicating value sent.
            AinTimer = 0;                    // reset timer so we won't do it again for 16ms.
        }
    }

    // MIDI In/Out monitor
    // TODO: call from low-prio task
    MIDI_PORT_Period1mS();
  }
}

Edit:Folly tried this and it didn't work because I had used u8 rather than u32 to save the values.  I changed the above software shown above to reflect the change and he indicated it solved his problem.

Edited by kpete

Share this post


Link to post
Share on other sites
 

I have not written to varranger because I tried it with another host (LIVESTYLER).

even with this we have the problem. 

Please TK to do some modification of software MIIDIBOX KB?

Folly, you at least have to take the time to write to the vArranger user forum (if no one reports it, how can it be fixed?) 

Such poor handling of MIDI streams by hosts is not universal (nor standard)! 

 

Based on previous posts TK is v.unlikely to add features to KB.

The ongoing development is taking place with MIDIbox NG which supports keyboards and much more. 

 

I think what you want would be referred to as " an option of data thinning on controller MIDI output"

Or try kpete's modification above, of course.

Share this post


Link to post
Share on other sites

hello kpete!

thanks for your help. I am not able to compile because I have never been able to download the source files. and do not even know which software is compiled. I'm not a programmer.

thank!

Share this post


Link to post
Share on other sites
 

Based on previous posts TK is v.unlikely to add features to KB.

The ongoing development is taking place with MIDIbox NG which supports keyboards and much more. 

 

I think what you want would be referred to as " an option of data thinning on controller MIDI output"

Or try kpete's modification above, of course

 

 Hello Duggle! I did not write in forums vArranger because as I wrote above I tried u other hosts (livestyler). the problem is the same as vArranger. What do I do? I write to all of them? do you think you bring them to change their software for me?

 

 
Edited by folly

Share this post


Link to post
Share on other sites

Ok, since some other minor changes were requested anyhow, please try V1.011

 

The bandwidth can be configured with the ain_bandwidth_ms parameter, e.g.:

 

 

set kb 1 ain_bandwidth_ms 20

 

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

Thank you Thorsten,

I am sure folly will be happy.  I sent in a change to him, and after the 2nd .hex file he is happy.  I will make sure that he uses your official change rather than my temporary patch.

Pete

Share this post


Link to post
Share on other sites

Thanks for helping Folly anyhow! :smile:

 

The "official change" works with timestamps instead of a counter to reduce the bandwidth.

This has the advantage, that the first value change will be sent immediately, and subsequent changes with the given delay.

 

Best Regards, Thorsten.

Share this post


Link to post
Share on other sites

I thank you all in two, and also Duggle, because the problems I found with him. Now I'm happy.

Thank you so much

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