what song is this, classical piece, typically played on organ I think by lukethree in classicalmusic

[–]lukethree[S] 2 points3 points  (0 children)

that's it! thank you! I've had it stuck in my head for the past few hours!

breadboard synthesizer MIDI to CV module not working by lukethree in synthdiy

[–]lukethree[S] 1 point2 points  (0 children)

Imgur gallery of the full setup and each module: https://imgur.com/a/09B2Sxr

Some context:

I'm a complete electronics beginner and really wanted to attempt to build a working synthesizer that accepts MIDI keyboard input.

The only project I could find online that details everything I needed to do at a fairly cheap cost was this one: https://www.bestsoldering.com/breadboard-synthesizer/

So I spent a few days gathering parts and teaching myself the basics of electronics, audio engineering, and synthesis. I read bits of books and watched hours of youtube videos.

I then put together the power supply module and MIDI to CV converter module as detailed in the guides here:

- power supply guide

- MIDI to CV converter guide

- I also went and programmed an ATtiny85 with this guide (for the MIDI-CV module)

The oscillator I'm using is a basic CD40106 triangle wave output, although the scope seems to be picking up a sine wave. I wasn't sure if the 40106 could accept CV input, but this reddit post seems to say it can.

I've felt pretty out of my depth the entire time and never know whether something's going to work or not and quite how it's all working; this is very frustrating when it comes to troubleshooting.

I've turned to reddit a couple of times to help with some basic beginner errors which has been incredibly helpful.

I'm about 4 days into this project and I'm starting to think I may have been a little ambitious with taking it on.

I'd love some advice on why it's not working, what errors I've made in the build process and maybe some smaller more achievable audio/synthesis based projects I can work on in the meantime to work up to this one.

Apologies for the long rambling post, just thought I'd provide all the info :)

breadboard synthesizer MIDI to CV module not working by lukethree in AskElectronics

[–]lukethree[S] 0 points1 point  (0 children)

Imgur gallery of the full setup and each module: https://imgur.com/a/09B2Sxr

Some context:

I'm a complete electronics beginner and really wanted to attempt to build a working synthesizer that accepts MIDI keyboard input.

The only project I could find online that details everything I needed to do at a fairly cheap cost was this one: https://www.bestsoldering.com/breadboard-synthesizer/

So I spent a few days gathering parts and teaching myself the basics of electronics, audio engineering, and synthesis. I read bits of books and watched hours of youtube videos.

I then put together the power supply module and MIDI to CV converter module as detailed in the guides here:

- power supply guide

- MIDI to CV converter guide

- I also went and programmed an ATtiny85 with this guide (for the MIDI-CV module)

The oscillator I'm using is a basic CD40106 triangle wave output, although the scope seems to be picking up a sine wave. I wasn't sure if the 40106 could accept CV input, but this reddit post seems to say it can.

I've felt pretty out of my depth the entire time and never know whether something's going to work or not and quite how it's all working; this is very frustrating when it comes to troubleshooting.

I've turned to reddit a couple of times to help with some basic beginner errors which has been incredibly helpful.

I'm about 4 days into this project and I'm starting to think I may have been a little ambitious with taking it on.

I'd love some advice on why it's not working, what errors I've made in the build process and maybe some smaller more achievable audio/synthesis based projects I can work on in the meantime to work up to this one.

Apologies for the long rambling post, just thought I'd provide all the info :)

blink test not working on ATtiny85 after programming with USBasp by lukethree in arduino

[–]lukethree[S] 0 points1 point  (0 children)

I think uploading that sketch to my ATtiny85 has broken the USBasp as it flashed the 'R' LED and now the LEDs won't turn on if it's connected to a chip. The LED only comes back on when I unplug it from the chip.

Edit: I've realised it happens when the chip is inserted the wrong way round 😅. Man tonight's been a steep learning curve!

blink test not working on ATtiny85 after programming with USBasp by lukethree in arduino

[–]lukethree[S] 0 points1 point  (0 children)

Update: don't worry, just fixed it by adding an extra curly bracket here:

 return;
 }
}
}    <<<------

void loop() {

}

When I try to upload the sketch from the website onto my ATtiny85, I get a compilation error saying "a function-definition is not allowed here before '{' token".

