REW Beta Release REW API beta releases

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
Looks like three problems to me:
  1. You are going through the list in numeric order, but each time a measurement is deleted the list gets shorter so you may end up trying to delete indices that are no longer where they were or no longer present at all
  2. 10ms is quite a short timeout for a measurement deletion to complete, so you are probably sending deletion requests before the previous request has completed. I'll make the API reject requests while one is already in progress.
  3. You don't appear to be looking at the API responses. If the response isn't a 200 (OK) you need to decide what to do about it. Some API commands return a 202 (Accepted), meaning what you have asked for is being worked on and you either need to wait for it to complete or register a webhook url to be notified when it has completed. If a 400 (Bad request) is returned you need to look at the message to understand why the API isn't happy with what you asked it to do. The measurements service will return a 404 (Not found) if you try and do something with a measurement index that doesn't exist, likely because you have already shortened the list by deletions so the index is now past the end.
 

serko70

Member
Joined
Oct 13, 2017
Messages
239
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Looks like three problems to me:
  1. You are going through the list in numeric order, but each time a measurement is deleted the list gets shorter so you may end up trying to delete indices that are no longer where they were or no longer present at all
  2. 10ms is quite a short timeout for a measurement deletion to complete, so you are probably sending deletion requests before the previous request has completed. I'll make the API reject requests while one is already in progress.
  3. You don't appear to be looking at the API responses. If the response isn't a 200 (OK) you need to decide what to do about it. Some API commands return a 202 (Accepted), meaning what you have asked for is being worked on and you either need to wait for it to complete or register a webhook url to be notified when it has completed. If a 400 (Bad request) is returned you need to look at the message to understand why the API isn't happy with what you asked it to do. The measurements service will return a 404 (Not found) if you try and do something with a measurement index that doesn't exist, likely because you have already shortened the list by deletions so the index is now past the end.
I fixed the code now reversing the loop and adjusting delays but still it works fine when SPL & Phase window is open in REW but fails when All SPL or Overlays window is open. So checking properly for response codes is a must. Automatic rejection will be great though. Also, I can't find a workaround for passing a file path from Explorer to the API due to browser security settings and importing measurements will have to stay manual. Well, so much with my limited programming skills but thanks a million for this fab work, it really opens up infinite possibilities.
 
Last edited:

serko70

Member
Joined
Oct 13, 2017
Messages
239
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Is "Calculate target level from response" API command planned?
 

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
1708117519203.png



1708117452527.png
 

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
I fixed the code now reversing the loop and adjusting delays but still it works fine when SPL & Phase window is open in REW but fails when All SPL or Overlays window is open. So checking properly for response codes is a must. Automatic rejection will be great though. Also, I can't find a workaround for passing a file path from Explorer to the API due to browser security settings and importing measurements will have to stay manual. Well, so much with my limited programming skills but thanks a million for this fab work, it really opens up infinite possibilities.
You should probably consider using something like Python for accessing the API, through the Python requests package.
 

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
Builds updated today (beta 12) with these changes:
  • Added: All SPL graph actions has an IACC button to calculate Inter-Aural Cross Correlation coefficients
  • Changed: Clarity calculation uses zero phase filters
  • Changed: When importing multi-channel impulse response WAV files preserve their relative alignment even if the import mode is "For imports set t=0 at impulse peak"
  • Changed: Allow clock corrections up to 1500 ppm to be applied, with a warning
  • Changed: When plotting harmonics at the harmonic frequency make sure the start of each harmonic trace reflects the data start scaled by the harmonic order
  • Changed: Measurements API will reject delete requests while a deletion is in progress
  • Fixed: API documentation errors for /measurements/{id}/target-settings, target-level and room-curve-settings
  • Fixed: Image capture options were missing "Include timestamp"
  • Fixed: Fade in for two tone and three tone signals did not work properly
 

serko70

Member
Joined
Oct 13, 2017
Messages
239
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
I received a Java exception as below with Beta 11 while "remove measurements loaded from". I had manually saved one of the loaded measurements before doing that which I am guessing might be the reason for the null point exception:



REW V5.40 Beta 11 running Azul Systems, Inc. JRE 1.8.0_402 64-bit on Windows 10 Locale: language en, keyboard GB, windows-1252 at 96 DPI Running in C:\Program Files\REW


Message:
java.lang.NullPointerException
Stack Trace:
roomeqwizard.$K.ɧ(y:1455)
roomeqwizard.$K.E(y:3579)
roomeqwizard.$K$14.actionPerformed(y:3558)
javax.swing.JComboBox.fireActionEvent(JComboBox.java:1260)
javax.swing.JComboBox.contentsChanged(JComboBox.java:1330)
javax.swing.JComboBox.intervalRemoved(JComboBox.java:1350)
javax.swing.AbstractListModel.fireIntervalRemoved(AbstractListModel.java:179)
javax.swing.DefaultComboBoxModel.removeAllElements(DefaultComboBoxModel.java:174)
javax.swing.JComboBox.removeAllItems(JComboBox.java:773)
roomeqwizard.mD.A(y:2313)
roomeqwizard.$K.contentsChanged(y:3057)
javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:118)
roomeqwizard.UD.B(y:2068)
roomeqwizard.OI.A(y:1890)
roomeqwizard.aE$2$1.actionPerformed(y:2574)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
javax.swing.AbstractButton.doClick(AbstractButton.java:376)
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:882)
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:926)
java.awt.Component.processMouseEvent(Component.java:6539)
javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
java.awt.Component.processEvent(Component.java:6304)
java.awt.Container.processEvent(Container.java:2239)
java.awt.Component.dispatchEventImpl(Component.java:4889)
java.awt.Container.dispatchEventImpl(Container.java:2297)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
java.awt.Container.dispatchEventImpl(Container.java:2283)
java.awt.Window.dispatchEventImpl(Window.java:2746)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
java.awt.EventQueue$4.run(EventQueue.java:733)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
 
