CrazyCraig
Member
Hi all.
I'm new to the forum & to be totally honest, don't have a single clue about coding (not even a 'teensy' little bit).
I was given a RCF Evox 5 speaker by a friend after he somehow managed to damage the main board & fried the onboard dsp ic that splits the sound (highs & lows).
I purchased a Teensy 4 and an audio board with the hopes of making a basic active line level cross-over for this speaker.
I went onto the website with audio design tool and put together what I thought I required to do this.
Basically using both inputs (line in) then going to 2x bi-quad filters, then each to an amp & then out.
This kinda worked as I do get audio out, but the sound is distorted on certain frequencies. I have no idea what code to use inside of the project.
I played around & tried to learn what I could from using other peoples examples & kinda managed to get a low & high output, but unfortunately it still sounds bad to me.
I don't even know where to look to find the code to use for this or where to read up on what each piece of code does, where to put brackets, curly brackets, semi-colons etc...
I even watched those Teensy audio workshop video's (all of them!!) None of them mention what code you must use after using the web based tool??
Please, please, please can someone help me with this. I have no idea what I'm doing but I am willing to learn. I'm starting to lose my mind!!
This is all the code I put in (using the tool, examples & guessing):
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=55,363
AudioFilterBiquad biquad1; //xy=310,341
AudioFilterBiquad biquad2; //xy=312,388
AudioAmplifier amp4; //xy=429,392
AudioAmplifier amp3; //xy=431,341
AudioOutputI2S i2s2; //xy=649,340
AudioConnection patchCord1(i2s1, 0, biquad1, 0);
AudioConnection patchCord2(i2s1, 1, biquad2, 0);
AudioConnection patchCord3(biquad1, amp3);
AudioConnection patchCord4(biquad2, amp4);
AudioConnection patchCord5(amp4, 0, i2s2, 1);
AudioConnection patchCord6(amp3, 0, i2s2, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=422,586
// GUItool: end automatically generated code
const int myInput = AUDIO_INPUT_LINEIN;
//const int myInput = AUDIO_INPUT_LINEIN;
void setup() {
AudioMemory(12);
sgtl5000_1.enable(); // Enable the audio shield
sgtl5000_1.inputSelect(myInput);
sgtl5000_1.volume(1);
// Amplification
amp3.gain(7);
amp4.gain(5);
// Butterworth filter, 48 db/octave
biquad1.setLowpass(0, 200, 1);
// Linkwitz-Riley filter, 48 dB/octave
//biquad1.setLowpass(0, 200, 1);
// Butterworth filter, 48 db/octave
biquad2.setHighpass(0, 200, 1);
// Linkwitz-Riley filter, 48 dB/octave
//biquad2.setHighpass(0, 200, 1);
}
void loop() {
}
Any help / guidance will be appreciated.
Thanks in advance.
I'm new to the forum & to be totally honest, don't have a single clue about coding (not even a 'teensy' little bit).
I was given a RCF Evox 5 speaker by a friend after he somehow managed to damage the main board & fried the onboard dsp ic that splits the sound (highs & lows).
I purchased a Teensy 4 and an audio board with the hopes of making a basic active line level cross-over for this speaker.
I went onto the website with audio design tool and put together what I thought I required to do this.
Basically using both inputs (line in) then going to 2x bi-quad filters, then each to an amp & then out.
This kinda worked as I do get audio out, but the sound is distorted on certain frequencies. I have no idea what code to use inside of the project.
I played around & tried to learn what I could from using other peoples examples & kinda managed to get a low & high output, but unfortunately it still sounds bad to me.
I don't even know where to look to find the code to use for this or where to read up on what each piece of code does, where to put brackets, curly brackets, semi-colons etc...
I even watched those Teensy audio workshop video's (all of them!!) None of them mention what code you must use after using the web based tool??
Please, please, please can someone help me with this. I have no idea what I'm doing but I am willing to learn. I'm starting to lose my mind!!
This is all the code I put in (using the tool, examples & guessing):
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=55,363
AudioFilterBiquad biquad1; //xy=310,341
AudioFilterBiquad biquad2; //xy=312,388
AudioAmplifier amp4; //xy=429,392
AudioAmplifier amp3; //xy=431,341
AudioOutputI2S i2s2; //xy=649,340
AudioConnection patchCord1(i2s1, 0, biquad1, 0);
AudioConnection patchCord2(i2s1, 1, biquad2, 0);
AudioConnection patchCord3(biquad1, amp3);
AudioConnection patchCord4(biquad2, amp4);
AudioConnection patchCord5(amp4, 0, i2s2, 1);
AudioConnection patchCord6(amp3, 0, i2s2, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=422,586
// GUItool: end automatically generated code
const int myInput = AUDIO_INPUT_LINEIN;
//const int myInput = AUDIO_INPUT_LINEIN;
void setup() {
AudioMemory(12);
sgtl5000_1.enable(); // Enable the audio shield
sgtl5000_1.inputSelect(myInput);
sgtl5000_1.volume(1);
// Amplification
amp3.gain(7);
amp4.gain(5);
// Butterworth filter, 48 db/octave
biquad1.setLowpass(0, 200, 1);
// Linkwitz-Riley filter, 48 dB/octave
//biquad1.setLowpass(0, 200, 1);
// Butterworth filter, 48 db/octave
biquad2.setHighpass(0, 200, 1);
// Linkwitz-Riley filter, 48 dB/octave
//biquad2.setHighpass(0, 200, 1);
}
void loop() {
}
Any help / guidance will be appreciated.
Thanks in advance.