Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Midi notes issue #372

Closed
therealkitman opened this issue Sep 29, 2015 · 20 comments
Closed

Midi notes issue #372

therealkitman opened this issue Sep 29, 2015 · 20 comments

Comments

@therealkitman
Copy link

Hi all,

discovered Muse a few weeks ago and I like what I am playing with. However, I have discovered in version 2.2.1 a strange situation where Muse is 'playing' one to two semitones over the assigned midi note from my MOxygen25 keyboard.

If I set up a simple single sine wave in AMSynth and play the A4 key, x42-tuna and my Korg CA-20 tuner displays an A#4. The midi transpose value in the track is set to 0. See image .

a4

If I drop the transpose to -1 or -2 it never gets to exactly an A4 note at 440Hz. I have fiddled with several controls and I just can't get the midi notes and sounds to match.

If I repeat this experiment in another DAW the midi notes and sounds are perfect.

Also if I record from my keyboard in the pianoroll the recorded notes do not match what was played as the recordings are about 1 octave low.

Any idea what is wrong here?

Thanks,
Chris.

@danvd
Copy link
Member

danvd commented Sep 29, 2015

Hi Chris,

This is very interesting.
Can you try to compile and test with current git master?
All changes will be there.

Regards,
Andrew

@therealkitman
Copy link
Author

Hi Andrew,

I am not too clever with git but I downloaded the source file from http://sourceforge.net/projects/lmuse/files/muse-2.2/muse-2.2.1.tar.gz/download (dated 28/01/2015) last night and got it to compile and run. I built a new project from scratch and the symptom is still there.

Regards...

@spamatica
Copy link
Member

Hi guys,
After trying to set this up and not being able to reproduce it, it hit me this is very likely a resampling issue.
a note recorded at 48khz and played at 44.1khz is very nearly a half tone wrong, and vice versa.

And indeed. When I set up MusE with 48khz (I usually use 44.1khz for historical reasons) the amsynth gives the wrong note. I tried with MDA ePiano and it played the right note.
So either the amsynth only works correctly at 44khz or we are missing some initialization to this particular synth.
Therealkitman, were you using this synth when testing with other DAWs, and was jack configured with the same settings?

@therealkitman
Copy link
Author

Hi,

yes used only AMSynth to keep the tests consistent.

Do you want me to try Zynaddsubfx or Calf Monosynth as well at both 44.1
and 48kHz?

Regards....

On 30/09/15 16:32, spamatica wrote:

Hi guys,
After trying to set this up and not being able to reproduce it, it hit
me this is very likely a resampling issue.
a note recorded at 48khz and played at 44.1khz is very nearly a half
tone wrong, and vice versa.

And indeed. When I set up MusE with 48khz (I usually use 44.1khz for
historical reasons) the amsynth gives the wrong note. I tried with MDA
ePiano and it played the right note.
So either the amsynth only works correctly at 44khz or we are missing
some initialization to this particular synth.
Therealkitman, were you using this synth when testing with other DAWs?


Reply to this email directly or view it on GitHub
#372 (comment).

@spamatica
Copy link
Member

By all means, do check if the problem persists if you check with both 44.1 and 48khz.
Thanks!

@therealkitman
Copy link
Author

Well that was interesting - very interesting. At both 48 and 44.1 kHz the LV2 version of AMSynth has the issues I raised. But both Calf Monosynth and Zynaddsubfx perform as expected at both sampling rates.

But the standalone version of AMSynth run through Jack works fine (A4 is A4 and C4 is C4 etc). So the LV2 version 1.5.1 of AMSynth I built is the problem and obviously not an issue with Muse. What a way to get distracted :)

However, the pianoroll is still wrong and I think it is just a mislabelling issue. I think you have shifted the labels on the virtual keyboard by 1 octave because the record and played back notes are correct. See screenshot.

EDIT: I just loaded Ardour4 with the LV2 AMSynth and it produces the same errors - A4 is A#4!!!

Regards,
Chris.

a4_2

@danvd
Copy link
Member

danvd commented Sep 30, 2015

Hi @therealkitman,
Just found new amSynth release 1.6.0 here:
https://github.com/amsynth/amsynth/releases
Among other fixes there is a line:
fixes an issue with incorrect tuning depending on sample rate
It seems, that the problem is now solved (I hope).

Regards,
Andrew

@therealkitman
Copy link
Author

Thanks Andrew,

you beat me to it as I was going to report this to amsynth this morning.
But it looks like someone else had the same issues which they fixed.

I'll grab 1.6.0 today and retest and no doubt I'll close the issue.

Do you want me to start a separate issue for the pianoroll note labelling?

Regards,
Chris.

On 30/09/15 22:07, Andrew wrote:

Hi @therealkitman https://github.com/therealkitman,
Just found new amSynth release 1.6.0 here:
https://github.com/amsynth/amsynth/releases
Among other fixes there is a line:
fixes an issue with incorrect tuning depending on sample rate
It seems, that the problem is now solved (I hope).

