Chord Displayer

Started by Hardcoal, March 26, 2023, 21:22:09

Previous topic - Next topic

wadmixfm

#60
Yes its really me :)

Hardcoal

this looks really helpful thanks 
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Hardcoal




I added Long Guitar String Markings
While you play with your midi keyboard you will see which string are being pressed.
Its still needs work but its a start

Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Baggey

Quote from: Hardcoal on September 14, 2024, 15:59:35Hi. first thank for the kind words :)
You go do your 'Sequencer One' program. what's holding you?

I didn't plan to make music apps, I just go dragged into it.

ATM this sampler only sample at one velocity, but I can always add more features.
any idea is welcomed.
Theres still plenty to do, but im working on it

I would like to see the apps you made

this sampler is only a child of all my messing with audio development.
the more basic tools ill have the more cool things I'll be able to create




:))
QuoteI didn't plan to make music apps, I just go dragged into it.
writing emulators and trying to create sound got me interested too! But im seriously lacking the fundamental math's on how many samples for a specific time etc..

and if i change the frequency how i manipulate the samples to fill my sound wave!? :-[

Im still working on the SID for my BlitzmaxNG C64.

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

wadmixfm

i am just finalizing the 2 apps as i type this

i have Specdrum which is an extended clone of the old Spectrum 48k Drum hardware from 1985(c)

and i have MicroRhythm another reinvented clone with a few more features than the original (and nooo baggey these are not type in's from a magazine ) :)

as mentioned i want to create a newer updated version Of Breakthru 2 which was an Atari ST app for 1989 thats going to be a bigger challenge i think but i have a few great people on here , who are willing to chuck in there oar and point me in the right direction

I know there are midi sequencers and daws out there but for ease of use Sequencer one , breakthru 2 was a dodle , you could load up and start recording at the press of a button and the editing feature like tidy block and cut and paste features were amazing for 1989, and some of the old features you dont get in newer sequencers because when you ask for them , they don't know what ya talking about lol

Maybe i am getting old haha

Lee
Yes its really me :)

Hardcoal

[color=var(--link)]Baggey[/color]

We all in the process of learning.. I somehow manage to achieve my goals.. and im not always know what im doing ..
I just keep trying and most of the time forget what ive done, because its working..
But we can share Code.. so each can enjoy the other one success ..
i made myself a huge library .. with examples..
because after a while you will forget what you used to remember..
so its always good to make examples of what you learnt.. and also make functions for each thing you realized..
so you wont need to mess with it no more..

once you make a huge library its becoming exponential.
sadly i only realized this not long ago..
and i wasted years of coding .. no working in this method..

I used to say years ago.. that my moto is "Do it once!" but back than i didn't figure out how exactly to stand on this policy.
but now I do.. much more than I used to.
and it brings really cool fruits
but i still do wish to go back at least 10 years to the past and do it the right way back than.
anyways.. Ill keep looking forwards

[color=var(--link)]wadmixfm[/color]

[color=var(--link)]you do what you love.. regardless whether it exists or not.[/color]
[color=var(--link)]everything you do may lead to something bigger in the future [/color]
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Midimaster

Quote from: Hardcoal on September 15, 2024, 03:47:47theirs those commands 

'alListenerfv(AL_POSITION, [0.0, 0.0, 0.0]) ' Set listener position
'alListenerfv(AL_VELOCITY, [0.0, 0.0, 0.0]) ' Set listener velocity
'alListenerfv(AL_ORIENTATION, [0.0, 0.0, -1.0, 0.0, 1.0, 0.0]) ' Set listener orientation

but i have no idea what to do with them
These are from the 3D features of OpenAL. It offers to put a sound source in the 3D-room and a listener (f.e. the player) And then OpenAL calculates the STEREO impression this listener would have at his position, when he hears this sound. This includes distance volume, STEREO panning and also Doppler effects, when the sound source is moving. The "Doppler Effekt" is the chance of frequency, when a sound source is moving into your direction or away from you.
...back from North Pole.

Hardcoal

Midi.. Im trying to do an equalizer displayer.. so i was looking for a way to read a sample current low pitch high pitch etc..
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Midimaster

This needs to be done with Biquad Filters. This means a real-time manipulation of single sample values by a given algorithm. The algorithm is often only one code line, sometimes a dozen lines, but mostly discovered by chance. Developing such algos is often experimenting with old algos.

There are hundreds of such "algorithms", that have various effects on the "sound", only by manipulating sample after sample (like in a stream). Some are free, most of them are hard to find, the best are top secret.

Equalizers are one of the free ones: Low Pass Filter, High Pass Filter, Band Pass Filter.

I have already researched this and written down my thoughts here:

https://www.syntaxbomb.com/index.php?msg=347054175

I scratched only the surface of this theme, but my results are available for free in my TFilter-Class for BlitzMax.

...back from North Pole.

Baggey

#69
I did some work on this many years ago with op_amps! Inductors and Capacitors! Though ive forgotten most of it. I may still have some knowledge 2.pi.f.l and all that? If it's needed! :D and tuning for Unity resonance factors, from the Electrical side of things :o

I still don't get what's needed in a sample for the time i want!? :-[

QuoteEqualizers are one of the free ones: Low Pass Filter, High Pass Filter, Band Pass Filter.
Kind regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

Midimaster

Quote from: Baggey on September 16, 2024, 18:10:39I still don't get what's needed in a sample for the time i want!?
Do not understand your question...
...back from North Pole.

Baggey

I think i mean. if i have 100 samples and im still not sure what a sample actually is. and i want to play half a second of it. What would i do to make it sound right!?

Im not sure what im trying to ask!? :-X

Kindest Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

Hardcoal

BaggeyYou cant have 100 samples.. its too small..  i mean you can .. but it will be a fraction of a second.. anyways 
a sample is a data bank of bytes.. 
lets say you have a sample of 1 second on a rate of 44100.. hrz...  on 16bit resolution
this means you will have a bank at the size of  176,400 bytes..because each side of the speaker need 16 bit and 16+16 is 32so each fraction of a sample is 32bit
so 32*44100 times a second gives you 176400 bytes..

now if you want to hear only a part of a sample.. you can
copy paste a part of the sample..
and make a new sample which is smaller..
and its the section you want to hear..
thats the way im using..
it involves a byte ptr reading of the location of the data bank
which i dont fully understand but still manage to do it thanks to midimaster..
i admit its not that simple.. but im sure that midi master can send you some sample
of how to cut a sample properly..
if for example you want to lower or raise the volume of  sample. you need to reduce the value of each speaker side.. so lets say your sample value of right side speaker is 10010
you can do 10010*0.8  lowering it in 20%..
Hope this helps
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Midimaster

#73
Yes a TAudioSample is a simple data bank which contains a lot of single values in a non-packed way. This single values are called Samples. A Sample is not more than a volume information for the speaker.

You can cut trunks of this bank as you like. Each trunk stays again a valid Audio. You can manipulate the samples to manipulate the sound.

There are various formats, but the mainly used format is Signed-Short 16bit for one sample.. In this format a single sample has a lenght of a 2 Bytes. This means values between -32768 and +32767

In MONO the bank contains one track. The samples follow step by step through the time.

In STEREO the bank also contains only one track. But two consecutive samples belong together: The first is for LEFT the following for RIGHT channel. So pairs follow step by step through the time.


Timing



To have a sound of one second length you need 44100 samples. This is what we call 44.1kHz sampling rate. You can also have Audio with only 12kHz. This means the quality is not as good as 44.1kHz.

If you have an audio with 44.1kHz and you only send 22050 samples to the speaker, you will hear only the half audio.

If you have an audio and you only send every 2nd samples to the speaker, you will hear the whole audio within 0.5sec and it sounds one octave higher.

If you have an audio and you send each sample twice to the speaker, you will hear the whole audio within 2sec and it sounds one octave lower.





Manipulating the samples

Best practice to access the samples is a SHORT PTR. Starting point is at MySample.Samples

MySample:TAudioSample = LoadAudioSample("test.ogg")
Local Pointer:Short Ptr = MySample.Samples
' Pointer[0] ' first sample
' Pointer[1] ' second sample
' Pointer[2] ' third sample
....
' Pointer[x] ' x-th sample


Normally manipulating the samples would be very easy. But in BlitzMax the data type SHORT is unsigned. Means it knows only positive values from 0 to 65536.  (16²=65536)

So all samples values will be misinterpreted by BlitzMax. During copy or when sending them to the speaker this makes no problems. But when you want to calculate with samples you need to transform them into INTEGER

This is why we need this function:
Local value:Int = ShortInt( Pointer[x] )
...
Function ShortInt:Int( s:Int )
    Return (s Shl 16) Sar 16
End Function

Now you can manipulate the values as you want. As long as you do not leave the limits -32768 and +32767 you easily can return the value into a SHORT:

local value:Int = ShortInt( Pointer[x] )
....
' way back:
Pointer[x] = value * 0.33  ' <--- whatever you want to manipulate

The main manipulation is Volume-Reducing. This is a simple Multiplication with a factor between 0 and 1.
Half volume:
Pointer[x] = value * 0.5  '


Also often used: Mix together several TAudioSamples:

Local value1:Int = ShortInt( PointerA[i] )
Local value2:Int = ShortInt( PointerB[j] )
Local value3:Int = ShortInt( PointerC[k] )
Pointer[x] = value1 + value2 + value3  

Or those mysterious BiQuad-Filter: Mix together several manipulated Sample of the same TAudioSamples:

Local value1:Int = ShortInt( Pointer[i-1] )
Local value2:Int = ShortInt( Pointer[i] )
Local value3:Int = ShortInt( Pointer[i+1] )
Pointer[x] = value1*B1 + value2*B2 + value3*A1 ....
...back from North Pole.

Hardcoal

I think the the first thing im gonna release is the Sampler..
so here is how it looks currently.
Its the nearest thing to be called finished from all my sub projects

Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]