Why does Panner node default to hard-right position on Chrome? - web-audio-api

I set the panner to:
panner.setPosition(0,0,0);
If I open it up in Firefox it does what you would expect - centers the input source and places it in the middle of the stereo field.
In Chrome it does not do this and the audible default output is panned hard-right.
Why? .... and is this a bug ?
I am on Linux Mint OS btw.

Related

Emacs Misaligned Line Numbers with display-line-numbers-mode

I just migrated from Linux to Mac. I'm using the setting display-line-numbers-type 'visual. On Linux, my line numbers were aligned fine, but on Mac they are misaligned as seen in
this picture (using the same config).
Note, the display-line-numbers-width setting doesn't fix this, increasing it just shifts the misalignment to the right.
The only other relevant configuration I'm using is global-display-line-numbers-mode.

(re)detect number of monitors connected when disconnecting monitor

When multiple monitors are connected to my computer, I can detect them, and draw figures to them by setting the position according to the values obtained from
get(0, 'MonitorPositions')
However, when I disconnect a monitor while MATLAB is running, this property is not updated. I use distFig to handle the positioning of the figures, but since this property is not updated, sometimes the figures are drawn at the pixel locations that lay outside my screen (i.e. drawing on my disconnected monitor).
Restarting MATLAB solves the issue, but is there a way to re-detect the number of monitors connected?
I think I found a solution using JAVA:
I got the JAVA code from here: How do I get number of available screens?
Getting number of
get(0, 'MonitorPositions') keeps showing the same value, and the JAVA result changes:
%// Get local graphics environment
%GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
env = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
%// Returns an array of all of the screen GraphicsDevice objects.
%GraphicsDevice[] devices = env.getScreenDevices();
devices = env.getScreenDevices();
%numberOfScreens = devices.length;
numberOfScreens = length(devices)
I tested the code in Windows 10 OS.
In monitor duplicate mode, result is one monitor, and in extended mode 2.
When I unplug a monitor, the result is 1.
When unplugging all monitors the result is also 1 (it's not a perfect solution).

MATLAB R2016b rendering trouble: line color with shades where it should not

In MATLAB R2016b I have trouble with rendering.
1) When hardware acceleration is enabled (default, or setting opengl hardware) I get:
=> when lines are close one to each other lines are darker and ligher when isolated. I want constant color.
2) When acceleration is done with software (opengl software) I get:
=> lines are always at same dark level (what I want)
Note: with the process of putting the images on the site, what I want to show is less clear but I hope still visible and understandable...
Question: is there a way to enable GPU acceleration (opengl hardware) while also having a consistent rendering of line color along the whole line?
When hardware acceleration is 'on' [1], the GraphicsSmoothing property of figures is 'on' by default, and the AlignVertexCenters property of lines if 'off' by default. This gives the result of Figure 1 in the question.
Switching AlignVertexCenters to 'on' solves the issue (the same as when turning off hardware acceleration, as stated) and gives the Figure 2.
Now, to set this permanently, add this into startup.m (the file launched by MATLAB at each startup if found in userpath)
set(0, 'DefaultLineAlignVertexCenters', 'on')
For more information of startup.m see https://mathworks.com/help/matlab/ref/startup.html
[1] this is the default if an up to date graphics card is installed, and can be checked typing opengl info and verifying that HardwareSupportLevel=='full' for example.

Matlab figure window is not showing up

I cannot open a figure window in freshly installed Matlab 2015b on a new PC. It draws correctly in taskbar small preview windows, but when I am trying to open the figure window - nothing happens. Also, saving a figure to PNG file works normally. This applies to figure windows that are empty or have something plotted (by plot, hist, etc.) except if something is drawn with imshow - in this case figure behaves normally (at least it looks so).
I tried set(gcf, 'Renderer', 'zbuffer') but nothing changed.
PC specs:
Windows 7 x64
Gigabyte GeForce GTX 980Ti G1 Gaming with version 355.98 Driver
Double Xeon CPUs

How to check current emacs window position relative to other windows

I am using S-<up> and S-<down> to run (enlarge-window) and (shrink-window), respectively.
I would like these keys to be sensitive to the position of the current window relative to others. If my frame is split horizontally into two windows, and the current window is the top one, then I would like S-<up> to run (shrink-window) instead of (enlarge-window).
How do I check the position of the current window relative to the others?
See the function (window-edges). It returns a list of the window's coordinates. Just compare the y-axis value with the other visible windows.
You can use (window-tree). It will return not only the size of windows, but also their position , as a tree (in emacs' internals the windows of a frame are kept into a tree strucutre).