Go to advanced search

by Shaurya
Tue Aug 13, 2019 8:29 am
Forum: Python
Topic: How to sense multiple inputs simultaneously?
Replies: 2
Views: 284

How to sense multiple inputs simultaneously?

Hello! I am making a drum kit and I want to sense multiple inputs simultaneously. (Like a real Drum Kit!) I have different channels set up in Pygame for each input and so there isn't any flaw with that. I want to find a way to sense multiple inputs at the same time. Here is a snippet of the code----...
by Shaurya
Thu Jul 25, 2019 4:59 pm
Forum: Python
Topic: Getting unexpected error while using oled...
Replies: 2
Views: 168

Getting unexpected error while using oled...

I am having some veeeery basic but frustrating errors while displaying text on an Oled screen. count = 1 disp.clear() disp.display() draw.text((30, top+20), count, font=font, fill=255) #there is more code to control the oled, but this is where I am getting the error. The oled cannot display count. I...
by Shaurya
Wed Jun 26, 2019 4:29 pm
Forum: Python
Topic: Changing values in a defined sequence
Replies: 6
Views: 588

Re: Changing values in a defined sequence

Thank you... I understand most of your code, but the part where the sounds are being changed are not clear... After print (count), You mean I need to something like... If count == 1: Drum1 = the path to my sound file? Also, Will I be able to change the NUMBER of patches by editing these lines? if GP...
by Shaurya
Wed Jun 26, 2019 1:34 pm
Forum: Python
Topic: Changing values in a defined sequence
Replies: 6
Views: 588

Re: Changing values in a defined sequence

Hello & sorry for the late reply... I looked at your code and I think it's fantastic... Just a few clarifications... According to your code, it keeps on adding 1 to "count" this would be correct for three times when there are only three sounds, until it goes up to 4, and gives an error about that so...
by Shaurya
Fri Jun 21, 2019 9:15 am
Forum: Python
Topic: Changing values in a defined sequence
Replies: 6
Views: 588

Changing values in a defined sequence

Hello! Is there any code that can help me with this? I want to change an audio file whenever a button is pressed in a defined order. The sound files are SOUND1, SOUND2, SOUND3, etc... I want the sounds to change this way- When I press the button once, the sound changes to SOUND1 When I press the but...
by Shaurya
Thu Jun 13, 2019 4:59 am
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

Re: How to change any value in python with an input

Thank you Scotty101 and rpimike, just one last question... what does this line do?

Code: Select all

Drums = ['Drum1','Drum2','DrumSp','BassDrum','Cymbal1','Cymbal2','Cymbal3','Cymbal4']
How can we define so many sounds to a single object?
by Shaurya
Wed Jun 12, 2019 6:04 am
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

Re: How to change any value in python with an input

But then how will I change the value of x with inputs???????
by Shaurya
Tue Jun 11, 2019 2:01 pm
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

Re: How to change any value in python with an input

Thank you...
Now I understand...
by Shaurya
Tue Jun 11, 2019 1:34 pm
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

Re: How to change any value in python with an input

No, I can't actually understand your code.
I am a 13 yr old boy trying to learn electronics.
Please help me with that. Although I think read something about changing some values collectively somewhere, I am still confused...
by Shaurya
Tue Jun 11, 2019 1:10 pm
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

Re: How to change any value in python with an input

B. Goode, I want to have a single button to change the audio directories of 8 channels I have in pygame. import time #importimg the time library import os #Importing the os Library for Control Over Operating System import RPi.GPIO as GPIO #Importing the GPIO library GPIO.setmode(GPIO.BOARD) #Definin...
by Shaurya
Tue Jun 11, 2019 1:04 pm
Forum: Python
Topic: Pygame playing sounds without input...
Replies: 5
Views: 383

Re: Pygame playing sounds without input...

I am really really sorry.
I forgot to connect the ground pin and the GPIO pins recieved a floating voltage...
I am really sorry for the inconvenience...
by Shaurya
Tue Jun 11, 2019 12:57 pm
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

Re: How to change any value in python with an input

Hello! I am playing audio using pygame and when I press a button it plays the audio for me. That part is fine for me. What I what to do is use another button to change the audio. For example- Audio1 = ('/home/pi/Drum.wav') I want to change the value of Audio1, say- Audio1 = ('/home/pi/AnotherSound.w...
by Shaurya
Tue Jun 11, 2019 8:51 am
Forum: Python
Topic: How to change any value in python with an input
Replies: 15
Views: 793

How to change any value in python with an input

Hello...
Can anyone help me with this?
I want to change (or replace) specific values and strings using a button input from the raspberry pi's GPIO pins. How can I get the desired results in python? Is it simple code? Or a library? I am confused.
Thank you!
by Shaurya
Mon Jun 10, 2019 4:06 pm
Forum: Python
Topic: Pygame playing sounds without input...
Replies: 5
Views: 383

Pygame playing sounds without input...

Hello! I am working on a python script that involves Pygame and I am stumbling upon something... This is the code---- import time import os import rpi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(29,GPIO.IN) GPIO.setup(31,GPIO.IN) GPIO.setup(32,GPIO.IN) GPIO.setup(33,GPIO.IN) GPIO.setup(35,GPIO....
by Shaurya
Sat Mar 02, 2019 8:01 am
Forum: General discussion
Topic: Using an ADC with the raspberry pi to sense piezoelectric sensors.
Replies: 0
Views: 92

Using an ADC with the raspberry pi to sense piezoelectric sensors.

Hello everyone! My name is Shaurya and I am 13 years old. I am relatively new to the Raspberry pi 3. I learn music, so I wanted to create something musical, something like a drum kit. I already have a synthesizer, so I was pretty bored with the peaceful and calm music I played. I looked up several p...

Go to advanced search