Native GUI suggestion for Linux

Do you want to interact with the UI, or just plotting?

I am extensively using Gtk.jl fur such things. Here is a screenshot of what you can accomplish.

19 Likes

Some minimal interaction would be nice.

Your example looks amazing, do you have a link to the source?

curious to see what the recommendations will end up being.
Currently I use the pyviz toolstack http://blog.pyviz.org/pyviz-holoviz.html
(python!)

Unfortunately this application is in a private repository, which is for several reasons. For instance the code is pretty ugly, monolithic, and tight to a specific application. My (middle term) vision would be that we build some high-level UI widgets for data visualization and put them into a public repository. For instance I have a signal viewer, where one can display a signal in time and frequency domain and zoom in and out.

If you are willing to give Gtk.jl a try feel free to ask questions. When it comes to plotting I can also send you some code snippets. Best would be that you make a drawing, how your UI should look like.

1 Like

This is doable with Julia 1.3 which I outlined here: Threading 1.3: Success Story
One issue at that time was that the @spawn macro may run on thread 1 but there has been some recent work ([ANN] ThreadPools.jl - Improved thread management for background and nonuniform tasks) that should make this feasible.

Regarding the concrete implementation: I think it is sufficient that you use one BG thread that does the processing. This BG thread can update the UI using g_idle_add. No need for an additional thread.

2 Likes

This is how the latest version of PortAudio.jl works. I’m about to merge and release the latest branch. It uses Julia’s multi threading support to do the wait in a separate thread so that it doesn’t block the Julia event loop. So you can call the read within an @async task and everything will play together nicely.

This part should take very minimal CPU because it spends most of its time waiting.

For simple stuff with some sliders etc. I’ve found Makie sufficient, see their doc page on interaction.
http://makie.juliaplots.org/dev/interaction.html
Everything in a Makie plot is an observable, which makes tying behaviors to gui events and gui components to signals very easy.

1 Like

Whoops, just saw your note on the PortAudio github. I’ll check it out. Thanks for testing!

I think I am working on something similar, but I am generating samples and doing write, not read. I was surprised how smooth it works. My local PortAudio.jl is a bit tweaked so probably you won’t be able to run it till everything is merged and linux problems will be solved.
I am also planning to add some UI, I was thinking about using Electron.jl for that but I am also interested about different options.

1 Like

Neat example.

I’m curious if you created the layout using Glade or the directly with the code. i’m finding it very painful to get glade to do what I want.

also, are you using a plot package for the graphing and just pointing them at a cairo window, or are you doing the graphics (and plotting) using your own code ?

Just thought I mention that similar discussions on slack between Makie and image-processing channels have discussed how we can do a more flexible version of ImageView.jl and maybe build on some ideas of TInker.jl. Not as robust as GTK (yet), but if you need 3D modeling at some point it might be hard to do in GTK.

Tamas, this is an aside that has nothing to do with your question, but several weeks ago I went down some patent rabbit holes which ended with US patent 2,286,030, and I suspect you might find it interesting at least from an historical point of view.

2 Likes

I think they still make a version of those, but I have only seen them on videos.

I am experimenting with modern algorithms, like

@article{de2002yin,
  title={YIN, a fundamental frequency estimator for speech and music},
  author={De Cheveign{\'e}, Alain and Kawahara, Hideki},
  journal={The Journal of the Acoustical Society of America},
  volume=111,
  number=4,
  pages={1917--1930},
  year=2002,
  publisher={Acoustical Society of America}
}

@inproceedings{mcleod2005smarter,
  title={A smarter way to find pitch.},
  author={McLeod, Philip and Wyvill, Geoff},
  booktitle={ICMC},
  volume=5,
  pages={138--141},
  year=2005
}

combined with some heuristics.

This is just a fun project, modern CPUs are incredibly powerful and can do a lot of analysis in real time. My main interest lies in the following areas:

  1. compensating for the effect that plucking the string changes the pitch, so the actual pitch is a bit uneven for short notes. I want to visualize and analyze this.

  2. saving and reproducing a slightly “tweaked” microtuning (adjusting the chromatic scale) that I happened to like because it sounds good.

I will make the code public as it matures. Stay tuned :wink:

5 Likes

I got to see one in person when a technician was working on my son’s sax, and was fascinated by how much better the experience is than with every tuner app I’ve seen. No lag at all. This was a solid state unit, probably from around 1970. The patent is cool because they describe how you can see that overtones are not necessarily integer multiples of the fundamental by seeing the different rings appear to slide at different rates. Relies on AM modulation of the neon indicators. This isn’t a real project for me, just something I found interesting. I’ll have to look at your papers a bit later.

@Tamas_Papp If you’re looking at pitch tracking I’ve seen recent papers seem to use pYIN rather than the classic regular YIN. I’m not super familiar with either one, but pYIN might be worth checking out if you haven’t yet.

1 Like

If you care about accuracy and latency of pitch detection, the best you can use currently is implemented here: https://github.com/jkjaer/fastF0Nls
The literature is extensive, but this gets very close to the theoretically optimal result.

1 Like

Thanks. It looks like I have a lot of reading to do.

My reading of the literature is that a lot of modern algorithms are focused on general pitch detection (eg voice), but musical instrument spectra have a specific structure that can be exploited for further accuracy.

Amazing, I am working on the same stuff. I’ve built a custom guitar with True Temperament neck and hexaphonic pickups. I’ve put there Schaller Hannes bridge with hexaphonic piezo pickup in addition to magnetic pickups. It’s hard to tweak tuning if you have single output pickup for all strings. Are you aware of any methods to separate them from single output?

You can address issue 1. with EverTune bridge - very clever mechanism that compensates pitch change mechanically.

Great resource is page larips.com. I have also some materials that cannot be easily searched in web, this is very niche topic. My idea now is to find new, undiscovered yet tone systems using dissonance curves but it is mathematical optimization problem with crazy number of dimensions.

2 Likes

Sorry to un-derail this otherwise reverberating discussion, but it would be really useful to demonstrate these steps:

but decouple them from a specifically audio source, making it more general. So that the source could be video/image data, as mentioned before by @Zach_Christensen. It might be possible to package it, as some sort of AbstractOnlineControl.jl or just as a blog post. In any case, I too am looking forward to see what you come up with @Tamas_Papp!

1 Like