Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
Synthpopalooza:
It's in English, maybe someone can translate to Polish?from ctypes import *
from array import array
import wave
pokey = CDLL(r'...\path_to\apokeysnd.dll')
pokey.APokeySound_Initialize(c_byte(0))
def sound(chn, n, gen, amp):
pokey.APokeySound_PutByte(c_int(chn * 2), c_int(n))
pokey.APokeySound_PutByte(c_int(chn * 2 + 1), c_int(gen * 16 + amp))
pokey.APokeySound_PutByte(c_int(8), c_int(0))
def dsound(chn, n, gen, amp):
pokey.APokeySound_PutByte(c_int(chn * 2), c_int(n%256))
pokey.APokeySound_PutByte(c_int((chn+1) * 2), c_int(n//256))
pokey.APokeySound_PutByte(c_int((chn+1) * 2 + 1), c_int(gen * 16 + amp))
pokey.APokeySound_PutByte(c_int(8), c_int(0b00011000))
out = wave.open('pokey.wav', 'wb')
out.setframerate(44100)
out.setnchannels(1)
out.setsampwidth(2)
buf = (c_ubyte * 8192)()
def wait(n):
for i in range(n):
size = pokey.APokeySound_Generate(114 * 312, buf, c_int(16))
out.writeframes(array('B', buf[0:size]))
for i in range(0,0x10000//40,1):
dsound(0, i, 10, 15)
wait(1)
import aubio
import numpy as np
buf_s = int(44100*2/50)
hop_s = int(44100*2/50)
src = aubio.source('pokey.wav', hop_size=hop_s)
print(src.uri, src.samplerate, src.channels, src.duration)
samplerate = src.samplerate
tolerance = 0.8
pitch_o = aubio.pitch("yin", buf_s, hop_s, samplerate)
pitch_o.set_unit("Hz")
pitch_o.set_tolerance(tolerance)
total_frames = 0
while True:
samples, read = src()
pitch = pitch_o(samples)[0]
confidence = pitch_o.get_confidence()
total_frames += read
print (pitch, aubio.freq2note(pitch))
if read < hop_s: break
Synthpopalooza:
I am still going through the course on Duolingo and I am having a hard time keeping vocabulary. I have some of the grammar down but can't remember my noun cases well (like this: Woda jest fajna. Piję wodę. Jestem wodą. Idź do wody.) I had to use the translator to get the endings for woda. :) Hard to remember these ...