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

Support for embedded WAV loop ranges #202

Closed
agittins opened this issue Apr 23, 2020 · 4 comments
Closed

Support for embedded WAV loop ranges #202

agittins opened this issue Apr 23, 2020 · 4 comments

Comments

@agittins
Copy link

TL/DR: sfizz doesn't seem to support loop ranges embedded in wav samples. They seem to work in linuxsampler. They are (heavily?) used in VirtualPlayingOrchestra.

A number (lots?) of instruments use loop markers that are embedded in the WAV file itself.

An example is the VPO French Horn, which uses Mattias Westlund's looped samples. The sfz file has no loop ranges defined in it, but when opened in linuxsampler, it loops the samples indefinitely and smoothly. Using the same sfz in sfizz (0.3.2) it loops the entire sample, which is... not as nice. :-)

As I understand it (and this is only based on this evening's googling!), samplers often use the "smpl" block in a wav file to define cue points for looping.

This seems to be the case with the french horn samples, here's what I get from running sndfile-info against them:

$ sndfile-info horns-sus-ff-e4-PB-loop.wav 
========================================
File : horns-sus-ff-e4-PB-loop.wav
Length : 647600
RIFF : 647592
WAVE
fmt  : 16
  Format        : 0x1 => WAVE_FORMAT_PCM
  Channels      : 2
  Sample Rate   : 44100
  Block Align   : 4
  Bit Width     : 16
  Bytes/sec     : 176400
data : 647488
smpl : 60
  Manufacturer : 0
  Product      : 0
  Period       : 22675 nsec
  Midi Note    : 60
  Pitch Fract. : 0
  SMPTE Format : 0
  SMPTE Offset : 00:00:00 00
  Loop Count   : 1
    Cue ID :  0  Type :  0  Start : 33625  End : 127592  Fraction :     0  Count :     0
  Sampler Data : 0
End

----------------------------------------
Sample Rate : 44100
Frames      : 161872
Channels    : 2
Format      : 0x00010002
Sections    : 1
Seekable    : TRUE
Duration    : 00:00:03.671
Signal Max  : 23198 (-3.00 dB)

Type seems to map directly to SFZv2's loop_type opcode.

The smpl chunk seems pretty well documented here: https://sites.google.com/site/musicgapi/technical-documents/wav-file-format#smpl and I guess since sndfile-info is able to read it there's probably some level of support for extracting this in libsndfile.

Happy to provide sample files etc, but I assume you've probably got VPO already :-)

@jpcima
Copy link
Collaborator

jpcima commented May 1, 2020

Hello, sfizz is supposed to support this feature already.
However, this seems to have been broken in the commit 037a2ce. (@paulfd)

It appears the sample end is taken instead of the loop end in all cases.

@jpcima
Copy link
Collaborator

jpcima commented May 2, 2020

It was fixed by the change adaaf4b in develop.

@agittins
Copy link
Author

agittins commented May 2, 2020

Just built it locally and it does seem to work now, great!

(I seem to have other issues with my locally built version but I'm sure they're unrelated and might be localised only to my system, will have a dig when I have time).

@paulfd
Copy link
Member

paulfd commented May 5, 2020

I've double checked that the loop points are correct, so I'm closing this issue for now !

Thanks for reporting!

@paulfd paulfd closed this as completed May 29, 2020
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