My Music Editor

Started by Hardcoal, May 24, 2021, 23:57:24

Previous topic - Next topic

Hardcoal

Update..

Added Track zoom in and out.. not simple ..but works..
Code

Hardcoal

#121
Added Tracks Scroll

I have a zoom in to Tracks already made, but the problem is that i need to draw all samples again, and its slow..
Unless maybe ill make them high definition to begin with..
any other solution?




Code

iWasAdam

okydoke....  Here's the best way to visualize any type of time line informations:
read through and go with this

1. First get drawing a line from 0 to 1 working like this


2. get your display to scale move whatever and the line goes from 0 to 1 correctly (clips, scales, etc)

3. what you now have is a base prototype you can fit any data into

lets just say the x and y are -10, 20 and the height is 50 and the width is 300
yhalf = height * 0.5
ymid = y + yhalf
you can draw a midline at x,ymid,x+width,ymid

xpos = x
for fpos = 0 to width
frame = (fpos / width) * samplelength
draw frame at xpos
xpos += 1
next

if you really want to be efficient. the best thing is to create  a store for each sample of 256 positions. and fill this with the waveform. then use this as the drawing data - drawing 256 each time



Hardcoal

Code

iWasAdam

if you think of everything as 0=start and 1=end. it becomes simple math to get positions, etc.

length = 300
end = 1
1*300 = 300

so 0.5 = 0.5 * 300 = 150.

using this we can reverse the concept
lets say a playhead now goes from 0 to 1
for any playhead in a sample. the position/frame is playhead * samplelength

and for any given position say 150 in a a sample of 300. pos/length = playhead = 150/300 = 0.5

I know that this is a small abstraction. but once you work in 0 to 1 and get used to it. there are all sorts of things that 'just' happen and you dont need to think about lengths anymore

lets assume that that your frame position doesn't move in units but in doubles and is moving at 0.5. if your sound generation system plays the frame, you are now playing at half speed.

Hardcoal

Code

iWasAdam

ok.
lets say you have an array of 128 floats. with each float going from 0..1

we already have a playhead going from 0 to 1

so for any (playhead * 127) we can get a position (0to 127) which directly amps to the float arrray... with values from 0 to 1

Now... I'm just saying with that sort of data. you could feed the float results into the volume. so if the floats were all 1 then the volume would be at max. all at 0 then the volume would be off.

But... if the float array was a curve, or started at 0 quickly going to 1. staying there for most of the sample. then going back to 0 at the end....
You now have volume fade in/out...


so all you now need is to set channel.volume = volfade

Hardcoal

Adam thanks for all your effort :)
I think i know how to make volume in and out..doesnt seem to complicated . i mean if i use the channelvolume..
but atm all i plan is to do just volume control to a track.. with no fade in and out..
all im doing is play with the idea of a mutli tracker..
i dont even know what I want..

all i know is i want to make music, and im not pleased with the tools i got..
I mean i cant yet find the right frame for me, but it will happen eventually..

I keep your posts in mind .. and i understand what you are saying.. and will use it when time comes..

you also gave me a great help on understanding math as a side effect
Code

Hardcoal

Code

Hardcoal

Added Split Samples option

Code

Hardcoal

#130
Ive managed to make copy Tracks 100 times faster

Still much to work on speed, when considering lots of tracks
Code

Hardcoal

Hey. is their any way i can make a descent piano to be played on my app without vst?
or should i just load for each key a sample for its on?
Code

Midimaster

This has nothing to do with VST.

All E-pianos are working with build-in samples for each key. High quality E-Pianos have even a dozend or more samples for each key, depending on velocity of the keypress.

Didn't you already sample PIANO sounds for a project some month ago?

...on the way to Egypt

Hardcoal

 i didnt sample the piano i used to internal midi piano..

i might simply sample my own Synth..

didnt you say once that i can use those sounds because i bought the synth?

anyway.. i remember there was a piano sound pack somewhere
Code

Midimaster

#134
Yes, you are free to use "recordings" of your E-piano. Even, when they are only one note long. I told you the idea of creating an app, that sends a sequence of MIDI-NOTE commands to the E-Piano to play each key. The E-Piano is also connected to AUDIO-IN of the computer, and so you are able to record the audio result of the MIDI-NOTE as a single samples.

I send you a ZIP file with 62 piano samples from MIDI-NOTE 23 to MIDI-NOTE 84, They are recorded with 500msec and MIDI-VELOCITY=60. They samples are very small, only 15kB each. Recorded from a Roland E96 at 16bit-Stereo-44.1kHz. You can do whatever you want with it. You have my permission! The sounds are Public Domain now. Everybody can use for free.

Here is the ZIP with 62 Piano-Samples:
...on the way to Egypt