2

I am trying to make a patch that plays audio when a bang is pressed. I have put a symbol so that I don't need to keep reimporting the file. However it works sometimes but not all the time.

A warning in the Pd console reads: Start requested with no prior open

However I have imported an audio file

Is there something that I have done wrong?

Max N
  • 1,134
  • 11
  • 23
Satsuki
  • 2,166
  • 5
  • 17
  • 33

1 Answers1

2

Use [trigger] to get the order-of-execution correct.

One problem is, that whenever you send a [1( to [readsf~] you must have sent an [open ...( message directly beforehand. Even if you have just successfully opened a file, but then stopped it (with [0() or played it through (so it has been closed automatically), you have to send the filename again.

The real problem is, that your messages are out of order: you should never have a fan-out (that is: connecting a message outlet to multiple inlets), as this will create undefined behavior.

Use [trigger] to get the order-of-execution correct.

(Mastering [trigger] is probably the single most important step in learning to program Pd)

Max N
  • 1,134
  • 11
  • 23
umläute
  • 28,885
  • 9
  • 68
  • 122