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

Unwanted noisy output on instantiation #43

Open
zyrolasting opened this issue Feb 11, 2020 · 0 comments
Open

Unwanted noisy output on instantiation #43

zyrolasting opened this issue Feb 11, 2020 · 0 comments

Comments

@zyrolasting
Copy link

zyrolasting commented Feb 11, 2020

I'm trying to suppress (but later redirect) some messages that appear on the right of the below screenshot. It appears that these are messages that come from the RSound library itself, and redirecting output via current-*-port to nowhere doesn't have an effect.

I can still use the library fine. The problem is that I use rsound on a different thread, and it would be competing out of band for standard ports. If I can't capture these messages somehow, then this adds noise to my logs.

Here's a copyable version of my attempt to silence rsound noise on the left side of the screenshot. Problem is that I don't know if you'll be able to reproduce these messages because you don't have my hardware. Please tell me of any information I can provide that can help you.

#lang racket

(provide (all-defined-out))
(require "shared.rkt")

(define nowhere (open-output-nowhere))
(define-syntax-rule (silent-begin body ...)
  (parameterize ([current-output-port nowhere]
                 [current-error-port nowhere])
    body ...))

(define (dynreq s)
  (silent-begin (dynamic-require 'rsound s)))

(define-syntax-rule (silent/proc id ...)
  (begin
    (begin
      (provide id)
      (define (id . args) (apply (dynreq 'id) args)))
    ...))

(define-syntax-rule (silent/id id ...)
  (begin
    (begin
      (provide id)
      (define id (dynreq 'id)))
    ...))

; Try to silence noise.
(silent/proc rs-write rs-append*)
(silent/id clap-1 snare bassdrum clap-2 kick)

image

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

No branches or pull requests

1 participant