Skip to content

Buggy interaction with Gtk.jl #105

@JeffFessler

Description

@JeffFessler

The following code works as expected for me in a fresh Julia session if the first line is commented out.

#using Gtk # uncommenting this causes problems with wavplay!?
using WAV: wavplay
S = 8192
x = cos.(2pi*(1:S÷2)*440/S)
y = cos.(2pi*(1:S÷2)*660/S)
wavplay(x, S)
wavplay(y, S)

But uncommenting the first line causes intermittent problems, usually that the first tone x is never played.
I then have to restart Julia and comment out the first line for it to work again.

I am using Julia v1.6.4 with WAV v1.1.1 and Gtk v1.1.9, under MacOS Mojave 10.14.6.

I suspect that the issue is that both Gtk and WAV use a ccall with some type of run loop, like

CFRunLoopRun()

and perhaps those interfere with each other, but I am surprised that merely adding using Gkt without calling any Gtk functions would cause such interference.

I am preparing to teach a course where students make a simply GUI-based synthesizer using Gtk buttons that produce tones when clicked, so I very much hope there is a solution to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions