SPB Git

Repository Public

troubleshooting.md 12.5 KB 252 lines markdown

1# Troubleshooting23This chapter starts from what you observe and leads to the cause. For the meaning of a specific error code, see [Error Handling](errors.md).45## Nothing happens when I start the automation67**It is waiting for the next bar.** An automation declared with `quantize bar` does nothing until the next bar line of the master clock (up to four beats), and one with `quantize beat` until the next beat. `status` shows it as running at beat 0.0. This is intended; remove `quantize` if the script should act at once.89**It is waiting for an event.** If the body only registers handlers (`on …`), nothing visible happens until the event occurs. `status` shows it running with 0 pending tasks.1011**It stopped itself.** A guard at the top (`if not deck.B.loaded { … stop }`) may have ended it. Look at the log for the message it printed.1213**It failed.** Look at the log for an error line.1415**It did not compile.** A script with an error does not start at all. `run "Name"` in the console prints the first errors.1617**The clock is not where you think.** With no deck playing, the master clock runs free at its own tempo; bars still pass, at `master.bpm`.1819## My `at bar 8` runs while the ramp is still going2021That is what it means. Bars count from 1, so bar 8 **begins** 28 beats after the start. A ramp `over 8 bars` lasts 32 beats and ends at the beginning of bar 9.2223```orixdj24at bar 8 { print("28 beats in: the ramp has one bar to go") }25at bar 9 { print("32 beats in: the ramp has just ended") }26over 8 bars { deck.A.volume -> -20dB }27deck.A.volume = 0dB28```2930To do something when the ramp ends, write it after the `over` block, or use `at bar 9`.3132## My `at` block runs immediately instead of at its position3334`at` counts from the start of the automation, not from where the cursor is. If the cursor has already passed the position, because the `at` is written after a `wait` or an `over`, the block runs at once and the log says:3536```text37line 6: 'at' names a position 4 beats in the past; running it now38```3940Write the `at` statements before the waits and ramps they should overlap. If you meant "this long from now", use `wait` and then the statements.4142```orixdj43wait 4 bars44at bar 2 { print("too late: this runs now, 16 beats in") }45```4647## `at bar 2` is not on a bar line of the music4849The automation was started in the middle of a bar without `quantize bar`. Its bars count from the moment it started. Add `quantize bar` to the header, or start the body with `wait nextBar`.5051## `wait nextBar` does not wait5253When the cursor is already exactly on a bar line, `wait nextBar` continues immediately. That is always the case for the first statement of a `quantize bar` automation. Use `wait 1 bar` to let a full bar pass.5455## The statement after `over` happens too late / too early5657`over` occupies its whole duration. Statements after the block run when it ends. For something that must happen during the ramp, schedule it with `at` before the `over`, as above.5859If you wrote `=` where you meant `->` inside `over`, the control jumps at the start of the block and nothing ramps. The compiler warns: `This 'over' block ramps nothing; it only waits.` (`W-OVER`).6061## The effect parameter cannot be ramped6263```orixdj-error64over 2 bars { fx.delay.time -> 1/8beat }65```6667```text68'fx.delay.time' (duration) cannot be ramped; set it with '='. [E-RAMP]69```7071Only controls of type number, gain or frequency can be ramped. Durations (`fx.delay.time`, `fx.echo.time`, `fx.gate.rate`, `fx.tremolo.rate`, `fx.autopan.rate`, `fx.beatrepeat.length`, `fx.reverb.predelay`, compressor and limiter times), switches (`fx.delay.pingpong`, `enabled`, `deck.X.keylock`…) and texts (`mixer.curve`) are set with `=`. The reference tables say "read, write, ramp" for the controls that accept `->`. Step a duration with a loop:7273```orixdj74fx.delay.enable()75for slice in [1/2beat, 1/4beat, 1/8beat] {76    fx.delay.time = slice77    wait 2 beats78}79fx.delay.disable()80```8182`master.bpm` cannot be ramped either. Ramp the tempo of the master deck: `over 8 bars { deck.A.bpm -> 124 }`.8384## The ramp stops halfway or the control ends at the wrong value8586- **Something assigned the control during the ramp.** `path = value` cancels a running ramp on that control. Look for an `at` block or a handler that sets it.87- **Another ramp replaced it.** A new ramp on the same control replaces the running one.88- **The automation was stopped or failed.** Ramps stop where they are; nothing is restored.89- **Another automation is writing the same control.** Check `status`.90- **You are moving the control by hand.** The ramp overwrites it at every step until it ends.9192## Is the control really on its target after `over`?9394Yes. Ramps that end at a beat are completed before the statements due at that beat. The statement after an `over` block reads the exact target, a following ramp on the same control starts from it, and `stop` right after the block leaves the control there. If the control is somewhere else, something cancelled or replaced the ramp: see the previous section.9596## The ramp does not start from where I expected9798A ramp starts from the value the control has when the `over` block begins. If the control was somewhere unexpected (a fader left down, a filter left open by an earlier script), the ramp starts there. Set the start explicitly before the block:99100```orixdj101deck.A.filter.highpass = 20Hz102over 4 bars { deck.A.filter.highpass -> 4kHz }103deck.A.filter.highpass = 20Hz104```105106## The effect is on but I hear nothing change107108- The `mix` of the effect is 0, or was left at 0 by an earlier script. Each effect has its own default mix; set it explicitly.109- You addressed the wrong rack. `fx.echo` is the master rack; `deck.A.fx.echo` is the channel rack of deck A. They are different units.110- Setting a parameter adds the effect to the rack **switched off**. Call `enable()`.111- The effect was bypassed by the emergency stop or by a failed automation.112- The rack is full (eight effects): a parameter write that would have to add the effect is refused by the engine, with a warning line from the source `engine` in the automation log.113114Type `fx` in the console to see what is in each rack and what is on.115116## An effect stays on after the script117118A script that is stopped by hand does not undo anything, and a script that ends normally only does what it says. Add `disable()` at the end of the script. After a failure, the effects that the failed automation had switched on (with `enable()`, `toggle()` or `enabled = true`) are switched off automatically. `panic` bypasses everything.119120## E-ACTION: the deck is not loaded121122```text123line 5: Deck C has no track loaded. [E-ACTION]124```125126An action needed a track and the deck is empty. The automation was cancelled at that line. Load the deck, or guard the action:127128```orixdj129if deck.C.loaded {130    deck.C.play()131} else {132    print("deck C is empty")133}134```135136Other `E-ACTION` messages (hot cue not set, no previous loop, deck playing while loading) are listed in [Error Handling](errors.md).137138## `deck.B.play()` fails right after `deck.B.load(…)`139140Loading takes time. Wait for the deck to announce that the track is ready:141142```orixdj143automation "Load Then Play" {144    on deck.B.loaded once {145        deck.B.sync(true)146        wait nextBar147        deck.B.play()148    }149    deck.B.load("Night Drive")150}151```152153Also remember that `load` is refused while the deck is playing.154155## E-UNAVAILABLE156157A value could not be read. With the standard engine every documented path can be read at any time, including the parameters of an effect that is not yet in a rack (they read as their defaults), so this error should not appear. If it does, follow the hint in the message, which for an effect is to call `enable()` first, and report the script.158159## The script stops at 256 beats in the simulator (or 200)160161The simulator ends a run after a fixed number of beats: 256 by default. A run that is still alive at that point is reported as timed out; this is not an error. It happens to scripts that are longer than the run and to scripts that wait for events. Increase the run length (`maxBeats` in the simulation settings) to see the rest. The documentation tests of ORIX DJ use 200 beats.162163## The simulator works but live it fails164165The simulated rig starts in a tidy state: deck A playing, deck B loaded, both at 128 BPM. Live differences that matter:166167- a deck is empty, or already playing;168- a track has no analysed tempo or beat grid: `sync`, `deck.X.bpm = …`, `seek(… beats)` and `loop(…)` depend on it;169- a hot cue or a loop the script relies on does not exist on this track;170- a loop does not fit before the end of the track;171- the rack already contains eight effects.172173Configure the simulated decks to match the live situation and run again, or add guards.174175## Setting `deck.X.bpm` does nothing176177The track has no analysed tempo, so there is nothing to compute the playback rate from. The engine refuses the write; the script keeps running and a warning line from the source `engine` appears in the automation log. Check `deck.X.trackBpm > 0` first, or set `deck.X.rate` directly. Also, a deck with `sync` on is steered by the master clock: its rate is overwritten continuously.178179## The tempo of a track is half or double what I expected180181The analysis reports tempos in the range 78 to 156 BPM, the usual DJ convention: a 170 BPM track is shown as 85, a 70 BPM track as 140. `deck.X.trackBpm` and `deck.X.bpm` use the reported value. The ÷2 and ×2 buttons on the deck change it.182183## Sync does not bring the decks together184185`deck.B.sync(true)` needs a tempo on deck B and a master clock driven by a deck with a beat grid. The preset "Harmonic Transition" shows the check:186187```orixdj188if deck.A.trackBpm == 0 or deck.B.trackBpm == 0 {189    print("Both decks need an analysed tempo.")190    stop191}192```193194## The cue, loop or jump lands off the beat195196`deck.X.quantize` snaps cues, loops and jumps to the beat grid; it is on by default. If it was switched off, positions are taken exactly where the playhead is. Set `deck.X.quantize = true`. If the grid itself is wrong, the snap is wrong: fix the beat grid of the track.197198## The automation never ends199200It has event handlers. A handler keeps an automation alive until a `stop` statement runs or you stop it. Add `once` to handlers that are needed a single time, or `stop` inside the handler that completes the job.201202## My trigger pad does nothing203204- No running automation has `on trigger(n)` for that number. Start the automation first; triggers are not kept.205- The handler was registered after a `wait` that has not finished yet.206- The automation is paused.207- The pad is not mapped to `automation.trigger.n`. Test the script with `trigger n` in the console: if that works, the problem is in the mapping.208209## E-BUDGET or E-RATE210211A loop does too much at one instant. Put a `wait` in its body, or replace many small assignments by one `over` ramp. See [Performance Guidelines](performance.md).212213## E-UNBOUNDED while running214215A `while` loop reached its `limit` with its condition still true. The limit is a safety net; exceeding it is an error. Count the turns in the condition (`while not ready and turns < 32 limit 32`). See [Loops](loops.md).216217## E-UNDECLARED on a simple assignment218219`tempo = master.bpm` needs a declaration: `let tempo = master.bpm`. See [Variables](variables.md).220221## E-TYPE around a fraction such as `1/4 beat`222223`1/4beat` and `1/4 beat` (one space) are both accepted. More than one space before the unit, or spaces inside the fraction (`1 / 4 beat`), do not make a fraction literal: the text is read as a division. See [Units](units.md).224225## A variable changed in an `at` block is unchanged outside226227An `at` block works on a copy of the variables taken when it was scheduled. To share a variable between the main sequence and something that runs later, use an event handler, or do the work in the main sequence.228229## A variable set on one console line is unknown on the next230231Each console line is a separate automation. Put the statements on one line separated by semicolons, or save a script.232233## Seconds drift from the beat234235Durations in seconds are converted to beats when the statement runs, at the tempo of that moment. They are not whole numbers of beats in general. Use beats and bars for anything musical, and `wait nextBar` to get back on the grid after a wait in seconds.236237## Still stuck2382391. Reduce the script to the few lines that show the problem.2402. Run it in the simulator and read the trace line by line.2413. Add `print` statements for the values you are unsure of.2424. Check the warnings.243244## Related245246- [Error Handling](errors.md)247- [Debugging](debugger.md)248- [Timing](timing.md)249- [Beats and Bars](beats-and-bars.md)250- [Automation Scheduling](scheduling.md)251- [Console Usage](console.md)252
Files main
Menu

Theme