Okay, so this appears to be a simple issue with an appended newline in the LinkOSX file!
Switching from echo to printf in my post-install package script seems to have done the trick
Okay, so this appears to be a simple issue with an appended newline in the LinkOSX file!
Switching from echo to printf in my post-install package script seems to have done the trick
@Christoph-Hart I'm thinking that one of the best methods for approaching this feature would be to add it as a distinct playback option for the Sampler.
But before I start coding, I wanted to ask whether you would be open to this as an eventual pull request?
@d-healey Interesting, thanks!! That does look very useful for actually setting the offset onto the intended target.
However, my current issues start with the simple gathering of the information required to store the offset somewhere to be used later. So far I've tried using timer callbacks to increment values per note (startTimer in onVoiceStart, stopTimer in onVoiceEnd). I tried stashing the value inside of this.data.offset
inside the timer callback as well trying a parent scoped array (eg var posValues = []
).
At first I thought the Message.getTimestamp()
function might be useful but that consistently returns 0. I assume that's because I'm not in a host, but if that's the case I don't to base this off the timeline anyway.
EDIT: Running through Xcode I noticed that the timer related crashes are due to thread safety issues while modifying the array. I suspected that this might be the case, but I'm still stumped on how to get this value of "samples played between note on and note off".
I've hit a bit of a dead end. I'm trying to hack together a sample playback mode that uses a momentary switch to decide whether to 'continue' a sample from the previous last played position or not.
The idea is to have a sustain pedal that enables this mode. When the pedal is released, all of the offsets return to zero, but in the mean time each offset should increase by the number of samples that a note is held for.
I've tried writing a custom script voice start modulator but I'm getting crashes trying to start timer objects inside of the onVoiceStart callback (tried in stable and a recent build).
Any thoughts on the best way to approach this? Thanks in advance!
I've got a preliminary Install Plugin up and running for setting a custom installation path for the sample directory. It's embedded within a .pkg built with Packages and I have a rough idea for resolving the one current caveat, which is that installation proceeds first through the /tmp directory. The other major caveat is that this is a Mac OS-only solution.
I'll post the code and .bundle soon. Eventually: a recipe proposal.
@Lindon I'm actually shipping the .ch1 file in the package at the moment to avoid any user interaction requirement. It's hardcoded to the Application Support directory for the plugin at the moment but I will look into making it depend on a user selection.
I'm using the Packages freeware to build the macOS installer which provides me the ability to install the samples folder to /tmp and then create the expected Application Support structure with a post-install shell script (this script also creates the LinkOSX file). Packages does support creating interactive package installation, so that's how I would proceed to make the samples directory user configurable (assuming the user's choice becomes available to the shell script via an environment variable).
For now the current hard-coded setup should be fine as the installation size is only around 75 MB.
Hmm, this is embarrassing. It seems to be working now that I re-built the package this morning. It seems that I had an intermediate build in the package that had a slightly different company (no spaces) than where the post-install script was putting the samples folder. Now that I've re-compiled and re-packaged, the LinkOSX file does seem to avoid the need for a sample pop-up menu.
@d-healey Thanks for your quick response last night, by the way!
@d-healey Right, which is why I worried about it as a very last resort...
I am reluctant to ask a user for a samples folder after they have already trusted me with a .pkg installer. The whole idea is that they don't need to do anything extra. I'm only lost because the LinkOSX file is pointing to a folder containing the .ch1 file and the documentation implies that this resolves the need for manual setup on the user's end.
It's also worth noting that the user is only going to see a tiny portion of the sample selection setup from your much appreciated documentation unless I change the size of my plugin to sizes that aren't justified by the current controls. This size restriction is part of why I want to avoid any user interaction in the first place.
I probably should have mentioned already that I'm using release 2.0.0, as that was the latest packaged version.
Unfortunately that doesn't seem to be the issue, as I've just re-installed with a slightly different plug-in name. I've corrected for the changes in the post-install script and verified that the Samples folder exists already and the LinkOSX file is pointing there without a newline character at the end.
Still I receive a dialog for selecting or installing samples. I've just verified that this occurs even when there is a .hr1 (.hrX) file with the expected version number in the samples directory specified in LinkOSX.
Okay, so this appears to be a simple issue with an appended newline in the LinkOSX file!
Switching from echo to printf in my post-install package script seems to have done the trick