Well... it is not a problem of syntax.

I tried a long time to find an answer but I come back again to you ...

When I write a code using the [acc ....] metadata and when I import it on
the FPG, it doesn't work.
It will work only if I uncheck "OFF" and check "ACCELEROMETER" in the EDIT
windows of FPG.

I've also noticed that if I edit the code on FPG, change just one easy
parameter (for example, I change [acc *0* 0 -10 0 10] in [acc *1* 0 -10 0
10], the ACCELEROMETER is automatically unchecked and must go again in the
EDIT window to check it. Again, if [acc *0* 0 -10 0 10] is written and that
I activate the accelerometer and click on Z, what is written in the code
(the X axis) is bypassed.

So, it's not only the [acc 0 0 -10 0 10] that makes the accelerometer work,
but it's both the "OFF" and "ACCELEROMETER" checkboxes in the EDIT FPG
Window.

So my question becomes the following : *what does this "accelerometer"
checkbox correspond to, in the code ? What makes it be checked or unchecked
? *It's not in the Faust Code, that's sure, I've compared two codes : one
working, one not ...

As an example : I open the example SBrass in the FPG.
When I export for Android, the accelerometer will work on my mobile. Good.
When I copy than paste this code in the Faust Online Editor, then export to
Android, the accelerometer won't work on my mobile.

At the end of the mail, you'll find the code to try it by yourself.

Finally, I can say the problem is the following :
- compilation through Faust Online Editor doesn't check the "box"
accelerometer
- compilation through FPG does check this "box" ...
When this box is checked, the mobile allows the sensors to be used.
Otherwise it doesn't.

Do you think it's possible to repair this bug ?

Virginie

------------------------
SBrass example

process = vgroup("SBrass",environment{declare name "Brass";
declare description "WaveGuide Brass instrument from STK";
declare author "Romain Michon (rmic...@ccrma.stanford.edu)";
declare copyright "Romain Michon";
declare version "1.0";
declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license);
//declare description "A simple brass instrument waveguide model, a la Cook
(TBone, HosePlayer).";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html";;

//Modification GRAME July 2015

/* =============== DESCRIPTION ================= :

- Brass instrument
- Turn ON brass (0=OFF, 1=ON)
- Head = Silence
- Upward = Higher frequency
- Downward = Lower frequency

*/

import("stdfaust.lib");
instrument=library("instruments.lib");

//==================== INSTRUMENT =======================

process = (borePressure <: deltaPressure,_ :
  (lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + :
  fi.dcblocker) ~ (boreDelay) :
  *(gain)*(2);

//==================== GUI SPECIFICATION ================

freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone
frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999);
gain = 0.8;
gate = hslider("h:[1]Instrument/ ON/OFF",0,0,1,1);

lipTension = 0.780;
pressure = 1;
slideLength = 0.041;

vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato
Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01);
vibratoGain = 0.05;
vibratoBegin = 0.05;
vibratoAttack = 0.5;
vibratoRelease = 0.1;

envelopeDecay = 0.001;
envelopeAttack = 0.005;
envelopeRelease = 0.07;
//==================== SIGNAL PROCESSING ================


//----------------------- Synthesis parameters computing and functions
declaration ----------------------------

//lips are simulated by a biquad filter whose output is squared and
hard-clipped, bandPassH and saturationPos are declared in instrument.lib
lipFilterFrequency = freq*pow(4,(2*lipTension)-1);
lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * :
instrument.saturationPos;

//delay times in number of samples
slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength);
boreDelay = de.fdelay(4096,slideTarget);

//----------------------- Algorithm implementation
----------------------------

//vibrato
vibrato =
vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate);

//envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato
breathPressure =
pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) +
vibrato;
mouthPressure = 0.3*breathPressure;

//scale the delay feedback
borePressure = *(0.85);

//differencial presure
deltaPressure = mouthPressure - _;

}.process);





Le jeu. 7 févr. 2019 à 11:16, Stéphane Letz <l...@grame.fr> a écrit :

> Hi Virginie,
>
> It could be a syntax error, it should be :  [acc : 0 0 -10 0 10]   (the
> syntax for metadata is [key:value])
>
> Stéphane
>
>
> > Le 7 févr. 2019 à 01:02, Virginie YK <virginie...@gmail.com> a écrit :
> >
> > "I'm going slightly mad"...
> >
> > When I use the EDIT function in the FPG, I can choose to had
> accelerometer functions, then compile it and install it on an Android
> phone, it works.
> >
> > When I use exactly the same code (which is just a basic [acc 0 0 -10 0
> 10], I know .... ) and compile it for Android on the Faust Editor, the
> Accelerometer functions doesn't work on the Android !
> >
> > It's as if the FPG was adding something like "please allow the
> accelerometer to work" when compiling, whereas the Faust Editor doesn't do
> it !
> >
> > For now, I use a trick. I write code on the F-Editor, then open this
> dsp-file on the FPG, then edit the accelerometer functions and compile
> it.... But it seems to me it's not very normal !
> >
> > And that means that  I can't use the GYR functions (as there is no
> "Edit" function in the FPG for gyroscope).
> >
> > Does anybody know why the two environment compile "differently" and what
> can I do to make it work with the GYR too ?
> >
> > Thanks ...
> > _______________________________________________
> > Faudiostream-users mailing list
> > Faudiostream-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>
>
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to