midi-ddsp icon indicating copy to clipboard operation
midi-ddsp copied to clipboard

What is ``input`` in the def call()?

Open Megan8821 opened this issue 3 years ago • 4 comments

Hi, I am looking inside the code. I've seen a lot of methods about def call(self, inputs) in your code, especially looking at this one.

  def call(self, inputs):
    synth_params = self.get_synth_params(inputs)

However, I couldn't find out what's the calculation of inputs, there are some clues I've found. In those codes, inputs is respond to the data in get_fake_data_synthesis_generator, then what are the data and units you input to get_fake_data_synthesis_generator? Frames? Amplitude or anything else?

Thanks!

Megan8821 avatar Sep 16 '22 16:09 Megan8821

Hi, if you are referring to the input to the Synthesis Generator and DDSP Inference, the input format is the one used in training data. Please see https://github.com/magenta/midi-ddsp/issues/52 for more details.

lukewys avatar Sep 16 '22 18:09 lukewys

Thanks for replying. So If I want to input my own data, I need to transfer the format of data to tf.record?

Or let's say what's the way you calculate the attack feature? Do you use DDSP noise magnitude Inference?

Megan8821 avatar Sep 17 '22 01:09 Megan8821

So If I want to input my own data, I need to transfer the format of data to tf.record? Yes.

Or let's say what's the way you calculate the attack feature? Do you use DDSP noise magnitude Inference? This is not related to input format. We calculate the attack feature by taking the average of first 10 frames of noise magnitude used for DDSP synthesis. “Do you use DDSP noise magnitude Inference?” if you are referring to the fact that noise magnitude is estimated from the input, just like DDSP does, then yes, that is correct.

lukewys avatar Sep 18 '22 20:09 lukewys

Got it! So if I use the way as DDSP has done, compute the noise magnitude calculation in DDSP, input the audio with tfrecord format, taking the average of first 10 frames, then we can get the attack values(But still need to figure out how to compute the noise magnitude, seems a little bit complicated for me.).) In another case, I need to compute the attack in another way, then put it in the MIDIDDSP model as the attack parameter. But do you suggest computing attack without using DDSP inference?

Thanks for replying, I appreciate it.

Megan8821 avatar Sep 19 '22 01:09 Megan8821