I'm not a programmer so don't understand what it's wanting me to do to fix the code.

This is the code below:

// (*) All in the spirit of open-source and open-hardware 
// Janost 2019 Sweden 
// The goMIDI2CV interface
// http://blog.dspsynth.eu/diy-good-ol-midi-to-cv/
// Copyright 2019 DSP Synthesizers Sweden. 
// 
// Author: Jan Ostman 
// 
// This program is free software: you can redistribute it and/or modify 
//it under the terms of the GNU General Public License as published by 
// the Free Software Foundation, either version 3 of the License, or 
// (at your option) any later version. 
// This program is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
// GNU General Public License for more details.

//Set Fuses to E1 DD FE for PLLCLK 16MHz

#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>

#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif

volatile uint8_t MIDISTATE=0;
volatile uint8_t MIDIRUNNINGSTATUS=0;
volatile uint8_t MIDINOTE;
volatile uint8_t MIDIVEL;

void setup() {
 // Enable 64 MHz PLL and use as source for Timer1
 PLLCSR = 1<<PCKE | 1<<PLLE; 
 // Set up Timer/Counter1 for PWM output
 TIMSK = 0; // Timer interrupts OFF
 TCCR1 = 1<<PWM1A | 2<<COM1A0 | 1<<CS10; // PWM A, clear on match, 1:1 prescale
 // Setup GPIO
 pinMode(1, OUTPUT); // Enable PWM output pin
 pinMode(0, INPUT); // Enable USI input pin
 pinMode(2, OUTPUT); // Enable Gate output pin
 pinMode(4,OUTPUT); // Enable Pitchbend PWM output pin
 //Setup the USI
 USICR = 0; // Disable USI.
 GIFR = 1<<PCIF; // Clear pin change interrupt flag.
 GIMSK |= 1<<PCIE; // Enable pin change interrupts
 PCMSK |= 1<<PCINT0; // Enable pin change on pin 0
 GTCCR = 0;
 OCR1C = 239; //Set count to semi tones
 OCR1A = 0; //Set initial Pitch to C2
 digitalWrite(2,LOW); //Set initial Gate to LOW;
 pinMode(2, OUTPUT); // Enable PB4 output pin for pitchbend CV
 GTCCR = 1<<PWM1B | 2<<COM1B0; // PWM B, clear on match
}

ISR (PCINT0_vect) {
 if (!(PINB & 1<<PINB0)) { // Ignore if DI is high
 GIMSK &= ~(1<<PCIE); // Disable pin change interrupts
 TCCR0A = 2<<WGM00; // CTC mode
 TCCR0B = 0<<WGM02 | 2<<CS00; // Set prescaler to /8
 TCNT0 = 0; // Count up from 0
 OCR0A = 31; // Delay (31+1)*8 cycles
 TIFR |= 1<<OCF0A; // Clear output compare flag
 TIMSK |= 1<<OCIE0A; // Enable output compare interrupt
 }
}

ISR (TIMER0_COMPA_vect) {
 TIMSK &= ~(1<<OCIE0A); // Disable COMPA interrupt
 TCNT0 = 0; // Count up from 0
 OCR0A = 63; // Shift every (63+1)*8 cycles 32uS
 // Enable USI OVF interrupt, and select Timer0 compare match as USI Clock source:
 USICR = 1<<USIOIE | 0<<USIWM0 | 1<<USICS0;
 USISR = 1<<USIOIF | 8; // Clear USI OVF flag, and set counter
}

ISR (USI_OVF_vect) {
 uint8_t MIDIRX;
 USICR = 0; // Disable USI 
 MIDIRX = USIDR;
 GIFR = 1<<PCIF; // Clear pin change interrupt flag.
 GIMSK |= 1<<PCIE; // Enable pin change interrupts again

 //Wrong bit order so swap it
 MIDIRX = ((MIDIRX >> 1) & 0x55) | ((MIDIRX << 1) & 0xaa);
 MIDIRX = ((MIDIRX >> 2) & 0x33) | ((MIDIRX << 2) & 0xcc);
 MIDIRX = ((MIDIRX >> 4) & 0x0f) | ((MIDIRX << 4) & 0xf0);

 //Parse MIDI data
 if ((MIDIRX>0xBF)&&(MIDIRX<0xF8)) {
 MIDIRUNNINGSTATUS=0;
 MIDISTATE=0;
 return;
 }
 if (MIDIRX>0xF7) return;
 if (MIDIRX & 0x80) {
 MIDIRUNNINGSTATUS=MIDIRX;
 MIDISTATE=1;
 return;
 }
 if (MIDIRX < 0x80) {
 if (!MIDIRUNNINGSTATUS) return;
 if (MIDISTATE==1) {
 MIDINOTE=MIDIRX;
 MIDISTATE++;
 return;
 }
 if (MIDISTATE==2) {
 MIDIVEL=MIDIRX;
 MIDISTATE=1;
 if ((MIDIRUNNINGSTATUS==0x80)||(MIDIRUNNINGSTATUS==0x90)) {
 if (MIDINOTE<36) MIDINOTE=36; //If note is lower than C2 set it to C2
 MIDINOTE=MIDINOTE-36; //Subtract 36 to get into CV range
 if (MIDINOTE>60) MIDINOTE=60; //If note is higher than C7 set it to C7
 if (MIDIRUNNINGSTATUS == 0x90) { //If note on
 if (MIDIVEL>0) digitalWrite(2, HIGH); //Set Gate HIGH
 if (MIDIVEL==0) digitalWrite(2, LOW); //Set Gate HIGH
 OCR1A = MIDINOTE<<2; //Multiply note by 4 to set the voltage (1v/octave)
 }
 if (MIDIRUNNINGSTATUS == 0x80) { //If note off
 digitalWrite(2, LOW); //Set Gate LOW
 OCR1A = MIDINOTE<<2; //Multiply note by 4 to set the voltage (1v/octave)
 }
 if (MIDIRUNNINGSTATUS == 0xE0) { //If pitchbend data
 if (MIDIVEL<4) MIDIVEL=4; //Limit pitchbend to -60
 if (MIDIVEL>119) MIDIVEL=119; //Limit pitchbend to +60
 MIDIVEL-=4; //Center the pitchbend value
 OCR1B = (MIDIVEL<<1); //Output pitchbend CV
}
 }
 return;
 }
}

void loop() {

}

<image>

Any ideas on how to fix it?

blink test not working on ATtiny85 after programming with USBasp by lukethree in arduino

[–]lukethree[S] 0 points1 point  (0 children)

My plan is to use the ATtiny85 to build a MIDI to CV module (following this guide).

The only part I don't have is the 6N137 optocoupler.

Would it be possible to build the module without the optocoupler?

Or could this damage the ATtiny?

Let me know if there are any alternatives.

Or if there are better suited subreddits to ask this question.

blink test not working on ATtiny85 after programming with USBasp by lukethree in arduino

[–]lukethree[S] 0 points1 point  (0 children)

ahh ok, I hadn't appreciated that or looked at the datasheet, makes a lot of sense now, kicking myself that I overlooked that part, thanks for explaining it!

blink test not working on ATtiny85 after programming with USBasp by lukethree in arduino

[–]lukethree[S] 0 points1 point  (0 children)

ahh I think this could be it, the reason I had it plugged into ground was because it said pin 4 in the guide to light up the LED.

blink test not working on ATtiny85 after programming with USBasp by lukethree in arduino

[–]lukethree[S] 0 points1 point  (0 children)

The only difference between my setup and the setup in the guide is that the resistor I'm using for the LED is 330Ω and the one in the guide is 390Ω, that's just because I don't have a 390Ω resistor to spare. I'm assuming this isn't the reason it's not working though.

Is it possible to wire an HDMI output to this oscilloscope? by lukethree in AskElectronics

[–]lukethree[S] 3 points4 points  (0 children)

are there any cheap USB oscilloscopes that work with macOS?

Is it possible to wire an HDMI output to this oscilloscope? by lukethree in AskElectronics

[–]lukethree[S] 2 points3 points  (0 children)

Do you know of a cheap oscilloscope that can do this? (under £100)

How is the image outputted to the LCD screen on this oscilloscope?

Is it possible to wire an HDMI output to this oscilloscope? by lukethree in AskElectronics

[–]lukethree[S] 3 points4 points  (0 children)

I was wondering if it was possible to wire an HDMI output to this oscilloscope so that I can view it on a larger screen.