Regards,
Andrew


Reply to this email directly or view it on GitHub
#372 (comment).

@therealkitman
Copy link
Author

Hi,

I compiled AMSynth 1.6.0 but the problem persists. I'll report this to the AMSynth folks and close this issue.

Thanks for your help.
Chris.

@danvd
Copy link
Member

danvd commented Oct 1, 2015

Hi @therealkitman,

Ok, I'll try to test this new version too.

@therealkitman
Copy link
Author

Ok @danvd.

BTW - does Muse use the env var LV2_PATH? My compiled synths end up in /usr/local/lib64/lv2/. I had to relocate them to /usr/lib64/lv2/ as Muse seems fixed to these paths. Can't see any reference in the manual.

Thanks again,
Chris.

@danvd
Copy link
Member

danvd commented Oct 1, 2015

Yes, is LV2_PATH is used if it was set. or else muse will use default path:
~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2

@therealkitman
Copy link
Author

Hm, something not right then on my system as I do have a LV2_PATH but Muse ignored it. Will check this again tonight.

Thanks.

@danvd
Copy link
Member

danvd commented Oct 1, 2015

Hi @therealkitman ,

Just downloaded amSynth source. Yes, the bug is in file amsynth_lv2.cpp. It always uses default 44100 Hz sampling rate and ignores sample rate provided by host.
I made patch for amsynth to fix this. Here is the link:
https://gist.github.com/danvd/b75ff1c6c983a7883dcd

Regards,
Andrew

@therealkitman
Copy link
Author

Andrew,

That is absolutely brilliant!!!! I'll give this a go (tomorrow) after I
learn how to do patches in this github thing :) Still a noob with git
and svn.

So how will the guys who wrote amsynth know about this or do you/I have
to let them know about your patch?

Thanks very much,
Chris.

On 01/10/15 15:32, Andrew wrote:

Hi @therealkitman https://github.com/therealkitman ,

Just downloaded amSynth source. Yes, the bug is in file
amsynth_lv2.cpp. It always uses default 44100 Hz sampling rate and
ignores sample rate provided by host.
I made patch for amsynth to fix this. Here is the link:
https://gist.github.com/danvd/b75ff1c6c983a7883dcd

Regards,
Andrew


Reply to this email directly or view it on GitHub
#372 (comment).

@danvd
Copy link
Member

danvd commented Oct 1, 2015

Hi @therealkitman ,
In this link you'll find simple text file (Tap 'Raw' button and then save it somewhere).
Then go to amsynth-1.6.0 folder and type:

patch -p1 < /path/to/saved/amsynth_lv2_samplerate.patch

Then recompile and reinstall :)

If everything will go right in your case, I'll create pull request in amSynth project.

Regards,
Andrew

@therealkitman
Copy link
Author

That easy? Great! I'll do this tonight instead of tomorrow when I'm back
at my desk.

On 01/10/15 15:51, Andrew wrote:

Hi @therealkitman https://github.com/therealkitman ,
In this link you'll find simple text file (Tap 'Raw' button and then
save it somewhere).
Then go to amsynth-1.6.0 folder and type:

patch -p1 < /path/to/saved/amsynth_lv2_samplerate.patch

Then recompile and reinstall :)

If everything will go right in your case, I'll create pull request in
amSynth project.

Regards,
Andrew


Reply to this email directly or view it on GitHub
#372 (comment).

@therealkitman
Copy link
Author

Hm, something went wrong.


chris@linux-4qye:~/Downloads/amsynth-1.6.0> patch -p1 < /home/chris/Downloads/amsynth-1.6.0/patch/amsynth_lv2_samplerate.patch
patching file src/amsynth_lv2.cpp
Hunk #2 FAILED at 75.
1 out of 2 hunks FAILED -- saving rejects to file src/amsynth_lv2.cpp.rej


@danvd
Copy link
Member

danvd commented Oct 1, 2015

Hmm, that's strange. May be gist replaced tabs with spaces..
Anyway, here I uploaded the whole modified file amsynth_lv2.cpp:
https://gist.github.com/danvd/60ded6171e91fe91f51d

Just download and replace previous in src folder. I tested - it compiles cleanly.

Regards,
Andrew

@therealkitman
Copy link
Author

Hi Andrew,

Bingo!!! With this new cpp file amsynth now plays pitch perfect as both a 44.1 and 48kHz Muse project!!!! Should I delete my issue number 7 with amsynth people if you'll do that pull request?

However, I did find one cosmetic issue if I click the synth's presets option in Muse - instead of a neat drop list of presets my screen goes full screen. See pic below. Other synth's presets drop list are ok.

But regardless of that, I'll say thank you very much for getting the sound right in amsynth. Now I can try other noises in Muse :)

Thanks,
Chris.

amsynth_presets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants