Re: [music-dsp] WSOLA on RealTime

2018-10-01 Thread Nuno Santos
Hey Alex,

Have you seen this article before?

https://www.surina.net/article/time-and-pitch-scaling.html 


It has a complete and detailed description on how time and pitch scaling works.

Hope it helps! 

Best regards,

Nuno 

> On 1 Oct 2018, at 17:30, Alex Dashevski  wrote:
> 
> Hi,
> 
> I got this answer from Robert:
> WSOLA fundamentally does time-scaling.  time compression or time stretching 
> without changing pitch.  time-scaling is not normally thought of as real-time 
> because your input and output buffer pointers will collide.
> 
> 
> My question is:
> Why buffers will collide ?
> 
> Thanks,
> Alex
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Android related audio group / mailing list?

2016-06-05 Thread Nuno Santos
Laurent,

I have marked the array as volatile to force compile to bypass those kind of 
optimisations and the results were different. I actually had to reduce the 
amount of iterations to only 1 otherwise it would take too long to 
complete. 

I had results of ~130ms for the standard settings and ~102ms for optimised 
settings. Apparently there was a ~20% improvement with that simple example. 

Then I have used a more complex example. Instead of that simple array elements 
multiplication, I started using my own Delay and Reverb units which represents 
most of the processing time during the audio callback.

For this, I have created a 1024 items array filled with a random number between 
0 and 1 and passed this sequentially to delay and reverb. With standard 
settings I have ~3.8us of processing time, however, with optimised settings the 
results tend to zero. This makes me believe the code is not running as 
expected. 

In order to confirm this I need to process an actual sound file and save the 
result to an output file to ensure that I’m listening something mean full.

Question: what can cause code to break if compiled with hard float settings? In 
some of my earlier experiences with hard float settings my app wasn’t even 
opening, or it was behaving very wrong. This is the first time I testing it 
with more simpler cases. 

Thanks in advance,

Regards,

Nuno
 
> On 05 Jun 2016, at 19:21, Laurent de Soras  wrote:
> 
> Nuno Santos wrote:
>> 
>> I’m struggling with performance questions on Android.
>> https://groups.google.com/forum/#!topic/andraudio/zuXnnmZyePk
> 
> Your results tell that your program computes 10^9 operations
> in a few dozen microseconds. There is definitely something
> wrong here because even the most advanced ARM processors are
> not known to be multi-teraflops CPUs.
> 
> Actually the compiler might think it can keep only one loop,
> or even none, given that the result of each loop will always
> be the same, and this result isn’t even used somewhere else
> in the program. You should introduce slight dependencies in
> your test in order to defeat this kind of optimisation.
> 
> The difference between the compiler settings you tried are
> most likely caused by variations in initialisation sequences,
> scheduling glitches or timer inaccuracies.
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Android related audio group / mailing list?

2016-06-05 Thread Nuno Santos
Laurent,

Thanks for your reply. 

In fact I haven’t even initialised the arrays. 

I will try a more complex example and post the results. 

Thanks,

Regards,

Nuno

> On 05 Jun 2016, at 19:21, Laurent de Soras  wrote:
> 
> Nuno Santos wrote:
>> 
>> I’m struggling with performance questions on Android.
>> https://groups.google.com/forum/#!topic/andraudio/zuXnnmZyePk
> 
> Your results tell that your program computes 10^9 operations
> in a few dozen microseconds. There is definitely something
> wrong here because even the most advanced ARM processors are
> not known to be multi-teraflops CPUs.
> 
> Actually the compiler might think it can keep only one loop,
> or even none, given that the result of each loop will always
> be the same, and this result isn’t even used somewhere else
> in the program. You should introduce slight dependencies in
> your test in order to defeat this kind of optimisation.
> 
> The difference between the compiler settings you tried are
> most likely caused by variations in initialisation sequences,
> scheduling glitches or timer inaccuracies.
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Android related audio group / mailing list?

2016-06-05 Thread Nuno Santos
Hi Phil,

I’m struggling with performance questions on Android.

I have posted this question on the Android google group:

https://groups.google.com/forum/#!topic/andraudio/zuXnnmZyePk 
<https://groups.google.com/forum/#!topic/andraudio/zuXnnmZyePk>

If you could give a look and tell me your thoughts about it, that would be 
great.

Best regards,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 29 May 2016, at 21:22, Phil Burk  wrote:
> 
> On Sat, May 28, 2016 at 4:04 AM, grh mailto:g...@mur.at>> wrote:
> Does anyone have contacts to google audio developers? Would be great if
> they could join such a discussion group as well!
> 
> I work for Google on Android Audio. My focus is MIDI, AudioTrack, latency and 
> performance. Also Android TV support.
> 
> I'll try to hang out on andraudio group and post when I can. 
> 
> Phil Burk
> 
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Android related audio group / mailing list?

2016-05-25 Thread Nuno Santos
Patrick,

Now that I had the chance of using Superpowered all I can say is that it 
doesn’t make miracles. It will not provide lower latency than OpenSL already 
gives. Android latency problem is much OS and device dependent.

Looking forward to understand what is new and if it will bring any special 
improvements to our products.

Regards,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 25 May 2016, at 16:26, Patrick Vlaskovits  wrote:
> 
> Speaking of Android, we just released a fully configuarable and performant 
> USB Audio and MIDI library for Android. It’s the Android equivalent of iOS 
> Core Audio and Core MIDI for USB devices.
> 
> http://superpowered.com/android-usb-audio-android-midi 
> <http://superpowered.com/android-usb-audio-android-midi>
> 
> The Superpowered USB Audio and MIDI SDK provides stable, professional, low 
> latency, low jitter, multi-channel audio and MIDI functionality for more than 
> 1 billion active Android devices, letting Android users fully experience and 
> express the sonic power of that Android powered super-computer in their 
> pocket unmuted.
> 
> -Patrick
> CEO, Superpowered Inc. 
> 
> 
> 
> 
> On Wed, May 25, 2016 at 8:15 AM, Nuno Santos  <mailto:nunosan...@imaginando.pt>> wrote:
> I have been testing DRC in 2 different Android devices: Nexus 9 (48000/128 
> buffer size) phone, Bq Aquaris M5 phone (48000/912) buffer size
> 
> Nexus 9 is a beast. I was able to run DRC with full polyphony (8 voices) 
> without any kind of glitch. The fake touches hack was essential to make this 
> happen. Without the fake touches hack I would hear glitches.
> Bq Aquarius M5 has a very similar processor to Nexus 6P and I couldn’t have 
> more than 2 voices running without having some glitches. 
> 
> All DSP code is C++. Reverb, Delay and Chorus represent half of the 
> processing effort the rest is for active voices.
>   
> From my experiences I couldn’t see any kind of effect in performance by 
> compiling the code with NEON enabled. For example, on my Bq phone for a 912 
> buffer size at 48000 my processing code would take the following time with 
> the following flags enabled:
> 
> -Os - ~5ms 
> -O3 - ~5ms
> -Ofast - ~5ms
> -Ofast -mfpu=neon - ~5ms
> 
> No significant changes in performance with different flags. What kind of 
> flags are you guys using for your Android apps?
> 
> I don’t need to worry with this on iOS though. It simply works! 
> 
> Regards,
> 
> Nuno Santos
> Founder / CEO / CTO
> www.imaginando.pt <http://www.imaginando.pt/>
> +351 91 621 69 62 
> 
>> On 25 May 2016, at 12:24, Jean-Baptiste Thiebaut > <mailto:jean-bapti...@roli.com>> wrote:
>> 
>> At JUCE / ROLI we've been working with Google for over a year to optimize 
>> audio latency, throttle, etc for cross platform apps. Our app is featured 
>> also in the Youtube video from Google IO, and it runs on some devices with 
>> performances comparable to iOS.  
>> 
>> Whether you are using JUCE or not, you're welcome to post on our forum 
>> (forum.juce.com <http://forum.juce.com/>). 
>> 
>> Sent from my mobile
>> 
>>> On 25 May 2016, at 11:57, grh mailto:g...@mur.at>> wrote:
>>> 
>>> Hallo!
>>> 
>>> Thanks Nuno, it was a great demo ;)
>>> 
>>> LG
>>> Georg
>>> 
>>>> On 2016-05-25 12:46, Nuno Santos wrote:
>>>> Hi George,
>>>> 
>>>> I would be interested in such a community as well. Specially regarding
>>>> audio performance. We have recently released DRC (one of the apps that
>>>> has been featured on Google I/O Android High Performance Audio) and we
>>>> are mostly interested in squeezing performance out of it. It is
>>>> incredible the performance differences between iOS and Android. The DSP
>>>> code is shared among both and I still have glitch problems in Android
>>>> powerful devices.
>>>> 
>>>> One option could be creating a slack channel. 
>>>> 
>>>> Regards,
>>>> 
>>>> Nuno Santos
>>>> Founder / CEO / CTO
>>>> www.imaginando.pt <http://www.imaginando.pt/> <http://www.imaginando.pt 
>>>> <http://www.imaginando.pt/>>
>>>> +351 91 621 69 62 
>>>> 
>>>>> On 25 May 2016, at 11:36, grh mailto:g...@mur.at> 
>>>>> <mailto:g...@mur.at <mailto:g...@mur.at>>> wrote:
>>>>> 
>>>>> Hallo music-dsp list!
>>>>> 
>>>>> Sorry for being off topi

Re: [music-dsp] Android related audio group / mailing list?

2016-05-25 Thread Nuno Santos
I have been testing DRC in 2 different Android devices: Nexus 9 (48000/128 
buffer size) phone, Bq Aquaris M5 phone (48000/912) buffer size

Nexus 9 is a beast. I was able to run DRC with full polyphony (8 voices) 
without any kind of glitch. The fake touches hack was essential to make this 
happen. Without the fake touches hack I would hear glitches.
Bq Aquarius M5 has a very similar processor to Nexus 6P and I couldn’t have 
more than 2 voices running without having some glitches. 

All DSP code is C++. Reverb, Delay and Chorus represent half of the processing 
effort the rest is for active voices.

From my experiences I couldn’t see any kind of effect in performance by 
compiling the code with NEON enabled. For example, on my Bq phone for a 912 
buffer size at 48000 my processing code would take the following time with the 
following flags enabled:

-Os - ~5ms 
-O3 - ~5ms
-Ofast - ~5ms
-Ofast -mfpu=neon - ~5ms

No significant changes in performance with different flags. What kind of flags 
are you guys using for your Android apps?

I don’t need to worry with this on iOS though. It simply works! 

Regards,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 25 May 2016, at 12:24, Jean-Baptiste Thiebaut  
> wrote:
> 
> At JUCE / ROLI we've been working with Google for over a year to optimize 
> audio latency, throttle, etc for cross platform apps. Our app is featured 
> also in the Youtube video from Google IO, and it runs on some devices with 
> performances comparable to iOS.  
> 
> Whether you are using JUCE or not, you're welcome to post on our forum 
> (forum.juce.com). 
> 
> Sent from my mobile
> 
>> On 25 May 2016, at 11:57, grh  wrote:
>> 
>> Hallo!
>> 
>> Thanks Nuno, it was a great demo ;)
>> 
>> LG
>> Georg
>> 
>>> On 2016-05-25 12:46, Nuno Santos wrote:
>>> Hi George,
>>> 
>>> I would be interested in such a community as well. Specially regarding
>>> audio performance. We have recently released DRC (one of the apps that
>>> has been featured on Google I/O Android High Performance Audio) and we
>>> are mostly interested in squeezing performance out of it. It is
>>> incredible the performance differences between iOS and Android. The DSP
>>> code is shared among both and I still have glitch problems in Android
>>> powerful devices.
>>> 
>>> One option could be creating a slack channel. 
>>> 
>>> Regards,
>>> 
>>> Nuno Santos
>>> Founder / CEO / CTO
>>> www.imaginando.pt <http://www.imaginando.pt>
>>> +351 91 621 69 62
>>> 
>>>> On 25 May 2016, at 11:36, grh mailto:g...@mur.at>> wrote:
>>>> 
>>>> Hallo music-dsp list!
>>>> 
>>>> Sorry for being off topic, but does someone know an active discussion
>>>> group / mailing list about android audio?
>>>> (There is quite a lot of progress lately, see for example [1])
>>>> 5 years ago a list was announced here [2], which does not seem to be
>>>> active anymore ...
>>>> 
>>>> We just created a simple android audio editor [3] and would be very much
>>>> interested into a discussion of common infrastructure like audio
>>>> plugins/effects (like SAPA from Samsung) or copy/paste between audio apps.
>>>> I think that would be important for the audio ecosystem on Android.
>>>> 
>>>> Thanks for any hints,
>>>> LG
>>>> Georg
>>>> 
>>>> [1]: https://www.youtube.com/watch?v=F2ZDp-eNrh4
>>>> [2]:
>>>> http://music-dsp.music.columbia.narkive.com/zbYgicxy/new-android-audio-developers-mailing-list
>>>> [3]:
>>>> https://play.google.com/store/apps/details?id=com.auphonic.auphonicrecorder
>>>> 
>>>> -- 
>>>> auphonic - audio post production software and web service
>>>> http://auphonic.com
>>>> 
>>>> ___
>>>> dupswapdrop: music-dsp mailing list
>>>> music-dsp@music.columbia.edu
>>>> https://lists.columbia.edu/mailman/listinfo/music-dsp
>>> 
>>> 
>>> 
>>> ___
>>> dupswapdrop: music-dsp mailing list
>>> music-dsp@music.columbia.edu
>>> https://lists.columbia.edu/mailman/listinfo/music-dsp
>> 
>> 
>> -- 
>> auphonic - audio post production software and web service
>> http://auphonic.com
>> 
>> ___
>> dupswapdrop: 

Re: [music-dsp] Android related audio group / mailing list?

2016-05-25 Thread Nuno Santos
Hi George,

I would be interested in such a community as well. Specially regarding audio 
performance. We have recently released DRC (one of the apps that has been 
featured on Google I/O Android High Performance Audio) and we are mostly 
interested in squeezing performance out of it. It is incredible the performance 
differences between iOS and Android. The DSP code is shared among both and I 
still have glitch problems in Android powerful devices.

One option could be creating a slack channel. 

Regards,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 25 May 2016, at 11:36, grh  wrote:
> 
> Hallo music-dsp list!
> 
> Sorry for being off topic, but does someone know an active discussion
> group / mailing list about android audio?
> (There is quite a lot of progress lately, see for example [1])
> 5 years ago a list was announced here [2], which does not seem to be
> active anymore ...
> 
> We just created a simple android audio editor [3] and would be very much
> interested into a discussion of common infrastructure like audio
> plugins/effects (like SAPA from Samsung) or copy/paste between audio apps.
> I think that would be important for the audio ecosystem on Android.
> 
> Thanks for any hints,
> LG
> Georg
> 
> [1]: https://www.youtube.com/watch?v=F2ZDp-eNrh4
> [2]:
> http://music-dsp.music.columbia.narkive.com/zbYgicxy/new-android-audio-developers-mailing-list
> [3]:
> https://play.google.com/store/apps/details?id=com.auphonic.auphonicrecorder
> 
> -- 
> auphonic - audio post production software and web service
> http://auphonic.com
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] How to notify host of parameter was modified [VST 2.4]?

2015-12-08 Thread Nuno Santos
Thanks guys for your replies! 

Regards,

--
Nuno Santos

No dia 08/12/2015, às 21:35, Sham Beam  escreveu:

> Hi Nuno,
> 
> Take a look at the BeginEdit(), EndEdit() and SetVstParameterAutomated() 
> functions.
> 
> http://www.asseca.org/vst-24-specs/amBeginEdit.html
> http://www.asseca.org/vst-24-specs/amEndEdit.html
> http://www.asseca.org/vst-24-specs/amAutomate.html
> 
> 
> Regards,
> Shannon
> 
> 
> 
> 
> 
>> On 12/9/2015 2:29 AM, Nuno Santos wrote:
>> Hi,
>> 
>> This question is about VST plugin development and maybe it got asked before, 
>> but after an hour googling around for VstEvents, VstMidiEvents, 
>> sendVstEventsToHost, etc, I still couldn't find an answer.
>> 
>> I'm trying to notify Ableton Live that a parameter has changed. The device 
>> on Live has the configure button toggled and it's waiting for parameter 
>> input. I was currently trying the following code:
>> 
>> void Vst::init()
>> {
>> size_t size = sizeof(VstEvents) + sizeof(VstEvent*);
>> 
>> _events = (VstEvents*)malloc(size);
>> _events->events[0] = (VstEvent*)std::calloc(1, sizeof(VstMidiEvent));
>> _events->numEvents=1;
>> 
>> VstEvent* e = _events->events[0];
>> 
>> e->type = kVstMidiType;
>> e->byteSize = sizeof(VstMidiEvent);
>> }
>> 
>> VstInt32 IVst::canDo(const char* feature)
>> {
>> if (!strcmp(feature, "sendVstEvents")) return 1;
>> if (!strcmp(feature, "sendVstMidiEvent")) return 1;
>> if (!strcmp(feature, "receiveVstEvents")) return 1;
>> if (!strcmp(feature, "receiveVstMidiEvent")) return 1;
>> if (!strcmp(feature, "midiProgramNames")) return 1;
>> 
>> return -1;
>> }
>> 
>> void Vst::parameterChanged(int id, float value)
>> {
>> _events->events[0]->data[0]=0xb0;
>> _events->events[0]->data[1]=id;
>> _events->events[0]->data[2]=float*127;
>> _events->events[0]->data[3]=0;
>> 
>> sendVstEventsToHost(_events); // the result of this call is true
>> }
>> 
>> But this didn't made the trick.  I am trying VstMidiEvent because the 2.4 
>> headers say kVstParameterType is deprecated. What am I missing?
>> 
>> Thanks in advance,
>> 
>> Regards,
>> 
>> Nuno
>> ___
>> dupswapdrop: music-dsp mailing list
>> music-dsp@music.columbia.edu
>> https://lists.columbia.edu/mailman/listinfo/music-dsp
>> 
> 
> 
> -- 
> Sham Beam
> 
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp
> 
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] How to notify host of parameter was modified [VST 2.4]?

2015-12-08 Thread Nuno Santos
Hi,

This question is about VST plugin development and maybe it got asked before, 
but after an hour googling around for VstEvents, VstMidiEvents, 
sendVstEventsToHost, etc, I still couldn't find an answer. 

I'm trying to notify Ableton Live that a parameter has changed. The device on 
Live has the configure button toggled and it's waiting for parameter input. I 
was currently trying the following code:

void Vst::init()
{
size_t size = sizeof(VstEvents) + sizeof(VstEvent*);

_events = (VstEvents*)malloc(size);
_events->events[0] = (VstEvent*)std::calloc(1, sizeof(VstMidiEvent));
_events->numEvents=1;

VstEvent* e = _events->events[0];

e->type = kVstMidiType;
e->byteSize = sizeof(VstMidiEvent);
}

VstInt32 IVst::canDo(const char* feature)
{
if (!strcmp(feature, "sendVstEvents")) return 1;
if (!strcmp(feature, "sendVstMidiEvent")) return 1;
if (!strcmp(feature, "receiveVstEvents")) return 1;
if (!strcmp(feature, "receiveVstMidiEvent")) return 1;
if (!strcmp(feature, "midiProgramNames")) return 1;

return -1;
}

void Vst::parameterChanged(int id, float value)
{
_events->events[0]->data[0]=0xb0;
_events->events[0]->data[1]=id;
_events->events[0]->data[2]=float*127;
_events->events[0]->data[3]=0;

sendVstEventsToHost(_events); // the result of this call is true
}

But this didn't made the trick.  I am trying VstMidiEvent because the 2.4 
headers say kVstParameterType is deprecated. What am I missing?

Thanks in advance,

Regards,

Nuno
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nuno Santos
Nigel,

You wordpress blog was crucial to understand how to implement a band limited 
oscillator. I confess there were some small details I couldn’t figure out by 
that time and then moved on. 

Right now I have a really complete synthesiser engine and I haven’t changed or 
improved the oscillators section since then.

Question: How should I calculate the minimum table length size to have no 
artefacts on a LFO? 

To build the oscillators tables I’m using that multi table technic you describe 
on your waveforms series posts where maxHarms is: int maxHarms = 44100.f / (3.0 
* BASE_FREQ) + 0.5; Is this an heuristic? 

For the LFO tables I have only one table and the maxHarms is SAMPLE_RATE/2

And YES Alan, I’m using a interpolation algorithm but currently only on core 
Delay unit. No interpolation on the oscillators unit right now. I’m using the 
cubic hermit and it definitely contributes for a better sound.

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 11 Sep 2015, at 17:39, Nigel Redmon  wrote:
> 
> Hi Nuno,
> 
> First, can I suggest that you take a look at my series on wavetable 
> oscillators? It covers some of the questions you have, and in particular goes 
> into detail about table length.
> 
> Well, this is annoying, I think an automated WordPress update killed my site, 
> I need to look into it. But normally, go to earlevel.com 
> <http://earlevel.com/> and click the right-column topics for oscillators and 
> the series will come up. But you can get the gist of it from my video:
> 
> https://youtu.be/k81hoZODOP0
> 
> Note that linear interpolation would help your low frequency oscillator 
> issue, and help your oscillator at high frequencies too. 2048 is a good 
> minimum table length for 20 Hz and up, so you’re in the right ballpark. 
> (Longer if you aren’t using interpolation between samples, and longer to get 
> sharp edges for LFO—for instance, a low frequency sawtooth won’t have a crisp 
> “tick tick tick”, but a more muffled one, at 1 Hz if your table is only 2048.)
> 
> Nigel
> 
> 
>> On Sep 11, 2015, at 8:13 AM, Nuno Santos > <mailto:nunosan...@imaginando.pt>> wrote:
>> 
>> Hi,
>> 
>> Curiosity, by sinc do you mean sin function?
>> 
>> Before anything: I’m a newbie. If I say something stupid don’t throw fire at 
>> me, please! :)
>> 
>> During this last year I have been developing a synthesizer. My lookup table 
>> hadn’t more than 2048 samples. The sounds coming out from the oscillators 
>> was alright.
>> 
>> When I got to develop a chorus, I was using the very same table for the lfo 
>> oscillators. The modulation was causing artifacts. It took me a while to 
>> understand that the problem was being caused by the lack of resolution of my 
>> tables. I ended up with a table 441000 length, for a 44100 sample rate. The 
>> artifacts were gone! My conclusion was that the raw steps were causing 
>> audible artifacts and increasing the resolution was the solution.
>> 
>> I haven’t tried to find the lowest point of resolution that doesn’t cause 
>> artifacts. I was so tired of trying to solve the artifacts that I have only 
>> remember this problem when I saw this question from Victor.
>> 
>> For the oscillators table I have simply doubled the initial value and now 
>> i’m using 4096.
>> 
>> What do you guys think of this? 
>> 
>> Thanks,
>> 
>> Regards,
>> 
>> Nuno
>> 
>>> On 10/09/2015, at 20:15, Victor Lazzarini >> <mailto:victor.lazzar...@nuim.ie>> wrote:
>>> 
>>> Is there much to gain in going above a 1024 window, when doing sinc 
>>> interpolation (for table lookup applications)?
>>> 
>>> (simple question; no intention of starting flame wars; not asking about any 
>>> other method, either ;) )
>>> 
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>> ___
>>> dupswapdrop: music-dsp mailing list
>>> music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
>>> https://lists.columbia.edu/mailman/listinfo/music-dsp
>> 
>> 
>> ___
>> dupswapdrop: music-dsp mailing list
>> music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
>> https://lists.columbia.edu/mailman/listinfo/music-dsp
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nuno Santos
Thanks! :)

> On 11 Sep 2015, at 16:43, Ross Bencina  wrote:
> 
> On 12/09/2015 1:13 AM, Nuno Santos wrote:
>> Curiosity, by sinc do you mean sin function?
> 
> sinc(x) := sin(x)/x
> 
> https://en.wikipedia.org/wiki/Sinc_function
> 
> https://ccrma.stanford.edu/~jos/pasp/Windowed_Sinc_Interpolation.html
> 
> Cheers,
> 
> Ross.
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] sinc interp, higher orders

2015-09-11 Thread Nuno Santos
Hi,

Curiosity, by sinc do you mean sin function?

Before anything: I’m a newbie. If I say something stupid don’t throw fire at 
me, please! :)

During this last year I have been developing a synthesizer. My lookup table 
hadn’t more than 2048 samples. The sounds coming out from the oscillators was 
alright.

When I got to develop a chorus, I was using the very same table for the lfo 
oscillators. The modulation was causing artifacts. It took me a while to 
understand that the problem was being caused by the lack of resolution of my 
tables. I ended up with a table 441000 length, for a 44100 sample rate. The 
artifacts were gone! My conclusion was that the raw steps were causing audible 
artifacts and increasing the resolution was the solution.

I haven’t tried to find the lowest point of resolution that doesn’t cause 
artifacts. I was so tired of trying to solve the artifacts that I have only 
remember this problem when I saw this question from Victor.

For the oscillators table I have simply doubled the initial value and now i’m 
using 4096.

What do you guys think of this? 

Thanks,

Regards,

Nuno

> On 10/09/2015, at 20:15, Victor Lazzarini  wrote:
> 
> Is there much to gain in going above a 1024 window, when doing sinc 
> interpolation (for table lookup applications)?
> 
> (simple question; no intention of starting flame wars; not asking about any 
> other method, either ;) )
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] warts in JUCE (was Re: Implementing GMM for voice diarization on iOS and Android)

2015-09-02 Thread Nuno Santos
> On 02 Sep 2015, at 22:14, Tom Duffy  wrote:
> 
> Qt is worse though in this respect. I ported a QT3 application to QT5
> and ended up touching over 90% of the GUI code to get it to match
> the new APIs and paradigms.

Qt 3 to Qt 5? What were you expecting? :)

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Implementing GMM for voice diarization on iOS and Android

2015-09-02 Thread Nuno Santos
Stefan,

I would recommend Qt. It provides you easy integration with C libraries and 
everything is written in C++. It’s gives you iOS/Android/OSX/Windows/Linux 
deploy ability seamless.

Best,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 02 Sep 2015, at 10:16, Stefan H Singer  wrote:
> 
> Hi all.
> 
> It's probably been 15 years or so since I write to this list... 
> 
> Sorry if this is not MUSIC DSP per se, but just DSP.
> 
> I'm about to have a go at implementing voice diarization using GMM on mobile 
> phones, to analyse conversations, hopefully in real time. 
> 
> That being said, it seems the most common library is LIUM, which is written 
> in Java. I've found for instance http://gforge.inria.fr/projects/audioseg 
> <http://gforge.inria.fr/projects/audioseg> which is written in C, so one 
> SHOULD be able to write native libraries for both platforms that exposes that 
> library to the apps.
> 
> If anyone knows about it, I'm considering using Xamarin for the actual app 
> coding, which supports binding to native libraries for both platforms.
> 
> Anyone has any better ideas? Or is that the best way forward?
> 
> Sorry for being slightly off topic!
> 
> Thanks,
> Stefan
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] R: Glitch/Alias free modulated delay

2015-03-21 Thread Nuno Santos
Guys, 

Yesterday I have found the REAL reason of my problem.

Of course all the discussion here did in fact help to find other issues. But 
the reason I was hearing artifacts when modulating was because LFO value was 
being read from a 2048 size wavetable…

I have generated a 441000 size wavetable to allow a 0.1 hertz of minimum 
frequency and it is working like charm.

I still had a crackle and it was being somehow generated by the table 
normalisation. This is an issue that I still have to investigate.

I also need to measure the differences between using interpolation or not 
(audio quality vs overall performance).

Thanks for your help and comments they were really interesting.

Regards,

Nuno

> On 21 Mar 2015, at 11:00, Marco Lo Monaco  wrote:
> 
> That's exactly what I would also suggest!
> The linear interpolation is used in commercial products more than one could 
> think.
> 
>> -Messaggio originale-
>> Da: music-dsp-boun...@music.columbia.edu [mailto:music-dsp-
>> boun...@music.columbia.edu] Per conto di Nigel Redmon
>> Inviato: sabato 21 marzo 2015 00:07
>> A: A discussion list for music-related DSP
>> Oggetto: Re: [music-dsp] Glitch/Alias free modulated delay
>> 
>> Suggestion:
>> 
>> Make it work with linear interpolation first.
>> 
>> The implementation is extremely simple—it won’t take much of your time to
>> try it—and you’ll eliminate most of the problems (buffer wrap, etc.) without
>> getting confused about whether your interpolation scheme is the fault.
>> 
>> Plus, you’ll have a baseline to compare higher-order improvements with.
>> Linear interpolation sounds better than most people would guess, with
>> typical musical input (musical interments usually have weaker upper
>> harmonics), so you’ll have a better idea of whether you’re getting your
>> money’s worth with more elaborate methods.
>> 
>> 
>> 
>>> On Mar 20, 2015, at 2:10 PM, Nuno Santos 
>> wrote:
>>> 
>>> 
>>>> On 20 Mar 2015, at 18:58, Alan Wolfe  wrote:
>>>> 
>>>> One thing to watch out for is to make sure you are not looking
>>>> backwards AND forwards in time, but only looking BACK in time.
>>> 
>>> This is how I calculate the read index:
>>> 
>>> float t=_writeIndex-_time-_modulation*_modulationRange;
>>> 
>>> if(t<0)
>>>   t+=_size;
>>> 
>>>> 
>>>> When you say you have an LFO going from -1 to 1 that makes me think
>>>> you might be going FORWARD in the buffer as well as backwards, which
>>>> would definitely cause audible problems.
>>> 
>>> I have tried to rescale the LFO to fit between 0 and 1 and it doing the same
>> artefacts:
>>> 
>>> 
>>> // this where delay gets updated with lfo float lfo =
>>> (_lfo.step()-1.f)/2.f;
>>> 
>>> delay.setModulation(lfo);
>>> 
>>>> 
>>>> your LFO really should go between -1 and 0, you then multiply that
>>>> value by the number of samples in your buffer (minus 1 if needed,
>>>> depending on your design and timing in your code), and then subtract
>>>> that value from your "write index" into the buffer, making sure to
>>>> handle the case of going negative, where your subtracted offset is
>>>> greater than your current write index.
>>> 
>>> I even tried to change from
>>> 
>>> _time+_modulation*_modulationRange
>>> 
>>> to
>>> 
>>> _time-_modulation*_modulationRange
>>> 
>>> Exactly the same issues….
>>> 
>>> :/
>> 
>> --
>> dupswapdrop -- the music-dsp mailing list and website:
>> subscription info, FAQ, source code archive, list archive, book reviews, dsp
>> links http://music.columbia.edu/cmc/music-dsp
>> http://music.columbia.edu/mailman/listinfo/music-dsp
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Glitch/Alias free modulated delay

2015-03-20 Thread Nuno Santos

> On 20 Mar 2015, at 18:58, Alan Wolfe  wrote:
> 
> One thing to watch out for is to make sure you are not looking
> backwards AND forwards in time, but only looking BACK in time.

This is how I calculate the read index:

float t=_writeIndex-_time-_modulation*_modulationRange;

if(t<0)
t+=_size;

> 
> When you say you have an LFO going from -1 to 1 that makes me think
> you might be going FORWARD in the buffer as well as backwards, which
> would definitely cause audible problems.

I have tried to rescale the LFO to fit between 0 and 1 and it doing the same 
artefacts:


// this where delay gets updated with lfo
float lfo = (_lfo.step()-1.f)/2.f;

delay.setModulation(lfo);

> 
> your LFO really should go between -1 and 0, you then multiply that
> value by the number of samples in your buffer (minus 1 if needed,
> depending on your design and timing in your code), and then subtract
> that value from your "write index" into the buffer, making sure to
> handle the case of going negative, where your subtracted offset is
> greater than your current write index.

I even tried to change from 

_time+_modulation*_modulationRange

to 

_time-_modulation*_modulationRange 

Exactly the same issues….

:/

> 
> On Fri, Mar 20, 2015 at 11:51 AM, Marco Lo Monaco
>  wrote:
>> How often do you update the LFO? Every buffersize (32/64 samples)?
>> 
>> M.
>> 
>>> -Messaggio originale-
>>> Da: music-dsp-boun...@music.columbia.edu [mailto:music-dsp-
>>> boun...@music.columbia.edu] Per conto di Nuno Santos
>>> Inviato: venerdì 20 marzo 2015 19:06
>>> A: A discussion list for music-related DSP
>>> Oggetto: Re: [music-dsp] Glitch/Alias free modulated delay
>>> 
>>> Hi,
>>> 
>>> Today I have used a piece of code which is on musicdsp for testing this out
>>> again.
>>> 
>>> http://musicdsp.org/archive.php?classid=4#98
>>> <http://musicdsp.org/archive.php?classid=4#98>
>>> 
>>> I was able to have a delay changing in time without any kind of artefact or
>>> glitch. However I have only managed to get this results by changing the
>>> parameter by myself.
>>> 
>>> When I say, manually moving the parameter by myself I say that I update a
>>> property which will be linearly interpolated in time (500ms).
>>> 
>>> When I try to apply the modulation which is a value between -1 and 1, that
>>> comes from an LFO, I always end up with artefacts and noise
>>> 
>>> I don’t understand why it works so well when I move the parameter value
>>> (which is also changing constantly due to interpolation, and it doesn’t work
>>> when I apply the modulation with the lo…
>>> 
>>> Any ideas?
>>> 
>>> This is my current code
>>> 
>>> void IDelay::read(IAudioSample *output)
>>> {
>>>double t=double(_writeIndex)-_time; // works perfectly moving the
>>> handle manually with the value being interpolated before getting the
>>> variable _time;
>>>//double t=double(_writeIndex)-_time+_modulation*_modulationRange;
>>> 
>>>// clip lookback buffer-bound
>>>if(t<0.0)
>>>t=_size+t;
>>> 
>>>// compute interpolation left-floor
>>>int const index0=int(t);
>>> 
>>>// compute interpolation right-floor
>>>int index_1=index0-1;
>>>int index1=index0+1;
>>>int index2=index0+2;
>>> 
>>>// clip interp. buffer-bound
>>>if(index_1<0)index_1=_size-1;
>>>if(index1>=_size)index1=0;
>>>if(index2>=_size)index2=0;
>>> 
>>>// get neighbourgh samples
>>>float const y_1= _buffer[index_1];
>>>float const y0 = _buffer[index0];
>>>float const y1 = _buffer[index1];
>>>float const y2 = _buffer[index2];
>>> 
>>>// compute interpolation x
>>>float const x=(float)t-(float)index0;
>>> 
>>>// calculate
>>>float const c0 = y0;
>>>float const c1 = 0.5f*(y1-y_1);
>>>float const c2 = y_1 - 2.5f*y0 + 2.0f*y1 - 0.5f*y2;
>>>float const c3 = 0.5f*(y2-y_1) + 1.5f*(y0-y1);
>>> 
>>>*output=((c3*x+c2)*x+c1)*x+c0;
>>> }
>>>> On 20 Mar 2015, at 14:20, Bjorn Roche >> <mailto:bj...@shimmeo.com>> wrote:
>>>> 
>>>> Interpolating the sample value is not sufficient to eliminate artifacts.
>>>> You also need to eliminate glitches that occur when jumping from one
>&

Re: [music-dsp] R: Glitch/Alias free modulated delay

2015-03-20 Thread Nuno Santos
I will try it and let you know the results.

> On 20 Mar 2015, at 20:00, robert bristow-johnson  
> wrote:
> 
> No dia 20/03/2015, às 18:51, Marco Lo Monaco  
> escreveu:
> 
> 
>> How often do you update the LFO? Every buffersize (32/64 samples)?
>> 
> 
> On 3/20/15 3:37 PM, Nuno Santos wrote:
>> Every sample
>> 
>> 
> 
> okay, Nuno, can you check to see that your code (which i am refactoring a 
> little):
> 
>float y_1= _buffer[int(readIndex(t,-1))];
>float y0 = _buffer[int(readIndex(t,0))];
>float y1 = _buffer[int(readIndex(t,1))];
>float y2 = _buffer[int(readIndex(t,2))];
>float x = readIndex(t,0)-int(readIndex(t,0));
> 
>float sf = ( ( (0.5f*(y2-y_1)+1.5f*(y0-y1))*x + 
> (y_1-2.5f*y0+2.0f*y1-0.5f*y2) )*x + 0.5f*(y1-y_1) )*x + y0;
> 
> 
> is equivalent to:
> 
> 
>float y_1= _buffer[int(readIndex(t,-1))];
>float y0 = _buffer[int(readIndex(t,0))];
>float y1 = _buffer[int(readIndex(t,1))];
>float y2 = _buffer[int(readIndex(t,2))];
>float x = readIndex(t,0)-int(readIndex(t,0));
>float x2 = x*x;
>float x3 = x2*x;
> 
>float sf = 0.5f*(   (  -x2 +  x3)*y2
>  + (  x + 4.0f*x2 - 3.0f*x3)*y1
>  + (2.0f- 5.0f*x2 + 3.0f*x3)*y0
>  + ( -x + 2.0f*x2 -  x3)*y_1
>);
> 
> ???
> 
> 
> i realize that you're using "Horner's method" of polynomial evaluation, which 
> is fine.  it's just hard to see the equivalence.
> 
> 
> because if it is not, my first guess would be that your Hermite interpolation 
> is not done correctly.
> 
> or maybe one (or both) of us got x turned around and it should be replaced by 
> (1.0f - x).  which is the most recent sample in real time?  y2 or y_1?
> 
> -- 
> 
> r b-j  r...@audioimagination.com
> 
> "Imagination is more important than knowledge."
> 
> 
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] R: Glitch/Alias free modulated delay

2015-03-20 Thread Nuno Santos
Every sample

--
Nuno Santos

No dia 20/03/2015, às 18:51, Marco Lo Monaco  
escreveu:

> How often do you update the LFO? Every buffersize (32/64 samples)?
> 
> M.
> 
>> -Messaggio originale-
>> Da: music-dsp-boun...@music.columbia.edu [mailto:music-dsp-
>> boun...@music.columbia.edu] Per conto di Nuno Santos
>> Inviato: venerdì 20 marzo 2015 19:06
>> A: A discussion list for music-related DSP
>> Oggetto: Re: [music-dsp] Glitch/Alias free modulated delay
>> 
>> Hi,
>> 
>> Today I have used a piece of code which is on musicdsp for testing this out
>> again.
>> 
>> http://musicdsp.org/archive.php?classid=4#98
>> <http://musicdsp.org/archive.php?classid=4#98>
>> 
>> I was able to have a delay changing in time without any kind of artefact or
>> glitch. However I have only managed to get this results by changing the
>> parameter by myself.
>> 
>> When I say, manually moving the parameter by myself I say that I update a
>> property which will be linearly interpolated in time (500ms).
>> 
>> When I try to apply the modulation which is a value between -1 and 1, that
>> comes from an LFO, I always end up with artefacts and noise
>> 
>> I don’t understand why it works so well when I move the parameter value
>> (which is also changing constantly due to interpolation, and it doesn’t work
>> when I apply the modulation with the lo…
>> 
>> Any ideas?
>> 
>> This is my current code
>> 
>> void IDelay::read(IAudioSample *output)
>> {
>>double t=double(_writeIndex)-_time; // works perfectly moving the
>> handle manually with the value being interpolated before getting the
>> variable _time;
>>//double t=double(_writeIndex)-_time+_modulation*_modulationRange;
>> 
>>// clip lookback buffer-bound
>>if(t<0.0)
>>t=_size+t;
>> 
>>// compute interpolation left-floor
>>int const index0=int(t);
>> 
>>// compute interpolation right-floor
>>int index_1=index0-1;
>>int index1=index0+1;
>>int index2=index0+2;
>> 
>>// clip interp. buffer-bound
>>if(index_1<0)index_1=_size-1;
>>if(index1>=_size)index1=0;
>>if(index2>=_size)index2=0;
>> 
>>// get neighbourgh samples
>>float const y_1= _buffer[index_1];
>>float const y0 = _buffer[index0];
>>float const y1 = _buffer[index1];
>>float const y2 = _buffer[index2];
>> 
>>// compute interpolation x
>>float const x=(float)t-(float)index0;
>> 
>>// calculate
>>float const c0 = y0;
>>float const c1 = 0.5f*(y1-y_1);
>>float const c2 = y_1 - 2.5f*y0 + 2.0f*y1 - 0.5f*y2;
>>float const c3 = 0.5f*(y2-y_1) + 1.5f*(y0-y1);
>> 
>>*output=((c3*x+c2)*x+c1)*x+c0;
>> }
>>>> On 20 Mar 2015, at 14:20, Bjorn Roche >> <mailto:bj...@shimmeo.com>> wrote:
>>> 
>>> Interpolating the sample value is not sufficient to eliminate artifacts.
>>> You also need to eliminate glitches that occur when jumping from one
>>> time value to another. In other words: no matter how good your
>>> sample-value interpolation is, you will still introduce artifacts when
>>> changing the delay time. A steep low-pass filter going into the delay
>>> line would be one way to solve this. (this is the idea of
>>> "bandlimiting" alluded to earlier in this discussion.)
>>> 
>>> I can say from experience that you absolutely must take this into
>>> account, but, if memory serves (which it may not), the quality of
>>> interpolation and filtering is not that important. I am pretty sure
>>> I've written code to handle both cases using something super simple
>>> and efficient like linear interpolation and it sounded surprisingly
>>> good, which is to say everyone else on the project thought it sounded
>>> great, and that was enough to consider it done on that particular project.
>>> 
>>> HTH
>>> 
>>> 
>>> 
>>> On Fri, Mar 20, 2015 at 6:43 AM, Steven Cook
>>> mailto:stevenpaulc...@tiscali.co.uk>>
>>> wrote:
>>> 
>>>> 
>>>> Let suppose that I fix the errors In the algorithm. Is this
>>>> sufficient
>>>>> for a quality delay time
>>>>> Modulation? Or will I need more advance technics?
>>>> 
>>>> That's a matter of opinion :-) My opinion is that the hermite
>>>> interpolation you're using her

Re: [music-dsp] Glitch/Alias free modulated delay

2015-03-20 Thread Nuno Santos
Hi,

Today I have used a piece of code which is on musicdsp for testing this out 
again.

http://musicdsp.org/archive.php?classid=4#98 
<http://musicdsp.org/archive.php?classid=4#98>

I was able to have a delay changing in time without any kind of artefact or 
glitch. However I have only managed to get this results by changing the 
parameter by myself.

When I say, manually moving the parameter by myself I say that I update a 
property which will be linearly interpolated in time (500ms).

When I try to apply the modulation which is a value between -1 and 1, that 
comes from an LFO, I always end up with artefacts and noise

I don’t understand why it works so well when I move the parameter value (which 
is also changing constantly due to interpolation, and it doesn’t work when I 
apply the modulation with the lo… 

Any ideas?

This is my current code

void IDelay::read(IAudioSample *output)
{
double t=double(_writeIndex)-_time; // works perfectly moving the handle 
manually with the value being interpolated before getting the variable _time;
//double t=double(_writeIndex)-_time+_modulation*_modulationRange; 

// clip lookback buffer-bound
if(t<0.0)
t=_size+t;

// compute interpolation left-floor
int const index0=int(t);

// compute interpolation right-floor
int index_1=index0-1;
int index1=index0+1;
int index2=index0+2;

// clip interp. buffer-bound
if(index_1<0)index_1=_size-1;
if(index1>=_size)index1=0;
if(index2>=_size)index2=0;

// get neighbourgh samples
float const y_1= _buffer[index_1];
float const y0 = _buffer[index0];
float const y1 = _buffer[index1];
float const y2 = _buffer[index2];

// compute interpolation x
float const x=(float)t-(float)index0;

// calculate
float const c0 = y0;
float const c1 = 0.5f*(y1-y_1);
float const c2 = y_1 - 2.5f*y0 + 2.0f*y1 - 0.5f*y2;
float const c3 = 0.5f*(y2-y_1) + 1.5f*(y0-y1);

*output=((c3*x+c2)*x+c1)*x+c0;
}
> On 20 Mar 2015, at 14:20, Bjorn Roche  <mailto:bj...@shimmeo.com>> wrote:
> 
> Interpolating the sample value is not sufficient to eliminate artifacts.
> You also need to eliminate glitches that occur when jumping from one time
> value to another. In other words: no matter how good your sample-value
> interpolation is, you will still introduce artifacts when changing the
> delay time. A steep low-pass filter going into the delay line would be one
> way to solve this. (this is the idea of "bandlimiting" alluded to earlier
> in this discussion.)
> 
> I can say from experience that you absolutely must take this into account,
> but, if memory serves (which it may not), the quality of interpolation and
> filtering is not that important. I am pretty sure I've written code to
> handle both cases using something super simple and efficient like linear
> interpolation and it sounded surprisingly good, which is to say everyone
> else on the project thought it sounded great, and that was enough to
> consider it done on that particular project.
> 
> HTH
> 
> 
> 
> On Fri, Mar 20, 2015 at 6:43 AM, Steven Cook  <mailto:stevenpaulc...@tiscali.co.uk>>
> wrote:
> 
>> 
>> Let suppose that I fix the errors In the algorithm. Is this sufficient
>>> for a quality delay time
>>> Modulation? Or will I need more advance technics?
>>> 
>> 
>> That's a matter of opinion :-) My opinion is that the hermite
>> interpolation you're using here (I didn't check to see if it's implemented
>> correctly!) is more than adequate for modulated delay effects like chorus -
>> I suspect a lot of commercial effects have used linear interpolation.
>> 
>> Steven Cook.
>> 
>> 
>> 
>> -Original Message- From: Nuno Santos
>>> Sent: Thursday, March 19, 2015 6:28 PM
>>> To: A discussion list for music-related DSP
>>> Subject: Re: [music-dsp] Glitch/Alias free modulated delay
>>> 
>>> Hi,
>>> 
>>> Thanks for your replies.
>>> 
>>> What I hear is definitely related with the modulation. The artefacts are
>>> audible every time the modulation is applied: manually or automatically
>>> (please not that I have an interpolator for manual parameter changes to
>>> avoid abrupt changes). I think I was already applying an Hermit
>>> interpolation. This is my delay read function.
>>> 
>>> void IDelay::read(IAudioSample *output)
>>> {
>>>  float t = _time+_modulation*_modulationRange;
>>> 
>>>  if (t>(_size-1))
>>>  t=_size-1;
>>> 
>>>  float sf;
>>> 
>>>  #if 0
>>>  sf = _buffer[int(readIndex(t,0))];
>>>  #

Re: [music-dsp] Glitch/Alias free modulated delay

2015-03-19 Thread Nuno Santos


--
Nuno Santos

No dia 19/03/2015, às 20:57, Steven Cook  
escreveu:

> Two things:
> 
> readIndex() only checks to see if the index is < 0 but y1 & y2 have positive 
> offsets applied so they will index past the end of the buffer.

That true!

> Also, is the modulation both positive and negative? If so, it could run off 
> the start of the buffer.

Yes it is. Modulation is a value between -1 and 1 multiplied by modulation 
samples. 

Let suppose that I fix the errors In the algorithm. Is this sufficient for a 
quality delay time
Modulation? Or will I need more advance technics?

> 
> Regards,
> 
> Steven Cook.

Thanks for your sharp eye!

Regards,

Nuno

> 
> -Original Message- From: Nuno Santos
> Sent: Thursday, March 19, 2015 6:28 PM
> To: A discussion list for music-related DSP
> Subject: Re: [music-dsp] Glitch/Alias free modulated delay
> 
> Hi,
> 
> Thanks for your replies.
> 
> What I hear is definitely related with the modulation. The artefacts are 
> audible every time the modulation is applied: manually or automatically 
> (please not that I have an interpolator for manual parameter changes to avoid 
> abrupt changes). I think I was already applying an Hermit interpolation. This 
> is my delay read function.
> 
> void IDelay::read(IAudioSample *output)
> {
>   float t = _time+_modulation*_modulationRange;
> 
>   if (t>(_size-1))
>   t=_size-1;
> 
>   float sf;
> 
>   #if 0
>   sf = _buffer[int(readIndex(t,0))];
>   #else
>   float const y_1= _buffer[int(readIndex(t,-1))];
>   float const y0 = _buffer[int(readIndex(t,0))];
>   float const y1 = _buffer[int(readIndex(t,1))];
>   float const y2 = _buffer[int(readIndex(t,2))];
>   float const x=readIndex(t,0)-int(readIndex(t,0));
>   float const c0 = y0;
>   float const c1 = 0.5f*(y1-y_1);
>   float const c2 = y_1 - 2.5f*y0 + 2.0f*y1 - 0.5f*y2;
>   float const c3 = 0.5f*(y2-y_1) + 1.5f*(y0-y1);
> 
>   sf=((c3*x+c2)*x+c1)*x+c0;
>   #endif
> 
>   *output = sf;
> }
> 
> float IDelay::readIndex(float t, int offset)
> {
>   float index=_writeIndex-t+offset;
> 
>   if (index<0)
>   index+=_size;
> 
>   return index;
> }
> 
> Thanks,
> 
> Regards,
> 
> Nuno
> 
>> On 19 Mar 2015, at 18:12, David Olofson  wrote:
>> 
>> On Thu, Mar 19, 2015 at 6:15 PM, Nuno Santos  
>> wrote:
>> [...]
>>> If I use interpolation for buffer access I experience less glitch and more 
>>> alias.
>> 
>> What type of interpolation are you using? I would think you need
>> something better than linear interpolation for this. I'd try Hermite.
>> That should be sufficient for "slow" modulation, although
>> theoretically, you *should* bandlimit the signal as soon as you play
>> it back faster than the original sample rate.
>> 
>> For more extreme effects (which effectively means you're sometimes
>> playing back audio at a substantially higher sample rate than that of
>> your audio stream), you may need a proper bandlimited resampler.
>> (Apply a brickwall filter before the interpolation, and/or oversample
>> the interpolator.)
>> 
>> 
>> -- 
>> //David Olofson - Consultant, Developer, Artist, Open Source Advocate
>> 
>> .--- Games, examples, libraries, scripting, sound, music, graphics ---.
>> |   http://consulting.olofson.net  http://olofsonarcade.com   |
>> '-'
>> --
>> dupswapdrop -- the music-dsp mailing list and website:
>> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
>> links
>> http://music.columbia.edu/cmc/music-dsp
>> http://music.columbia.edu/mailman/listinfo/music-dsp
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Glitch/Alias free modulated delay

2015-03-19 Thread Nuno Santos
Alan,

I don’t change the size. I change the read index. I have posted my delay read 
function in my previous email.

Regards,

Nuno

> On 19 Mar 2015, at 18:50, Alan Wolfe  wrote:
> 
> In case it helps, it isn't the delay buffer size that you need to
> modify, but rather just your "read index" into that delay buffer.
> 
> If you have a flange for instance that can go from 0 to 500ms in the
> past, and is controlled by a sine wave, you always have a 500ms buffer
> that you put your output samples into (while also outputting to the
> actual output of course), and just let the sine wave control the "read
> index" into that 500ms buffer.
> 
> Here's a blog post of mine about the flange effect with simple working
> c++ code that only includes standard headers.  Should be pretty easy
> to follow / see what i mean hopefully.
> 
> http://blog.demofox.org/2015/03/16/diy-synth-flange-effect/
> 
> On Thu, Mar 19, 2015 at 11:12 AM, David Olofson  wrote:
>> On Thu, Mar 19, 2015 at 6:15 PM, Nuno Santos  
>> wrote:
>> [...]
>>> If I use interpolation for buffer access I experience less glitch and more 
>>> alias.
>> 
>> What type of interpolation are you using? I would think you need
>> something better than linear interpolation for this. I'd try Hermite.
>> That should be sufficient for "slow" modulation, although
>> theoretically, you *should* bandlimit the signal as soon as you play
>> it back faster than the original sample rate.
>> 
>> For more extreme effects (which effectively means you're sometimes
>> playing back audio at a substantially higher sample rate than that of
>> your audio stream), you may need a proper bandlimited resampler.
>> (Apply a brickwall filter before the interpolation, and/or oversample
>> the interpolator.)
>> 
>> 
>> --
>> //David Olofson - Consultant, Developer, Artist, Open Source Advocate
>> 
>> .--- Games, examples, libraries, scripting, sound, music, graphics ---.
>> |   http://consulting.olofson.net  http://olofsonarcade.com   |
>> '-'
>> --
>> dupswapdrop -- the music-dsp mailing list and website:
>> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
>> links
>> http://music.columbia.edu/cmc/music-dsp
>> http://music.columbia.edu/mailman/listinfo/music-dsp
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Glitch/Alias free modulated delay

2015-03-19 Thread Nuno Santos
Hi,

Thanks for your replies.

What I hear is definitely related with the modulation. The artefacts are 
audible every time the modulation is applied: manually or automatically (please 
not that I have an interpolator for manual parameter changes to avoid abrupt 
changes). I think I was already applying an Hermit interpolation. This is my 
delay read function. 

void IDelay::read(IAudioSample *output)
{
float t = _time+_modulation*_modulationRange;

if (t>(_size-1))
t=_size-1;

float sf;

#if 0
sf = _buffer[int(readIndex(t,0))];
#else
float const y_1= _buffer[int(readIndex(t,-1))];
float const y0 = _buffer[int(readIndex(t,0))];
float const y1 = _buffer[int(readIndex(t,1))];
float const y2 = _buffer[int(readIndex(t,2))];
float const x=readIndex(t,0)-int(readIndex(t,0));
float const c0 = y0;
float const c1 = 0.5f*(y1-y_1);
float const c2 = y_1 - 2.5f*y0 + 2.0f*y1 - 0.5f*y2;
float const c3 = 0.5f*(y2-y_1) + 1.5f*(y0-y1);

sf=((c3*x+c2)*x+c1)*x+c0;
#endif

*output = sf;
}

float IDelay::readIndex(float t, int offset)
{
float index=_writeIndex-t+offset;

if (index<0)
index+=_size;

return index;
}

Thanks,

Regards,

Nuno

> On 19 Mar 2015, at 18:12, David Olofson  wrote:
> 
> On Thu, Mar 19, 2015 at 6:15 PM, Nuno Santos  wrote:
> [...]
>> If I use interpolation for buffer access I experience less glitch and more 
>> alias.
> 
> What type of interpolation are you using? I would think you need
> something better than linear interpolation for this. I'd try Hermite.
> That should be sufficient for "slow" modulation, although
> theoretically, you *should* bandlimit the signal as soon as you play
> it back faster than the original sample rate.
> 
> For more extreme effects (which effectively means you're sometimes
> playing back audio at a substantially higher sample rate than that of
> your audio stream), you may need a proper bandlimited resampler.
> (Apply a brickwall filter before the interpolation, and/or oversample
> the interpolator.)
> 
> 
> -- 
> //David Olofson - Consultant, Developer, Artist, Open Source Advocate
> 
> .--- Games, examples, libraries, scripting, sound, music, graphics ---.
> |   http://consulting.olofson.net  http://olofsonarcade.com   |
> '-'
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


[music-dsp] Glitch/Alias free modulated delay

2015-03-19 Thread Nuno Santos
Hi,

I’m trying to implement a modulated delay line which will be used on a chorus 
effect.

I think the problem that I will refer to is already well know and please 
forgive me my ignorance if that’s the case.

When I modulate the delay time, I experience some glitch/alias which is not 
pleasant.

With an integer index base buffer access I hear less alias but more glitch. If 
I use interpolation for buffer access I experience less glitch and more alias. 

Im a bit frustrated at the moment. I would like to ask to this list if there is 
any relatively simple solution for this problem.

Thanks in advance,

Regards,

Nuno Santos
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Waveform with limited bandwidth wavetable lookup

2014-06-24 Thread Nuno Santos
Thanks for all replies so far.

I will definitely give a look at this resources and them for future reference 
as this is being an every challenge.

I have however been all afternoon giving a closer look to Nigel Redmon article 
about wavetable oscillators as it presents a practical approach to a wavetable 
oscillator. Since my mathematical skills are a bit rusty I understand practical 
approaches more easily.

Some doubts however arise. I understand that I still need to go deeper into the 
mathematical nature of this problems.

Thanks,

With my best regards,

Nuno Santos

On 24 Jun 2014, at 05:42, Nigel Redmon  wrote:

> Hi Nuno,
> 
> I discuss the issues, and develop and present source code for a wavetable 
> oscillator in a series of articles, plus a video discussion and demonstration:
> 
> video:
> 
> https://www.youtube.com/watch?v=k81hoZODOP0
> 
> Articles:
> 
> http://www.earlevel.com/main/category/digital-audio/oscillators/wavetable-oscillators/?order=ASC
> 
> If you’re going for a square wave in particular, for a synth, you’ll probably 
> want to implement it in a way that gives variable pulse width for 
> flexibility. In a wavetable oscillator, that’s most easily done by using a 
> sawtooth and doing two lookups, offset in phase, and taking the difference 
> (shown in the articles).
> 
> I hope that you find the information useful.
> 
> Nigel
> 
> 
> On Jun 23, 2014, at 11:33 AM, Nuno Santos  wrote:
> 
>> Hi,
>> 
>> I have been reading literature in order to understand the technics involved 
>> in computer audio generation. I want to build the basic building blocks of a 
>> sound synthesizer rather than using a lib or framework because I really want 
>> to understand it's inner mechanics.
>> 
>> Currently I have The Audio Programming Book as the most important reference. 
>>  I have already implemented a sinewave oscillator using the sin function. 
>> Then I have implemented it using a table lookup. Rather than using code from 
>> the book, i'm writing my own code im C++
>> 
>> When I got to the square wave I was confronted with the aliasing problem. 
>> This problem is several times referenced on the Audio Programming Book 
>> (Audio Programming in C chapter), but I can't still find an explicit 
>> solution for this problem.
>> 
>> I understand that in order to completely avoid this problem I shouldn't 
>> generate any signal for any frequency/harmonic that is above sr/2 but I 
>> can't see that in the code examples of the book. 
>> 
>> Googling about this topic I can find other approaches to the same problem 
>> and they all seem so different that I can't find a solid relation between 
>> them.
>> 
>> Can someone point me other solid but practical resources on how to generate 
>> bandwidth limited basic waveforms?
>> 
>> Thanks,
>> 
>> With my best regards,
>> 
>> Nuno Santos
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


[music-dsp] Waveform with limited bandwidth wavetable lookup

2014-06-23 Thread Nuno Santos
Hi,

I have been reading literature in order to understand the technics involved in 
computer audio generation. I want to build the basic building blocks of a sound 
synthesizer rather than using a lib or framework because I really want to 
understand it's inner mechanics.

Currently I have The Audio Programming Book as the most important reference.  I 
have already implemented a sinewave oscillator using the sin function. Then I 
have implemented it using a table lookup. Rather than using code from the book, 
i'm writing my own code im C++

When I got to the square wave I was confronted with the aliasing problem. This 
problem is several times referenced on the Audio Programming Book (Audio 
Programming in C chapter), but I can't still find an explicit solution for this 
problem.

I understand that in order to completely avoid this problem I shouldn't 
generate any signal for any frequency/harmonic that is above sr/2 but I can't 
see that in the code examples of the book. 

Googling about this topic I can find other approaches to the same problem and 
they all seem so different that I can't find a solid relation between them.

Can someone point me other solid but practical resources on how to generate 
bandwidth limited basic waveforms?

Thanks,

With my best regards,

Nuno Santos

 
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] dsPIC33 boards for Audio DSP work.

2014-03-10 Thread Nuno Santos
If have been using STM32F4 family in this last 6 months.

If you prefer to have the flexibility of coding in Linux, you can get an arm 
gcc compiler and use the project st-link to load and debug the firmware into 
the micro controller:

https://github.com/texane/stlink

If you prefer to work on Windows, you have Cocox, a Eclipse based IDE.

Regards,

Nuno

On 10 Mar 2014, at 19:14, Joe Farrish  wrote:

> Alberto,
> 
> Concerning your ST recommendation can you describe what the programing IDE, 
> language used, and other things to make them operational for audio use? 
> 
> Joe. 
> 
> 
>> Date: Fri, 7 Mar 2014 12:08:20 +0100
>> From: albertodib...@alice.it
>> To: music-dsp@music.columbia.edu
>> Subject: Re: [music-dsp] dsPIC33 boards for Audio DSP work.
>> 
>> On 3/7/2014 1:57 AM, Joe Farrish wrote:
>> 
>>> /Hello,
>>> I was wondering if anyone has used the dsPIC33 eval boards for their audio 
>>> DSP projects.//
>>> //I've purchased one and realize one problem with this board 
>>> (dsPIC33FJ256GP506) and now//
>>> //realize the unit does not have DAC's but rather a Codec. While it does 
>>> have ADC's and a DSP engine.
>>> I was wondering if anyone has used a similar board for audio DSP work.//
>>> //I'm very new to this but would like to use it as an FX processor.
>>> I'm wondering what people think of Microchip, analog devices or other DSP 
>>> board mfg's.
>>> Thanks for your info./
>> 
>> IMHO there is much better board that is vastly more powerful than a board 
>> with the dsPIC33, and costs less...
>> Look here :
>> 
>> http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419
>> 
>> For 15 USD you get a board with an ARM M4F processor running at 168 MHz (I 
>> overclocked it up to 220 MHz...)
>> with three ADCs that can be interleaved to reach a sampling frequency of 
>> about 8Ms/s, a true 12-bit DAC on chip,
>> a CS43L22 audio DAC with integrated class D speaker driver, an MP45DT02 ST 
>> MEMS audio sensor, omni-directional
>> digital microphone, a device USB port, an OTG USB port, and many other 
>> interesting peripherals.
>> 
>> The ARM M4F processor has a 32-bit floating point core (very important if 
>> you want to code digital filters and FFTs)
>> IEEE-compliant, 1 MB flash and 192 kB static RAM.
>> 
>> I have a couple of them and, after in the past having programmed a dsPIC33 
>> for a digital signal processing
>> application, I find this Discovery board a completely new world, much more 
>> powerful and easy to use.
>> 
>> And for 15 USD it is difficult to beat... :-)
>> 
>> 73  Alberto  I2PHD
>> 
>> P.S. No, I don't work for STM... :-)
>> 
>> 
>> 
>> 
>> ---
>> This email is free from viruses and malware because avast! Antivirus 
>> protection is active.
>> http://www.avast.com
>> --
>> dupswapdrop -- the music-dsp mailing list and website:
>> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
>> links
>> http://music.columbia.edu/cmc/music-dsp
>> http://music.columbia.edu/mailman/listinfo/music-dsp
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp