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

Tape breaks when used from script #1478

Open
catfact opened this issue Dec 6, 2021 · 2 comments
Open

Tape breaks when used from script #1478

catfact opened this issue Dec 6, 2021 · 2 comments

Comments

@catfact
Copy link
Collaborator

catfact commented Dec 6, 2021

from https://llllllll.co/t/norns-scripting/14120/1032 :

function init()
  file = "/home/we/dust/audio/tape/0000.wav"
  audio.tape_play_stop()
  audio.tape_play_open(file) 
  audio.tape_play_start()
end

"Playback works initially; however if I then go to Tape and select Play or run audio.tape_play_stop() in matron I am no longer able to hear any audio from tape even after rerunning my script or playing a wav file with the Tape app."

i can reproduce this. almost certainly it is a bug in the crone::Tape state machine. only recoverable by restarting crone process.

strongly suspect that adding delays would avoid the bug: such that, e.g. the stop envelope completes before the next file is opened, etc.

this is another reason to perform/complete a full rewrite of the Tape module.

@eethann
Copy link

eethann commented Jun 12, 2022

I just encountered this working on a tape operator for Orca, definitely interested in it to enable timed triggering of tapes for use during performance, etc. Not sure how useful I can be on debugging, but happy to help how I can.

@catfact
Copy link
Collaborator Author

catfact commented Jun 12, 2022

gave this a minute of thought. there isn't really an easy bandaid. what i wish i could do is make all the tape API functions just do nothing if the module is busy (instead of corrupting state) and return a bool to the caller indicating whether the action was taken or not. (of course this is not very convenient for API user but would at least provide some sort of non-borking workaround.)

however even this kind of weak solution would be convoluted and tricky to implement right now because tape commands are just OSC messages and can't return anything (can only echo responses on a separate return channel.) so i don't think there is much point in addressing this in a useful way before we land the converged branch, whereupon lua and the Tape module will live in the same process.

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

No branches or pull requests

2 participants