72
submitted 7 months ago* (last edited 7 months ago) by t0mri@lemmy.ml to c/linux@lemmy.ml

greetings, i want to build a daw (digital audio workstation), but i have no idea where to even start. here are my needs and the options i've found:

my needs:

  • load and keep things (audio, midi) in memory
  • cross-platform compatibility is not a requirement

the options i've found:

  • ~~flutter~~
  • ~~gtk/qt~~
  • raylib (with zig)
  • ~~webassembly (with zig)~~

[rejected] flutter: the first option that came to my mind was flutter. i thought it would give me a quick start in laying down the ui, but i don't think it has the capability to fulfill my needs (please correct me if i'm wrong)

gtk/qt (with zig): i wonder if qt provide bindings for zig

raylib (with zig): it's cool (my choice as of now)

[rejected] webassembly (with zig): it would be an ultimate comfort to build this way ig, but is it possible to make that web app into desktop one (like tauri or something)?

id really appreciate your opinions and advice

ps: i hope i'm clear. i got a headache searching about these. i'll update this post for more clarity later

final note

Thank you guys for all your opinions and advises. Thanks for explaining the limitations with gtk, things with qt and flutter. That kotlin compose thing was cool too. Thanks for mentioning yabridge thats gonna be helpful. It might not seem like it, but I did listen to your thoughts, and stuck with zig and raylib. Thanks a lot

top 48 comments
sorted by: hot top controversial new old
[-] stevecrox@kbin.run 28 points 7 months ago* (last edited 7 months ago)

QT is a cross platform UI development framework, its goal is to look native to the platform it operates on. This video by a linux maintainer from 2014 explains its benefits over GTK, its a fun video and I don't think the issues have really changed.

Most GTK advocates will argue QT is developed by Trolltech and isn't GPL licensed so could go closed source! This argument seems to ignore open source projects use the Open Source releases of QT and if Trolltech did close source then the last open source would be maintained (much like GTK).

Personally I would avoid Flutter on the grounds its a Google owned library and Google have the attention span of a toddler.

Not helping that assessment is Google let go of the Fuschia team (which Flutter was being developed for) and seems to have let go a lot of Flutter developers.

Personally I hate web frontends as local applications. They integrate poorly on the desktop and often the JS engine has weird memory leaks

[-] PipedLinkBot@feddit.rocks 4 points 7 months ago

Here is an alternative Piped link(s):

This video from 2014

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I'm open-source; check me out at GitHub.

[-] rudi@lemmy.sdf.org 1 points 7 months ago

We just need a native os-js/webtop then the web frontends would make sense... Till then they feel bloaty (looking at discord)

[-] cetra3@lemmy.ml 25 points 7 months ago

I've started building a lightweight daw mostly for mixing songs together rather than any actual serious music production. Currently only supports volume and bass envelopes, and dragging tracks around. I'm planning to open source it when it's a bit more polished. It's written in rust and I'm using egui for the frontend.

[-] t0mri@lemmy.ml 10 points 7 months ago

that's so cool! it looks good too. i might need your help in the future.

[-] makingStuffForFun@lemmy.ml 15 points 7 months ago

Google just killed flutter. Just so you know. They do that a lot. Be careful

[-] PureTryOut@lemmy.kde.social 5 points 7 months ago

No they didn't. It literally got an update this week (3.22). Laying off part of the team (which is worrying) is not the same as actually killing it.

[-] banghida@lemm.ee 1 points 7 months ago
[-] cerement@slrpnk.net 9 points 7 months ago
[-] insomniac_lemon@kbin.social 3 points 7 months ago

I want to use Raylib, but mentioning it here on the fediverse doesn't get much of a response (I can't see a raylib community from my instance). My choice of language probably doesn't help, though.

