-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable real time playback #7
base: master
Are you sure you want to change the base?
Conversation
track1.append([0 for n in range(0,max_len - len_list[0])]) | ||
track2.append([0 for n in range(0,max_len - len_list[1])]) | ||
|
||
track1 = [x for x in track1 if x != []] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the if condition in the list comprehension could be modified from if x != []
to if x
as the latter is more idiomatic to python specifically.
|
||
x_stereo = [0 for n in range(0,2*len(x))] | ||
if gain_L > 1 or gain_L < 0 or gain_R > 1 or gain_R < 0: | ||
print "Invalid Gain. Try between 0 and 1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a doubt here - what will pan_stereo(...)
do if the gains are invalid. Should it proceed with the flow with invalid gains? Or should it return immediately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, good catch. I was meaning to raise a ValueError
there. Noted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're planning on raising a ValueError
, how is it going to be handled downstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're planning on raising a ValueError
, it would be best if the list generation x_stereo
is moved from line#21 to line#25.
Sumanth Srinivasan - December 2016 | ||
""" | ||
|
||
import math |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All math
imports could be clubbed together as -
from math import cos, sin, pi, ceil, floor, isnan
(please add other methods that I have missed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @reckoner165. You needn't club them together in this pull request. We will do it as a separate one as a lot of imports need to be clubbed together. Sorry for the confusion. 😅
@onstash I've been working on turning the Sound Module into a separate class to make things more modular. Here is a WIP version of it. Happy to have you contribute! I also set it up to handle playback and write to file, so maybe that will take away some burden from here. |
Hi @reckoner165. Saw your rewrite. Beautifully documented and written! I like it. But I am afraid my contribution is limited to code and not music. And I will definitely contribute. 😅 |
This change adds additional methods to play the output waveform once at the end of creation.
It also includes the addition of SoundModule to enable wave shaping and other real time playback features - working towards achieving #6
It's a big change by virtue of addition of an entire module and could use a good round of reviewing and testing.
cc @amoghpj @onstash