SPB Git

Repository Public

troubleshooting.md 12.5 KB

# Troubleshooting

This chapter starts from what you observe and leads to the cause. For the meaning of a specific error code, see Error Handling.

# Nothing happens when I start the automation

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.

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.

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.

It failed. Look at the log for an error line.

It did not compile. A script with an error does not start at all. run "Name" in the console prints the first errors.

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.

# My at bar 8 runs while the ramp is still going

That 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.

orixdj
at bar 8 { print("28 beats in: the ramp has one bar to go") }
at bar 9 { print("32 beats in: the ramp has just ended") }
over 8 bars { deck.A.volume -> -20dB }
deck.A.volume = 0dB

To do something when the ramp ends, write it after the over block, or use at bar 9.

# My at block runs immediately instead of at its position

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:

text
line 6: 'at' names a position 4 beats in the past; running it now

Write the at statements before the waits and ramps they should overlap. If you meant "this long from now", use wait and then the statements.

orixdj
wait 4 bars
at bar 2 { print("too late: this runs now, 16 beats in") }

# at bar 2 is not on a bar line of the music

The 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.

# wait nextBar does not wait

When 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.

# The statement after over happens too late / too early

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.

If 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).

# The effect parameter cannot be ramped

orixdj-error
over 2 bars { fx.delay.time -> 1/8beat }
text
'fx.delay.time' (duration) cannot be ramped; set it with '='. [E-RAMP]

Only 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:

orixdj
fx.delay.enable()
for slice in [1/2beat, 1/4beat, 1/8beat] {
    fx.delay.time = slice
    wait 2 beats
}
fx.delay.disable()

master.bpm cannot be ramped either. Ramp the tempo of the master deck: over 8 bars { deck.A.bpm -> 124 }.

# The ramp stops halfway or the control ends at the wrong value

  • 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.
  • Another ramp replaced it. A new ramp on the same control replaces the running one.
  • The automation was stopped or failed. Ramps stop where they are; nothing is restored.
  • Another automation is writing the same control. Check status.
  • You are moving the control by hand. The ramp overwrites it at every step until it ends.

# Is the control really on its target after over?

Yes. 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.

# The ramp does not start from where I expected

A 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:

orixdj
deck.A.filter.highpass = 20Hz
over 4 bars { deck.A.filter.highpass -> 4kHz }
deck.A.filter.highpass = 20Hz

# The effect is on but I hear nothing change

  • 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.
  • 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.
  • Setting a parameter adds the effect to the rack switched off. Call enable().
  • The effect was bypassed by the emergency stop or by a failed automation.
  • 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.

Type fx in the console to see what is in each rack and what is on.

# An effect stays on after the script

A 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.

# E-ACTION: the deck is not loaded

text
line 5: Deck C has no track loaded. [E-ACTION]

An action needed a track and the deck is empty. The automation was cancelled at that line. Load the deck, or guard the action:

orixdj
if deck.C.loaded {
    deck.C.play()
} else {
    print("deck C is empty")
}

Other E-ACTION messages (hot cue not set, no previous loop, deck playing while loading) are listed in Error Handling.

# deck.B.play() fails right after deck.B.load(…)

Loading takes time. Wait for the deck to announce that the track is ready:

orixdj
automation "Load Then Play" {
    on deck.B.loaded once {
        deck.B.sync(true)
        wait nextBar
        deck.B.play()
    }
    deck.B.load("Night Drive")
}

Also remember that load is refused while the deck is playing.

# E-UNAVAILABLE

A 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.

# The script stops at 256 beats in the simulator (or 200)

The 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.

# The simulator works but live it fails

The simulated rig starts in a tidy state: deck A playing, deck B loaded, both at 128 BPM. Live differences that matter:

  • a deck is empty, or already playing;
  • a track has no analysed tempo or beat grid: sync, deck.X.bpm = …, seek(… beats) and loop(…) depend on it;
  • a hot cue or a loop the script relies on does not exist on this track;
  • a loop does not fit before the end of the track;
  • the rack already contains eight effects.

Configure the simulated decks to match the live situation and run again, or add guards.

# Setting deck.X.bpm does nothing

The 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.

# The tempo of a track is half or double what I expected

The 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.

# Sync does not bring the decks together

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:

orixdj
if deck.A.trackBpm == 0 or deck.B.trackBpm == 0 {
    print("Both decks need an analysed tempo.")
    stop
}

# The cue, loop or jump lands off the beat

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.

# The automation never ends

It 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.

# My trigger pad does nothing

  • No running automation has on trigger(n) for that number. Start the automation first; triggers are not kept.
  • The handler was registered after a wait that has not finished yet.
  • The automation is paused.
  • 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.

# E-BUDGET or E-RATE

A 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.

# E-UNBOUNDED while running

A 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.

# E-UNDECLARED on a simple assignment

tempo = master.bpm needs a declaration: let tempo = master.bpm. See Variables.

# E-TYPE around a fraction such as 1/4 beat

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.

# A variable changed in an at block is unchanged outside

An 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.

# A variable set on one console line is unknown on the next

Each console line is a separate automation. Put the statements on one line separated by semicolons, or save a script.

# Seconds drift from the beat

Durations 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.

# Still stuck

  1. Reduce the script to the few lines that show the problem.
  2. Run it in the simulator and read the trace line by line.
  3. Add print statements for the values you are unsure of.
  4. Check the warnings.
Files main
Menu

Theme