My first issue is wanting vertex colors on 3D models and I am not getting this (this may be a problem with the bindings I'm using, naylib(nim-lang)). The second would be needing guidance for the 2D polygon text loader that I started.

Maybe I could make simple GUI applications with raygui, but I don't currently really have many viable ideas on what I would want to make.


To OP: Another potential option is using Godot w/bindings. Design is pretty fast and flexible, then using signals is super easy.

I've tested some frameworks (specific to my language, so not really helpful to most), the one that I liked more said it was declarative user interface framework based on GTK though I would prefer a similar thing for Qt and there wasn't an ability to automatically scale text size to better fill the available button size (I was testing an adventure-book reader and hoping to use unicode characters).

Frameworks for single page applications (or some other browser-based tech) might be ok for simple stuff. Similarly, I've liked the idea of TUI frameworks (yeah, because htop) but haven't really tried that yet.

[-] intelisense@lemm.ee 1 points 7 months ago

IIRC, Qt comes with its own declarative language. That might be why you can't find any bespoke ones.

[-] snake_case_lover@lemmy.world 7 points 7 months ago

i recommend gtk's libadwaita. it saves alot of time. It has JS Python rust and C bindings.

[-] Andromxda@lemmy.dbzer0.com 6 points 7 months ago

Bad idea. Very bad idea, especially for more complex projects.

[-] LeFantome@programming.dev 5 points 7 months ago

Well, it is a bad idea if you are building anything not intended to be exclusively a GNOME app.

[-] Andromxda@lemmy.dbzer0.com 4 points 7 months ago

It's also a bad idea if you want to build anything that's more complex than GNOME's single-purpose apps that lack all kinds of features. Building something as complex as a DAW would be a nightmare with libadwaita.

[-] possiblylinux127@lemmy.zip 2 points 7 months ago
[-] Andromxda@lemmy.dbzer0.com 6 points 7 months ago

Libadwaita has been specifically designed for simple GNOME-style applications that only have one purpose and don't include many features. I wouldn't recommend it for complex project like a DAW.

[-] possiblylinux127@lemmy.zip 2 points 7 months ago

It is made to be simple but libadwaita apps being single purpose is not true. It is a good design choice but some apps are naturally complex such as gnome settings.

[-] Andromxda@lemmy.dbzer0.com 1 points 7 months ago

Not libadwaita, but GNOME. GNOME apps are meant to be simple, and only do one single thing.

https://developer.gnome.org/hig/principles.html

The best apps do one thing and do it well.

Resist the pull to try and make an app that suits all people in all situations. Focus on one situation, one type of experience.

[-] possiblylinux127@lemmy.zip 2 points 7 months ago

You do not need to follow the gnome standards. Its good practice if you do but not required.

[-] Andromxda@lemmy.dbzer0.com 1 points 7 months ago

You don't need to, but the entire framework has been specifically designed around this GNOME development philosophy, making it basically unusable for anything else. There are much better frameworks like Qt (C++/QML, but has bindings for almost every language), Iced (Rust), Avalonia (if you use C#) and many others

[-] eugenia@lemmy.ml 5 points 7 months ago* (last edited 7 months ago)

It depends if you're using Gnome or KDE. If you prefer KDE, use Qt. If you prefer Gnome's interface ideas (that looks quite different), use GTK+ with libadwaita. GTK+ has good bindings for Python, and Rust, and a new, rather Gnome-specific language, Vala.

[-] possiblylinux127@lemmy.zip 1 points 7 months ago

Use GTK4

GTK+ is quite old at this point

[-] eugenia@lemmy.ml 2 points 7 months ago

GTK4 is what I meant to say. To me, it's the same as GTK+, because that was the original name. Just like I spell nvidia as nVidia, because that's how it was spelt back in the early 2000s. It sticks

[-] yukijoou 5 points 7 months ago

there seems to be qt qml bindings for Zig

qml is a language made to build UIs, and is very easy to use in my experience - you can build your logic that needs to be high-performance (file loading, audio effects, etc.) in zig, and expose it to qml so it's available in the UI.

i've never used zig, but i did do a similar thing using c++ & qml, and it was great to work with, so i think you should be fine going that route

[-] rudi@lemmy.sdf.org 5 points 7 months ago

Happy Qt User here, I was able to make sense of the C++ and Go bindings for Qt really quickly and there's a lot of good resources and examples online for Qt Templates

[-] bamfic@lemmy.world 2 points 7 months ago
[-] PipedLinkBot@feddit.rocks 2 points 7 months ago

Here is an alternative Piped link(s):

https://piped.video/watch?v=J2mEPQGq5dU

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I'm open-source; check me out at GitHub.

[-] t0mri@lemmy.ml 2 points 7 months ago

bruh what was that!

[-] magikmw@lemm.ee 4 points 7 months ago

I've recently used dioxus with rust to build a native app with webview. Way cheaper than electron and the like.

[-] manito_manopla@lemmy.ml 4 points 7 months ago

I recommend using qt for the interface, for audio use jack, it is better for music production, if you want to load vst plugins into the program, you can use yabridge

[-] possiblylinux127@lemmy.zip 3 points 7 months ago
[-] MrSoup@lemmy.zip 2 points 7 months ago
[-] possiblylinux127@lemmy.zip 3 points 7 months ago

It is actually a GTK4 theme. You can use GTK4 without libadwaita but not the other way around.

[-] MrSoup@lemmy.zip 1 points 7 months ago

I would say a "superset of gtk" since the point of libadwaita is shipping more widgets targeting Gnome UI/UX (including its theme). That's why they describe it like "Building blocks for modern GNOME applications".

[-] possiblylinux127@lemmy.zip 2 points 7 months ago

True, but the concept of a theme is easier to understand. You also can run libadwaita on Windows and probably other platforms

[-] jaypatelani@lemmy.ml 3 points 7 months ago

Raylib sounds great. I would avoid gtk/qt. Enlightenment library also there but might not have zig bindings.

[-] delirious_owl@discuss.online 2 points 7 months ago

I would always go with something cross platform to save you or someone else effort later. I recommend Python to save yourself effort too.

Checkout kivy.

[-] t0mri@lemmy.ml 1 points 7 months ago
[-] vulpivia@lemmy.world 2 points 7 months ago

Yes. For a DAW, I would avoid languages with garbage collection.

[-] delirious_owl@discuss.online 1 points 7 months ago

The most important speed to optimize is developer speed. Python is by that measure one of the fastest languages.

CPU speed is negligible

[-] vulpivia@lemmy.world 1 points 7 months ago

In this case we're talking about a soft real-time application where milliseconds matter. If you use Python for this, your developer speed will suffer because you're using most of your time to fight garbage collection pauses, among other things.

[-] delirious_owl@discuss.online 1 points 7 months ago

Kivy is a platform frequently used for video games. It has good hardware acceleration. It would work fine for this purpose.

Again, the CPU time differences are negligible. They're less than milliseconds.

[-] vulpivia@lemmy.world 1 points 7 months ago

Writing real-time audio processing code in Python won't be performant, though. And that's the part that matters for a DAW.

[-] NotMyOldRedditName@lemmy.world 2 points 7 months ago* (last edited 7 months ago)

You can try Kotlin Compose Multiplatform.

It can target JVM (windows, Linux, Mac) and then work on iOS and Android.

Android and JVM are stable. IOS is alpha and works well. Should be beta this year.

WASM support is coming as well but is experimental.

You can do as much multiplatform as you want and do as much platform specific as you want.

Compose itself is a declarative UI framework. Your UI is code.

Edit: You do require a Windows, Linux, and Mac machine to build the executables for each desktop JVM app, as well as a Mac for an iOS app. Android you can build on any of them.

[-] LeFantome@programming.dev 3 points 7 months ago

He said multi platform is not a requirement. But good low-level audio performance is.

What were you thinking?

[-] NotMyOldRedditName@lemmy.world 1 points 7 months ago* (last edited 7 months ago)

I don't see him mentioning low level audio performance is a requirement. And he listed flutter as something he had considered.

Can you not process audio in the JVM?

Edit: targeting JVM he could also use the JNI and do the low level stuff in c++ if needed. I don't know how that'd cross to iOS but it'd work on all 4 other platforms.

Edit: And he doesn't need to target mobile either, he can just target the JVM, write it in Kotlin + Compose and if needed write native code if he needs more performance.

[-] arran4@aussie.zone 1 points 7 months ago

What are your needs which aren't being met with flutter? -- It's really just a UI renderer and it has a C/C++/ObjectC/Java underlayer for everything else. It should link fine with existing c libraries. I have done a bit with it recently including desktop dev: https://www.producthunt.com/products/which-browser So hopefully I can answer any questions. -- Hit me up on matrix

It seems that Zig is the intended language? If go where a consideration I would point you at this to consider: https://github.com/go-graphics/go-gui-projects too.

this post was submitted on 19 May 2024
72 points (100.0% liked)

Linux

48762 readers
876 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS