# I asked ChatGPT4 to write a synth using juce!

**URL:** <https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694>\
**Category:** General JUCE discussion\
**Created:** [April 5, 2023, 6:31pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694 "2023-04-05T18:31:38Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [April 8, 2023, 2:31pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/21 "2023-04-08T14:31:46Z")

</div>

it’s not that clear actually. when music is “transformative” the sample is considered “fair use”. typically that means the person with more money wins, but whatever. copyright laws are all garbage anyway

---

<div class="post-metadata">

**Author:** ![Verbonaut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/verbonaut/32/11824_2.png) [@Verbonaut](https://forum.juce.com/u/Verbonaut)\
**Post date:** [April 8, 2023, 3:01pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/22 "2023-04-08T15:01:14Z")

</div>

Are patents being used in the training data? Probably. You can’t usually get away with patent infringement by just writing code in your own style, or claiming ignorance of the source (which at least would be true), so this is going to be a minefield in future when patent holders start seeing their protected ideas and techniques cropping up in unexpected places.

---

<div class="post-metadata">

**Author:** ![hilberturi](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hilberturi](https://forum.juce.com/u/hilberturi)\
**Post date:** [April 8, 2023, 7:02pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/23 "2023-04-08T19:02:38Z")

</div>

> [@Mrugalla](#):
>
> what would be an actual humanly understandable and non-juristical argument for this practice being unfair towards anyone?

Well - ChatGPT’s or CoPilot’s knowledge of how to use the JUCE framework can only be  
based on code examples that are publicly available.  
Snippets in a forum (like this forum) usually don’t compile, so it is safe to assume that  
almost everything that ChatGPT or CoPilot know about JUCE is based on JUCE-based  
open source code available on Github & Co.  
But JUCE is dual-licensed (proprietary and GPL) and all publicly available JUCE code  
on Github or in other places necessarily uses the GPL license - because there is no other  
option for using JUCE code in public repos.  
GPL, of course, is a Copyleft license, so any use of the sources, even in modified form,  
must be GPL licensed again.  
And using the source code for building the language model is also a form of  
“using” the code.  
If nearly all JUCE examples on which the model is based are GPL licensed,  
I cannot see how the Copyleft license should “magically” go away simply by mashing  
them up into a snippet shown to the user.  
In my view all generated JUCE snippets should be GPL licensed because this applies  
to nearly all sources they were extracted and mashed up from.  
ChatGPT or CoPilot should not be a back-door to whitewash Copyleft code so that it can be  
integrated into closed-source applications.  
At least each user should know that there is a risk in using the generated snippets  
because there is usually no information as to the primary sources involved, which in turn  
means that one cannot know which licenses (or even patents) are involved.  
In my view ChatGPT and CoPilot should offer separate models for each kind of license -  
trained only with conforming sources and made available under the respective license.

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [April 8, 2023, 8:18pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/24 "2023-04-08T20:18:51Z")

</div>

That only describes why it’s technically illegal to create or use those tools, but not why it’s morally bad, and that’s why I have a problem with the argument. You should ask yourselves less what the GPL license says, but instead what it’s function is and why it was made an option for JUCE projects in the first place.

Making and maintaining a big framework like JUCE is expensive, so people have to pay JUCE. Still JUCE is super generous and lets us use the entire framework for free, but only if we accept to open-source our code, because those repositories are free advertisement for JUCE and also great learning material for new JUCE developers, so JUCE benefits from them as well. The GPL license makes sure that people comply with the rules and don’t use the framework for closed-source applications without paying for it. That is the function.

Do any AI tools interfere with this function? When Github Copilot picks up some information from someone else’s code base and provides you with this information, you can use the information in your own code base and finish your project with it. You might have one of the commercial JUCE licenses, so you don’t need GPL, but the code that you were given was using GPL. Technically that’s illegal, but just because you use the code, doesn’t mean that this code suddenly doesn’t have a beneficial effect for JUCE anymore. Quite the contrary, it has let you finish your project so you will probably recommend JUCE due to the positive experience you made with it.

That’s why I’d say there is just no way to get around making entirely new rules for all this copyright stuff. At the moment it is just a mess and it doesn’t reflect reality anymore.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/f/fbd07f8f5ec7fb12f59b4a6037d27a91e5b8756a.jpeg)

Some might say it’s stupid to talk about why a license was created instead of what the license says directly, but in my opinion it’s important to always question tradition, because it could always be that we just believe in something to be the right way, only because we learned it is, but not because it actually is.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [April 8, 2023, 9:55pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/25 "2023-04-08T21:55:48Z")

</div>

If you take away the license, i.e. that the author can decide the terms of how it is shared and used, you take away the incentive to share code at all. This is not a liberation, but the end of all free knowledge exchange.

---

<div class="post-metadata">

**Author:** ![aamf](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aamf/32/19941_2.png) [@aamf](https://forum.juce.com/u/aamf)\
**Post date:** [April 8, 2023, 11:58pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/26 "2023-04-08T23:58:31Z")

</div>

> [@hilberturi](#):
>
> all publicly available JUCE code on Github or in other places necessarily uses the GPL license

There’s a huge amount of publicly available JUCE projects which are MIT or BSD licensed. Just take a look at the awesome-juce list. About a third or at least a fourth of all projects have such a license.

> [@hilberturi](#):
>
> In my view ChatGPT and CoPilot should offer separate models for each kind of license

Yes! And this shouldn’t be too difficult to implement: one mode is trained exclusively with code from MIT/BSD-licensed projects and the other exclusively with GPL-licensed ones. (The JUCE codebase itself can be used to train both, since the JUCE license will necessarily “match” the user’s distribution license).

The problem of attribution should also not be impossible to solve, if the algorithm can somehow list the most relevant sources.

It would be interesting if such an option is ever offered and if it actually works. Nevertheless I think that at this stage it’s the patents which are the tricky part, as @Vorbonaut pointed out.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [April 9, 2023, 12:33am UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/27 "2023-04-09T00:33:50Z")

</div>

I don’t trust this new AI stuff. They are already politically and ideologically biased. Who can tell what kind of code they spit out?

---

<div class="post-metadata">

**Author:** ![hilberturi](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hilberturi](https://forum.juce.com/u/hilberturi)\
**Post date:** [April 9, 2023, 6:33am UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/28 "2023-04-09T06:33:39Z")

</div>

> [@aamf](#):
>
> There’s a huge amount of publicly available JUCE projects which are MIT or BSD licensed. Just take a look at the awesome-juce list. About a third or at least a fourth of all projects have such a license.

Thanks for clarifying that, I just couldn’t imagine that escaping the GPL would be possible.  
But its true, the Projucer-generated “JuceLibraryCode” sources for a project are not actually  
checked in so it’s irrelevant that this part of the code is GPL- (or dual) licensed.

> [@aamf](#):
>
> The problem of attribution should also not be impossible to solve, if the algorithm can somehow list the most relevant sources.

I don’t think that the problem of attribution and license tracking is really difficult to solve.

All modern Large-Language Models are based on Multi-Head Attention networks. Each head  
is single-layer feed-forward network with soft-max activation. In effect, each head is a  
“winner-takes all” network where a single attention vector is chosen for each input token.

By simply labeling each attention vector with a unique id, you can compute a profile for  
each source document used for training (= the bag of all winning attention vector labels).

You can store these profiles in a traditional information retrieval (IR) system using a TF/IDF metric.

In the same way, you can determine the bag of labels for the current user session.  
These labels can be used for querying the IR system for the most relevant sources.

The TF/IDF metric ensures that specific attention vectors (taylored to particular kinds  
of sources) automatically get higher weight than unspecific attention vectors that are  
active for a very high number of sources.

Alternatively, you can simply store the frequency of each license of a source document  
with each attention vector label. As a result, you get a license frequency profile for each  
attention vector.  
This could be used to disable all GPL-dominated attention vectors if someone asks  
for code snippets suitable for closed-source use.  
In this way, you could dynamically taylor the model to specific licensing constraints.

These are just two straightforward solutions that I came up with in 5 minutes.

I am sure the smart researchers at OpenAI can do this in a much better way!

But it seems they just don’t _want_ to attribute sources and respect licenses because  
they can generate better content with more training data and this seems to be all  
that matters.

---

<div class="post-metadata">

**Author:** ![hilberturi](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hilberturi](https://forum.juce.com/u/hilberturi)\
**Post date:** [April 9, 2023, 7:22am UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/29 "2023-04-09T07:22:33Z")

</div>

> [@Mrugalla](#):
>
> what would be an actual humanly understandable and non-juristical argument for this practice being unfair towards anyone?

It’s as simple as this:

- Without CoPilot, you cannot use ANY of the GPL licensed sources on Github  
in your closed-source project because the GPL is a copyleft license and forbids  
closed-source reuse in direct but also in modified form.
- If you pay for CoPilot, however, you can use ALL of the GPL licensed sources  
in your closed-source project because CoPilot will resynthesize the code  
and remove all these annoying license restrictions for you.

I cannot see how this constitutes “fair use”.

> [@Mrugalla](#):
>
> Some might say it’s stupid to talk about why a license was created instead of what the license says directly, but in my opinion it’s important to always question tradition, because it could always be that we just believe in something to be the right way, only because we learned it is, but not because it actually is.

You only focus on the perspective of the makers of the JUCE framework.  
But what about the open-source developers who have intentionally chosen  
the GPL for their project?  
If you develop something and make it open-source with a GPL license then  
you want to contribute something to the public but you expressly do not permit  
this work or derived works to be integrated into closed-source applications.  
From this perspective, not allowing the generation of camouflaged code  
from GPL licensed sources follows exactly the intent of the developers who  
have chosen that specific license.

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [April 9, 2023, 7:41am UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/30 "2023-04-09T07:41:53Z")

</div>

now that’s a good argument. thanks. it’s finally getting tricky.

open source code has the property that people can look at and learn from it. so in some way that already contradicts the license. i mean does it matter which method of copying people use?

ctrl+c ctrl+v  
plain remembering what has been seen  
copilot/gpt

since neural networks work a lot like brains they are actually more comparable to plain remembering than to copy-pasting. people only compare it more to copy-pasting usually because a computer rather than an organic entity does it.

---

<div class="post-metadata">

**Author:** ![hilberturi](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hilberturi](https://forum.juce.com/u/hilberturi)\
**Post date:** [April 9, 2023, 8:11am UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/31 "2023-04-09T08:11:45Z")

</div>

I totally agree with that.

Actually I just wanted to give some weight to the perspective of open-source programmers (and specifically those who deliberately use the GPL).

Personally I am not an open-source programmer and I think it makes sense to experiment with this new style of AI-assisted “pair programming”.

This is probably how most programming will look like anyway in the near future.  
People who refuse to adopt this technique likely won’t be efficient enough anymore because they can’t keep up with the pace of those who use it.

Perhaps there should be specific variants of the GPL license that _explicitly permit_ or _explicitly forbid_ the use of the corresponding sources for training a language model that will drop licensing information.

In other words, there should be a way to _opt out_ the use of your public source code in a language model (or at least in models that silently skip license restrictions).

Then every developer can decide which usage they want to allow.

This would finally clarify these “gray area” legal issues.

---

<div class="post-metadata">

**Author:** ![Chuckk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chuckk/32/6190_2.png) [@Chuckk](https://forum.juce.com/u/Chuckk)\
**Post date:** [April 9, 2023, 1:04pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/32 "2023-04-09T13:04:38Z")

</div>

> [@Mrugalla](#):
>
> That only describes why it’s technically illegal to create or use those tools, but not why it’s morally bad, and that’s why I have a problem with the argument. You should ask yourselves less what the GPL license says, but instead what it’s function is and why it was made an option for JUCE projects in the first place.

The spirit of GPL is most definitely that the one who benefits from others’ work should also let others benefit from theirs. The whole point of using GPL instead of just sharing code with no license requirement is for the sharing to be “inherited”. It is paying forward with the explicit requirement that you do the same.  
That is the reason GPL exists.

JUCE, like Qt, probably allows GPL for 2 reasons: 1. to encourage devs to pay for a license if they intend to sell their works;  
2. to allow devs to practice for free until they reach the point of being able to pay for a license and sell their products.

---

<div class="post-metadata">

**Author:** ![Chuckk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chuckk/32/6190_2.png) [@Chuckk](https://forum.juce.com/u/Chuckk)\
**Post date:** [April 9, 2023, 1:07pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/33 "2023-04-09T13:07:15Z")

</div>

> [@hilberturi](#):
>
> all publicly available JUCE code  
> on Github or in other places necessarily uses the GPL license - because there is no other  
> option for using JUCE code in public repos.

Are you sure about that?  
I have seen no restriction mentioned that developers who have a paid license may not share their code as they see fit. If you wrote it, you may distribute it under whatever conditions you wish. Is there something in the JUCE paid license terms prohibiting people from sharing their own code in any way?

---

<div class="post-metadata">

**Author:** ![Chuckk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chuckk/32/6190_2.png) [@Chuckk](https://forum.juce.com/u/Chuckk)\
**Post date:** [April 9, 2023, 1:10pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/34 "2023-04-09T13:10:20Z")

</div>

> [@Mrugalla](#):
>
> it shouldn’t matter who chatGPT and copilot is stealing from. it is like sampling in music production, where you do take material from someone else, but change it and its context so much that it’s not a comparable product anymore

Incidentally, I believe you said you live in Germany, right?  
Interesting times.

---

<div class="post-metadata">

**Author:** ![hilberturi](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hilberturi](https://forum.juce.com/u/hilberturi)\
**Post date:** [April 9, 2023, 1:17pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/35 "2023-04-09T13:17:23Z")

</div>

> [@Chuckk](#):
>
> I have seen no restriction mentioned that developers who have a paid license may not share their code as they see fit.

You are right (see also @aamfs earlier post).  
There is no such restriction - but the majority of open source repos using JUCE are GPL licensed.

---

<div class="post-metadata">

**Author:** ![Chuckk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chuckk/32/6190_2.png) [@Chuckk](https://forum.juce.com/u/Chuckk)\
**Post date:** [April 9, 2023, 2:05pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/36 "2023-04-09T14:05:23Z")

</div>

> [@hilberturi](#):
>
> In my view all generated JUCE snippets should be GPL licensed because this applies  
> to nearly all sources they were extracted and mashed up from.  
> ChatGPT or CoPilot should not be a back-door to whitewash Copyleft code so that it can be  
> integrated into closed-source applications.

I agree with you.  
This terminology is a little insidious: “train” and “learn” and even “neuron” encourage equivocation. They named them like that as analogies, but they all imply personhood, like the AI is doing something that its authors aren’t.  
All AI so far is software, a computer program in the sense that it’s a list of instructions that run on a processor. They use the same instruction set, the same AND and NAND and NOR, etc. AI isn’t doing anything computers can’t do, and the process of creating the program to run already has a name, “programming”. The “training” phase is part of the computer programming process that is partially automated with complex algorithms that copy, process and transform large amounts of data, resulting in finalizing the program (adjusting the “weights,” aka variables).  
The AI structure without those variables having been set is nothing. It will output noise. I would contend that the authors of all of that “training” data are in fact coauthors of the AI model. The values of the weights came as much from their work as it did from the AI dev’s work.

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [April 9, 2023, 2:13pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/37 "2023-04-09T14:13:32Z")

</div>

Yes, I’m from germany, but what does that mean to you?

---

<div class="post-metadata">

**Author:** ![Chuckk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chuckk/32/6190_2.png) [@Chuckk](https://forum.juce.com/u/Chuckk)\
**Post date:** [April 9, 2023, 3:52pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/38 "2023-04-09T15:52:30Z")

</div>

Just regarding talk of banning ChatGPT.  
I’ve had some English students who work for the Competition Council (not in Germany) and have had conversations about Europe’s approach to monopolization; albeit not directly about AI, because it hasn’t yet made itself very felt. But I get the impression that the EU and UK are more of what Americans might call “authoritarian” regarding “the market”. Handing out enormous fines to Microsoft, Google, oil and power companies! Where I come from, that’s straight-up communism 🙂

That a company might program their closed-source software with published but not completely free works from millions of authors and then offer a service - not even the software itself - for money, producing output similar to those millions of works, seems unlikely to be accepted with no conditions in the EU.

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [April 9, 2023, 4:09pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/39 "2023-04-09T16:09:29Z")

</div>

The EU is very protective about the people’s privacy (almost tiktok ban) and rights (italy’s chatGPT ban). Some decisions are a bit overkill but I wouldn’t put any specific label, like communism, on it

---

<div class="post-metadata">

**Author:** ![Chuckk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chuckk/32/6190_2.png) [@Chuckk](https://forum.juce.com/u/Chuckk)\
**Post date:** [April 9, 2023, 4:15pm UTC](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694/40 "2023-04-09T16:15:28Z")

</div>

> [@Mrugalla](#):
>
> I wouldn’t put any specific label, like communism, on it

Neither would I, but people where I come from would. I once got harassed by an old-timer in a laundromat because I was wearing a t-shirt with a hammer and sickle on it saying CCCP. He said, “You Russian?” and I understood “rushing”. Amusing misunderstanding, but I felt like an outsider.  
Other Americans might use a term like “interventionism”. Americans are probably fairly split, but policy always seems to favor letting corporations make their own decisions.

Wandered pretty far here. Apologies. I’m curious to see how the rest of Europe will handle this.

[Previous page](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694.md?page=1)

[Next page](https://forum.juce.com/t/i-asked-chatgpt4-to-write-a-synth-using-juce/55694.md?page=3)
