-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inizio della versione a linea di comando
- Loading branch information
1 parent
aa2f596
commit 7d8bd85
Showing
59 changed files
with
515 additions
and
45 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
AccordaGUItar/bin/Debug/net8.0-windows7.0/AccordaGUItar.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
AccordaGUItar/bin/Debug/net8.0-windows7.0/AccordaGUItar.exe
Binary file not shown.
Binary file modified
BIN
+4 Bytes
(100%)
AccordaGUItar/bin/Debug/net8.0-windows7.0/AccordaGUItar.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.AssemblyInfoInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cf7d50a86938932fe0154cbaf2b17c14daf17bd2b6c34275e4997c6e2cef64a7 | ||
f2be71a1ef2589e0a0dccc1a3141779699ed6b1320df7ab8a93364a6fa80a198 |
2 changes: 1 addition & 1 deletion
2
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3db0b58dd267c54dfc2b0d2cdaff22410beca87bccd5f74c8c6e8a9d40961b2e | ||
fe20a567920a28446407c79d971cd1fcecc164bfc3b3b69ad403a5e2633307b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+4 Bytes
(100%)
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.genruntimeconfig.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0fccc1bfeafb9a52b2b4fe06f9d74034418f352daa810ca9a13432a6675b4f6b | ||
1cda14dfc667c5e70ff2f53c4ffe2d3cff7a0e1759b4eba1cc60fd7f7467e222 |
Binary file modified
BIN
+4 Bytes
(100%)
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.sourcelink.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"documents":{"C:\\Users\\gpicc\\source\\repos\\accorda\\*":"https://raw.githubusercontent.com/gpicchiarelli/accorda/a93e8860f867ed4963914202293dacaf09842448/*"}} | ||
{"documents":{"C:\\Users\\Giacomo\\source\\repos\\accorda\\*":"https://raw.githubusercontent.com/gpicchiarelli/accorda/aa2f59693ba199c1c97ede6c668daceb30f44ea4/*"}} |
25 changes: 25 additions & 0 deletions
25
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_0wbrsh1c_wpftmp.AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// Il codice è stato generato da uno strumento. | ||
// Versione runtime:4.0.30319.42000 | ||
// | ||
// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se | ||
// il codice viene rigenerato. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
using System; | ||
using System.Reflection; | ||
|
||
[assembly: System.Reflection.AssemblyCompanyAttribute("AccordaGUItar")] | ||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] | ||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] | ||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+aa2f59693ba199c1c97ede6c668daceb30f44ea4")] | ||
[assembly: System.Reflection.AssemblyProductAttribute("AccordaGUItar")] | ||
[assembly: System.Reflection.AssemblyTitleAttribute("AccordaGUItar")] | ||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] | ||
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")] | ||
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")] | ||
|
||
// Generato dalla classe WriteCodeFragment di MSBuild. | ||
|
1 change: 1 addition & 0 deletions
1
...GUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_0wbrsh1c_wpftmp.AssemblyInfoInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
f2be71a1ef2589e0a0dccc1a3141779699ed6b1320df7ab8a93364a6fa80a198 |
13 changes: 13 additions & 0 deletions
13
...net8.0-windows7.0/AccordaGUItar_0wbrsh1c_wpftmp.GeneratedMSBuildEditorConfig.editorconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
is_global = true | ||
build_property.TargetFramework = net8.0-windows7.0 | ||
build_property.TargetPlatformMinVersion = 7.0 | ||
build_property.UsingMicrosoftNETSdkWeb = | ||
build_property.ProjectTypeGuids = | ||
build_property.InvariantGlobalization = | ||
build_property.PlatformNeutralAssembly = | ||
build_property.EnforceExtendedAnalyzerRules = | ||
build_property._SupportedPlatformList = Linux,macOS,Windows | ||
build_property.RootNamespace = AccordaGUItar_0wbrsh1c_wpftmp | ||
build_property.ProjectDir = C:\Users\Giacomo\source\repos\accorda\AccordaGUItar\ | ||
build_property.EnableComHosting = | ||
build_property.EnableGeneratedComInterfaceComImportInterop = |
Binary file added
BIN
+11.1 KB
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_0wbrsh1c_wpftmp.assets.cache
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions
1
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_0wbrsh1c_wpftmp.sourcelink.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"documents":{"C:\\Users\\Giacomo\\source\\repos\\accorda\\*":"https://raw.githubusercontent.com/gpicchiarelli/accorda/aa2f59693ba199c1c97ede6c668daceb30f44ea4/*"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_MarkupCompile.i.lref
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_MarkupCompile.lref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
| ||
FC:\Users\gpicc\source\repos\accorda\AccordaGUItar\App.xaml;; | ||
FC:\Users\Giacomo\source\repos\accorda\AccordaGUItar\App.xaml;; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
AccordaGUItar/obj/Debug/net8.0-windows7.0/ref/AccordaGUItar.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
AccordaGUItar/obj/Debug/net8.0-windows7.0/refint/AccordaGUItar.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
using NAudio.Dsp; | ||
using NAudio.Wave; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Accorda.Audio | ||
{ | ||
public class Audio | ||
{ | ||
private readonly WaveInEvent waveIn; | ||
private const int sampleRate = 44100; | ||
private const int bufferSize = 1024; | ||
private readonly float[] buffer; | ||
private readonly Complex[] complexBuffer; | ||
private readonly BiQuadFilter filter; | ||
|
||
// Aggiunto un evento per rilevare la frequenza istantanea | ||
public event EventHandler<double> DominantFrequencyDetected; | ||
|
||
// Aggiunto un threshold per il volume minimo rilevabile | ||
private double volumeThreshold = 0.1; | ||
|
||
public Audio(int InputDeviceSelector = 0) | ||
{ | ||
waveIn = new WaveInEvent | ||
{ | ||
DeviceNumber = InputDeviceSelector, | ||
BufferMilliseconds = bufferSize * 1000 / sampleRate, | ||
WaveFormat = new WaveFormat(sampleRate, 1) | ||
}; | ||
|
||
buffer = new float[bufferSize]; | ||
complexBuffer = new Complex[bufferSize]; | ||
filter = BiQuadFilter.LowPassFilter(sampleRate, 1000, (float)0.7071); | ||
|
||
waveIn.DataAvailable += WaveIn_DataAvailable; | ||
StartRecording(); | ||
} | ||
|
||
private void WaveIn_DataAvailable(object sender, WaveInEventArgs e) | ||
{ | ||
double maxVolume = 0.0; | ||
|
||
for (int i = 0; i < e.BytesRecorded / 2; i++) | ||
{ | ||
short sample = (short)((e.Buffer[(2 * i) + 1] << 8) | e.Buffer[2 * i]); | ||
buffer[i] = (float)sample / short.MaxValue; | ||
buffer[i] = filter.Transform(buffer[i]); | ||
complexBuffer[i].X = buffer[i]; | ||
complexBuffer[i].Y = 0; | ||
|
||
double volume = Math.Abs(buffer[i]); | ||
if (volume > maxVolume) | ||
{ | ||
maxVolume = volume; | ||
} | ||
} | ||
|
||
if (maxVolume > volumeThreshold) | ||
{ | ||
FastFourierTransform.FFT(true, (int)Math.Log(bufferSize, 2.0), complexBuffer); | ||
|
||
int maxIndex = 0; | ||
double maxMagnitude = 0; | ||
|
||
for (int i = 0; i < bufferSize / 2; i++) | ||
{ | ||
double magnitude = CalculateMagnitude(complexBuffer[i]); | ||
if (magnitude > maxMagnitude) | ||
{ | ||
maxMagnitude = magnitude; | ||
maxIndex = i; | ||
} | ||
} | ||
double frequency = maxIndex * sampleRate / bufferSize; | ||
DominantFrequencyDetected?.Invoke(this, frequency); | ||
} | ||
} | ||
|
||
private double CalculateMagnitude(Complex complex) | ||
{ | ||
return Math.Sqrt((complex.X * complex.X) + (complex.Y * complex.Y)); | ||
} | ||
|
||
public List<string> ElencaDispositiviIngresso() | ||
{ | ||
int inputDeviceCount = WaveInEvent.DeviceCount; | ||
List<string> dispositivi = new(); | ||
for (int deviceIndex = 0; deviceIndex < inputDeviceCount; deviceIndex++) | ||
{ | ||
WaveInCapabilities deviceInfo = WaveInEvent.GetCapabilities(deviceIndex); | ||
dispositivi.Add($"Dispositivo {deviceIndex + 1}: {deviceInfo.ProductName}"); | ||
} | ||
return dispositivi; | ||
} | ||
|
||
private void StartRecording() | ||
{ | ||
waveIn.StartRecording(); | ||
} | ||
|
||
public void StopRecording() | ||
{ | ||
waveIn.StopRecording(); | ||
} | ||
|
||
// Aggiunto un metodo per impostare il threshold di volume | ||
public void SetVolumeThreshold(double threshold) | ||
{ | ||
volumeThreshold = threshold; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/// <summary> | ||
/// Namespace for frequency constants | ||
/// </summary> | ||
namespace accorda.Note | ||
{ | ||
/// <summary> | ||
/// Class for frequency constants | ||
/// </summary> | ||
public class NoteMusicali | ||
{ | ||
/// <summary> | ||
/// The mi basso | ||
/// </summary> | ||
public const double Mi_Basso = 82.41; | ||
/// <summary> | ||
/// The la | ||
/// </summary> | ||
public const double La = 110; | ||
/// <summary> | ||
/// The re | ||
/// </summary> | ||
public const double Re = 146.83; | ||
/// <summary> | ||
/// The sol | ||
/// </summary> | ||
public const double Sol = 196; | ||
/// <summary> | ||
/// The si | ||
/// </summary> | ||
public const double Si = 246.94; | ||
/// <summary> | ||
/// The mi alto | ||
/// </summary> | ||
public const double Mi_Alto = 329.63; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
Console.WriteLine("Hello, World!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>accorda_cli</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\LICENSE" Link="LICENSE"> | ||
<PackagePath>\</PackagePath> | ||
<Pack>True</Pack> | ||
</None> | ||
<None Include="..\README.md" Link="README.md"> | ||
<PackagePath>\</PackagePath> | ||
<Pack>True</Pack> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
4 changes: 4 additions & 0 deletions
4
accorda-cli/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// <autogenerated /> | ||
using System; | ||
using System.Reflection; | ||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// Il codice è stato generato da uno strumento. | ||
// Versione runtime:4.0.30319.42000 | ||
// | ||
// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se | ||
// il codice viene rigenerato. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
using System; | ||
using System.Reflection; | ||
|
||
[assembly: System.Reflection.AssemblyCompanyAttribute("accorda-cli")] | ||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] | ||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] | ||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+aa2f59693ba199c1c97ede6c668daceb30f44ea4")] | ||
[assembly: System.Reflection.AssemblyProductAttribute("accorda-cli")] | ||
[assembly: System.Reflection.AssemblyTitleAttribute("accorda-cli")] | ||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] | ||
|
||
// Generato dalla classe WriteCodeFragment di MSBuild. | ||
|
1 change: 1 addition & 0 deletions
1
accorda-cli/obj/Debug/net8.0/accorda-cli.AssemblyInfoInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d02a347f02f655ab8761ae3554b1ebe99d0c3c323d064f497867b08b87f1cca2 |
Oops, something went wrong.