Last edited by a moderator:

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
I received a Java exception as below with Beta 11 while "remove measurements loaded from". I had manually saved one of the loaded measurements before doing that which I am guessing might be the reason for the null point exception
No, it was because an inversion operation was selected in trace arithmetic and there was a missing check there, I have fixed it for the next build.
 

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
Any version, though there aren't many sources of multi-channel WAV files of impulse responses. It was prompted by having to import a file of binaural responses.
 

Cristianolo

New Member
Joined
Dec 14, 2018
Messages
33
Now with these Betas related to the API, can we suggest new tools here, or in another topic?
I confess I was lost
 

Cristianolo

New Member
Joined
Dec 14, 2018
Messages
33
Thanks :)

well, my request is to add a dotted black line representing the maximum "possible" sum, considering only SPL, disregarding the phase, so that we can compare what we are doing with the maximum sum that the system can eventually offer

something like this
Captura de tela 2024-02-21 170733.png



EDIT
and maybe add some shortcuts via right click on the measurement, such as flip phase, duplicate and SPL offset
and CTRL+left click to select more than one measurement and enable group movement between all measurements
 
Last edited:

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
my request is to add a dotted black line representing the maximum "possible" sum, considering only SPL, disregarding the phase
Sure, I'll do that for the next build.

maybe add some shortcuts via right click on the measurement, such as flip phase, duplicate and SPL offset
The actions panels already have controls to invert polarity, add SPL offset and make a response copy. There are also invert polarity check boxes on the alignment tool.

CTRL+left click to select more than one measurement and enable group movement between all measurements
You'll have to explain in more detail what you mean by that, particularly "enable group movement". Shift + left click can be used to select multiple traces in the graph legend.
 

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
Builds updated today (beta 13) with these changes:
  • Added: The /measurements/{id}/command endpoint now accepts an Add SPL offset command
  • Added: The /application API has a command to clear any command in progress
  • Changed: The /measurements/ API command endpoints will reject posted commands if a command is already in progress
  • Changed: The /alignment-tool/command API endpoint will reject posted commands if a command is already in progress
  • Changed: The /input-levels/command API returns OK rather than Accepted
  • Changed: Added a dotted trace to the alignment tool showing a magnitude-only summation of the measurements
  • Changed: When the alignment tool is opened the All SPL selections change to show only the traces being aligned. Other traces may be selected in the graph legend if desired. The original trace selections are restored when the alignment tool is closed.
  • Changed: Better generator fade-in/out
  • Fixed: Possible NPE when removing measurements
 

serko70

Member
Joined
Oct 13, 2017
Messages
239
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Is there a specific API post for "Generate measurement from target shape" or does it need to be created for measurement# N with the below url?:



 
Last edited:

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
Builds updated today (beta 14) with these changes:
  • Added: The Preferences menu has an entry to load preferences from a file, which requires a restart
  • Added: The measurements/{id}/eq/command endpoint accepts "Generate target measurement"
  • Changed: Updated CEA-2010 distortion limits to align with ANSI/CTA-2010-B R-2020
  • Changed: Using "Generate minimum phase" on a measurement imported from a text file which included phase will generate an IR for the measurement using the original phase data
  • Changed: Improved RTA fundamental lobe tracking for noisy fundamentals when not using the AES17-2015 standard notch
  • Fixed: When FDW unit preference changes update the IR windows dialog FDW spinners and the IR accordingly
 

sm52

Member
Joined
Mar 14, 2019
Messages
892
John, good afternoon. I imported a wav file with music into the RTA window in RTA 1/48 mode. After analysis, REW saved the peaks as a measurement. But in thumbnails, the appearance of the graphs is similar to the Spectrum mode. Or is it seems to me?
 

John Mulcahy

REW Author
Thread Starter
Joined
Apr 3, 2017
Messages
7,326
It may look similar but if the measurement was saved in RTA mode it will be an RTA view.
 

sm52

Member
Joined
Mar 14, 2019
Messages
892
More about importing wav with music. I have calibrated the input. 127 dB before clip. After import, the average level was 113 dB. This is normally?
 

Cristianolo

New Member
Joined
Dec 14, 2018
Messages
33
You'll have to explain in more detail what you mean by that, particularly "enable group movement". Shift + left click can be used to select multiple traces in the graph legend.

CTRL or SHIFT + left button mouse in some measurements, drag and drop in another position
REW drag drop.png
 

serko70

Member
Joined
Oct 13, 2017
Messages
239
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
CTRL or SHIFT + left button mouse in some measurements, drag and drop in another position
View attachment 68740
A "move measurement to top" mouse right click option would also be quite useful. When you want to cross corr align some measurements to a measurement at the bottom, it can become dreadful to move a measurement all the way to the top even when "animate measurement list" is unticked in preferences especially if "All SPL" or Overlays windows are open.
 
Top Bottom