Comments (3)
The reason for this "break" is that after correcting Ugen.sine by setting endpoint=False in the linspace, the periodicity is now correct on sampling a 200 Hz signal, (the period is 22050/200=110.25, in turn the waveform repeats itself orderly, leading to the sampling time to miss systematically the location where the sine maxes. Before, the np.linspace created time locations at times multiple of 1 second / 22049 (because endpoint was true). Hence, every sine wave of 200 Hz was sampled at slightly different locations, so that apparently it happened that in one of the 200 sine waves on the 1s sound, a location close enough was hit to give sine(time)=1, (due to amp=0.5 resulting in the max(sig)=0.5).
The 'break' shows that the test should be improved, e.g. by using a frequency so that the sine function is in fact called so that it delivers a maximum, e.g. freq = 44100/16 = 2756.25 Hz will do it: Then a sine wave is sampled with 8 samples, two of them hitting the zero crossings, one each for max and min locatio and the others in between. The test then works also with dur=0.001, saving 99.9% of energy, making the test more sustainable.
from pya.
Mark as solved.
from pya.
actually the issue was probably not 'different precision', I don't know why it should work different on different platforms..
from pya.
Related Issues (20)
- Ugen().noise() range from 0-1. rather than -1 - 1. HOT 1
- Release 0.3.2
- Aserver-nodes
- Improve Asig indexing HOT 1
- Release 0.3.3
- Make sanic optional
- Ugen docstring outdated
- Convolution
- determine_backend error HOT 4
- Python 3.10 support HOT 2
- (Binder) notebooks not compatible with recent sanic and jupyter versions HOT 1
- m2r is deprecated and not supported any longer. We should switch to sphinx-mdinclude HOT 1
- Aserver, Arecorder channels argument of the constructor is buggy
- Improve type hints
- Refactor, pre-commit HOT 1
- Make class transformation one-way only HOT 7
- Arecorder uses default device when 0 is used a input
- Asig.cn and Asig.col_names are confusing and unnecessary to have both HOT 2
- Add more data type support.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pya.